-
Couldn't load subscription status.
- Fork 94
Open
Description
Code
import FastestValidator from 'fastest-validator';
const v = new FastestValidator();
const check = v.compile({
id: { type: 'number', max: 'console.log("ALERT")' }
});
check({id:123});will print 'ALERT'.
Ajv validator has similar architecture but is secure for such types of attacks.
It is possible to guard against such type of attack with quoting of parameters which can be done in compile-time
"Ajv Safe code generation" - https://ajv.js.org/codegen.html#safe-code-generation
intech, janrudowski and igolskyiFowiFlowi
Metadata
Metadata
Assignees
Labels
No labels