fastest-validator
fastest-validator copied to clipboard
Error object includes expected regex pattern
This information can help attackers to find valid patterns that cause problems or find a way to bypass validations. Too risky
Why only regex pattern causes this problem?
{ type: "string", min: 3, max: 6, alpha: true }
Same as
{ type: "string", pattern: ^/[a-zA-Z]{3,6}$/ }
If it's a problem, would be better a validator option to disable expect values, like errorExpectedValue: false
validator option to disable expect values, like errorExpectedValue: false
Like it, It's a good way
If it's a problem...
In general, it's not. but people may carelessly use unsafe patterns from web