Vant Application Firewall - input validation.
VAF validates all input:
Validate input:
const vaf = require('./lib/vaf');
vaf.check('input', { type: 'string', maxLength: 500 });
| Option | What |
|---|---|
| type | string, number, object, array |
| maxLength | Max length |
| pattern | Regex pattern |
| required | Must be present |
VAF blocks:
| Pattern | Example |
|---|---|
| Path traversal | ../etc/passwd |
| Shell chars | ; rm -rf |
| Env vars | $HOME |
| Word stacking | vant vant vant |
vaf.configure({
maxLength: 50000,
blockPathTraversal: true,
blockShellChars: true,
blockEnvVars: true
});
VAF runs on all inputs:
// All storage operations go through VAF
brain.write('category', 'file', content);