Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always first perform least expensive validations #234

Open
Glitchy-Tozier opened this issue Sep 10, 2022 · 1 comment
Open

Always first perform least expensive validations #234

Glitchy-Tozier opened this issue Sep 10, 2022 · 1 comment

Comments

@Glitchy-Tozier
Copy link

Basically, first perform length-checks (especially for arrays) and only then perform all other checks. Perform custom checks last.

This is to aid as an additional buffer against primitive DOS attacks.

@jmjoy
Copy link

jmjoy commented Jan 18, 2024

Maybe throw a compile-time warning when length-checks aren't defined firstly in #[validate] is a good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants