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

readSafeJSONBody() #819

Open
1 task
pi0 opened this issue Jul 8, 2024 · 2 comments
Open
1 task

readSafeJSONBody() #819

pi0 opened this issue Jul 8, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@pi0
Copy link
Member

pi0 commented Jul 8, 2024

Describe the feature

H3 v2 is removing destr support from readBody utility. This is to reduce bundle size and leverage native Response.json() of the runtime platforms when possible.

While we should ALWAYS validate user input, in certain cases, user input might cause prototype poisoning.

We can introduce new readSafeJSONBody util with destr

Additional information

  • Would you be willing to help implement this feature?
@pi0 pi0 added the enhancement New feature or request label Jul 8, 2024
@pi0 pi0 mentioned this issue Jul 8, 2024
@pi0 pi0 mentioned this issue Sep 11, 2024
1 task
@kaaax0815
Copy link

Please implement this. With a option to limit file size to avoid DoS

@itpropro
Copy link
Member

Hey @pi0, is the impact on the bundle size really that big that is make sense to sacrifice secure JSON parsing (I would argue that destr performance impact is negligible)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants