fix(runner): remove exponential backtracking from the content-disposition filename regex - #5639
Conversation
…tion filename regex
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
CodeQL flagged the quoted-filename regex in the runner's attachment client (js/redos, high): the escape branch
\\.and the plain branch[^"]both match a backslash, so an unterminated quote full of escape pairs backtracks exponentially. The header comes from our own API, so exploitation needs a compromised or misbehaving server, but the fix is one character class: the plain branch now excludes the backslash, making the alternation unambiguous and linear. A regression test feeds the hostile shape (50,000 escape pairs, no closing quote) and bounds the parse time. Well-formed inputs parse identically, pinned by the existing cases.https://claude.ai/code/session_01McMogkcDRV7UpSAjfd8VKG