fix: File upload Content-Type override via extension mismatch (GHSA-vr5f-2r24-w5hc)#10383
Conversation
…pload When both a filename extension and Content-Type header are present during file upload, the Content-Type is now derived from the extension instead of passing the raw user-provided Content-Type to the storage adapter.
|
🚀 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. Tip
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. |
📝 WalkthroughWalkthroughAdds a test suite for a stored XSS vulnerability (GHSA-vr5f-2r24-w5hc) that validates file upload handling when Content-Type headers mismatch filename extensions, and updates MIME type resolution logic to always prioritize file extension-derived MIME types while preserving explicitly provided Content-Type values as fallback. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## alpha #10383 +/- ##
==========================================
- Coverage 92.52% 92.12% -0.41%
==========================================
Files 192 192
Lines 16568 16568
Branches 231 231
==========================================
- Hits 15330 15263 -67
- Misses 1216 1279 +63
- Partials 22 26 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
## [9.7.1-alpha.4](9.7.1-alpha.3...9.7.1-alpha.4) (2026-04-02) ### Bug Fixes * File upload Content-Type override via extension mismatch ([GHSA-vr5f-2r24-w5hc](GHSA-vr5f-2r24-w5hc)) ([#10383](#10383)) ([dd7cc41](dd7cc41))
|
🎉 This change has been released in version 9.7.1-alpha.4 |
Issue
File upload Content-Type override via extension mismatch (GHSA-vr5f-2r24-w5hc)
Tasks