CVE-2020-26303 is a high severity (CVSS 7.5) regular expression denial of service flaw in insane, a whitelist oriented HTML sanitizer for JavaScript. Versions 2.6.2 and prior are affected. No patch was known when the record was published, so replace it or guard its input.
What's affected
- insane versions 2.6.2 and prior, per the record.
- Fixed: none known at publication. GitHub Security Lab's advisory names no fixed version either, so check the project's issue 19 for current status.
The record scores it 7.5 (High) with vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H. The record does not flag it as a CISA Known Exploited Vulnerability, and none of the pages I read report exploitation in the wild.
How to check if you're exposed
Run npm ls --all | grep -i insane in your project to see whether it is a direct or transitive dependency. A lockfile search works too. You can also paste your manifest into the free scanner at gold.safeguard.sh/scan.
What to do now
- Search every repository and lockfile for the insane package.
- Check the upstream issue for a fixed release.
- If none exists, move to a maintained sanitizer.
- Until then, cap the length of text passed to insane and run it behind a timeout.
- Re-scan after the change to confirm it is gone.
After you patch, record the new version for insane in your asset inventory, and confirm it with the same check you used above. A fix that was never verified is easy to forget, and an inventory that shows versions is what lets you answer the next advisory in minutes instead of days.
Why it matters
The record maps this to CWE-1333, inefficient regular expression complexity. A pattern that backtracks without bound can take exponential time on a crafted string, so a single request can tie up a Node.js process, which is single threaded. GitHub Security Lab found these with a CodeQL query and published the advisory in July 2021 after a disclosure deadline expired. In insane the advisory points at the rstart expression, which can hang sanitizing for crafted input.
To check open source components in your own projects for known CVEs like this one, try the free in-browser dependency scan at gold.safeguard.sh/scan, or look the CVE up in the Gold directory.
Try it yourself
Click through it at your own pace, or open it full screen.
Quick check
Can I fix it by upgrading?
The record says no known patches were available. Check the upstream issue, and if nothing has shipped, replace the package.
How do I find every place insane is used?
Start with an inventory of installed software and versions, because you cannot patch what you have not found. Check servers, build hosts, test copies and anything a vendor bundles. For open source libraries, a dependency scan or SBOM gives the same list for your code.
Sources
- https://securitylab.github.com/advisories/GHSL-2020-289-redos-insane/
- https://github.com/bevacqua/insane/issues/19
Last reviewed: 19 October 2026.