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

fix(security): sanitize fields and tables when using nestTables #2702

Merged
merged 2 commits into from
May 26, 2024

Conversation

wellwelwel
Copy link
Sponsor Collaborator

Improves the changes from #2591 by validating nestTables final fields and tables.


I'm not sure about the need to validate when used in combination with the rowAsArray option:

For now, I've applied validation to all the properties created in result object.

} else if (options.rowsAsArray) {
  lvalue = `result[${helpers.fieldEscape(i.toString(10))}]`;
} else {

Copy link

codecov bot commented May 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.32%. Comparing base (8b5f691) to head (1bde405).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2702      +/-   ##
==========================================
- Coverage   90.32%   90.32%   -0.01%     
==========================================
  Files          71       71              
  Lines       15727    15726       -1     
  Branches     1340     1342       +2     
==========================================
- Hits        14206    14205       -1     
  Misses       1521     1521              
Flag Coverage Δ
compression-0 90.32% <100.00%> (-0.01%) ⬇️
compression-1 90.32% <100.00%> (-0.01%) ⬇️
tls-0 89.85% <100.00%> (-0.01%) ⬇️
tls-1 90.15% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wellwelwel wellwelwel marked this pull request as ready for review May 24, 2024 17:33
@sidorares
Copy link
Owner

sidorares commented May 25, 2024

thanks @wellwelwel !
LGTM, but I can't see how can i.toString(10) ever possibly dangerous, probably no need for sanitization here?

@wellwelwel
Copy link
Sponsor Collaborator Author

thanks @wellwelwel ! LTM, but I can't see how can i.toString(10) ever possibly dangerous, probably no need for sanitization here?

It's done 🙋🏻‍♂️

@sidorares sidorares merged commit efe3db5 into sidorares:master May 26, 2024
64 checks passed
@wellwelwel wellwelwel deleted the sanitize-3 branch May 27, 2024 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants