You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constschema=Joi.object().keys({id: Joi.number()})letid=10107199254749992console.log(id>Number.MAX_SAFE_INTEGER)// logs 'true'parseInt(110107199254749992)==110107199254749980// = true, because the value is too high
when using an integer value > Number.MAX_SAFE_INTEGER, Joi simply parsed the value without warning.
This resulted in values being valid, when they're not
I think there should be a verification with Number.isSafeInteger(value) before parsing a number
The text was updated successfully, but these errors were encountered:
Have you called integer at least ? This won't work on floats obviously so it might still be a problem depending on your requirements but still a good remediation in the meantime.
Context
when using an integer value > Number.MAX_SAFE_INTEGER, Joi simply parsed the value without warning.
This resulted in values being valid, when they're not
I think there should be a verification with
Number.isSafeInteger(value)
before parsing a numberThe text was updated successfully, but these errors were encountered: