fix: Stored cross-site scripting (XSS) via SVG file upload (GHSA-hcj7-6gxh-24ww)#10136
Conversation
|
🚀 Thanks for opening this pull request! We appreciate your effort in improving the project. Please let us know once your pull request is ready for review. Note Please respond to review comments from AI agents just like you would to comments from a human reviewer. Let the reviewer resolve their own comments, unless they have reviewed and accepted your commit, or agreed with your explanation for why the feedback was incorrect. Caution Pull requests must be written using an AI agent with human supervision. Pull requests written entirely by a human will likely be rejected, because of lower code quality, higher review effort and the higher risk of introducing bugs. Please note that AI review comments on this pull request alone do not satisfy this requirement. |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
📝 WalkthroughWalkthroughUpdates block SVG uploads alongside HTML: tests added to assert SVG blocking, default fileExtensions regex and docs updated to exclude SVG, and FileUploadOptions gained a new public field Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/Options/index.js`:
- Around line 651-652: The default allowed-extensions pattern in Options (in
src/Options/index.js) currently blocks ".svg" but not MIME subtype "svg+xml", so
update the DEFAULT pattern (the array with
"^(?!([xXsS]?[hH][tT][mM][lL]?|[sS][vV][gG])$)") to also reject "svg+xml" (e.g.
include svg(?:\\+xml)? in the negative lookahead) so FilesRouter fallback using
contentType.split('/')[1] cannot bypass the rule; after changing the pattern in
the Options default, run "npm run definitions" to regenerate
src/Options/Definitions.js and src/Options/docs.js.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 42df357d-fb50-4047-a082-3cd7b4aeb27f
📒 Files selected for processing (4)
spec/ParseFile.spec.jssrc/Options/Definitions.jssrc/Options/docs.jssrc/Options/index.js
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## alpha #10136 +/- ##
=======================================
Coverage 92.71% 92.71%
=======================================
Files 192 192
Lines 16062 16062
Branches 183 183
=======================================
Hits 14892 14892
Misses 1158 1158
Partials 12 12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
## [9.5.2-alpha.4](9.5.2-alpha.3...9.5.2-alpha.4) (2026-03-08) ### Bug Fixes * Stored cross-site scripting (XSS) via SVG file upload ([GHSA-hcj7-6gxh-24ww](GHSA-hcj7-6gxh-24ww)) ([#10136](#10136)) ([93b784d](93b784d))
|
🎉 This change has been released in version 9.5.2-alpha.4 |
Pull Request
Issue
Stored cross-site scripting (XSS) via SVG file upload (GHSA-hcj7-6gxh-24ww)
Tasks
Summary by CodeRabbit
Bug Fixes
Documentation
New Features
Tests