@milkdown/crepe is vulnerable to Regular Expression Denial of Service (ReDoS)
28
CVE Score
Low
Regular Expression Denial of Service (ReDoS)
The built-in OpenAI and Anthropic LLM providers in the crepe editor normalize a caller-supplied provider baseURL with a regular expression (replace(/\/+$/, '')) that strips trailing slashes. On inputs containing long runs of / that are not anchored at the very end, the \/+$ sub-expression backtracks quadratically, so an application that forwards untrusted input into the provider baseURL can be driven into O(n^2) CPU time and stalled. The regex was flagged by CodeQL as js/polynomial-redos. The fix replaces it with a linear stripTrailingSlashes helper that scans characters via charCodeAt without backtracking.
Upgrade the @milkdown/crepe library to the patch version.
You are affected if you are using a version that falls within the vulnerable range and you enable the crepe AI feature with an OpenAI or Anthropic provider whose baseURL can be influenced by untrusted input.
7.21.0 - 7.21.0
Fixed in 7.21.1@milkdown/crepe is vulnerable to Regular Expression Denial of Service (ReDoS) in versions 7.21.0 - 7.21.0.
Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.
No credit card required | Scan results in 32 seconds.
I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant
ISO 42001Compliant© All Intel data is openly available and commercially licensed.