fix: enforce RFC 2183/7578 compliance for quoted Content-Disposition parameters#194
fix: enforce RFC 2183/7578 compliance for quoted Content-Disposition parameters#194climba03003 merged 2 commits intomainfrom
Conversation
…parameters Properly parse Content-Disposition filename parameters by stopping at the closing quote instead of continuing to parse characters after it. This fixes the security issue where filename="payload.jpg".html was incorrectly parsed as payload.jpg.html instead of payload.jpg. The fix ensures that quoted parameter values are correctly terminated at their closing quotes, preventing potential security vulnerabilities from malformed Content-Disposition headers.
|
I do believe our current implementation is the correct interpretation of RFC. From the example, |
|
@climba03003 I'm checking this PR again, and I think the RFC822 doesn't apply here. The RFC 822 example is email address syntax, not HTTP parameter parsing, so it doesn’t apply here. Per RFC 9110 §5.6.6 / RFC 6266 §4.1, a Keeping |
Summary
filename="payload.jpg".htmlwas incorrectly parsed aspayload.jpg.htmlinstead ofpayload.jpgTest plan