CVE-2023-31606 is a high-severity (CVSS 7.5) CWE-1333 vulnerability in RedCloth. 2 public exploit or proof-of-concept references are indexed, so weaponization risk is real. A fix is available for RedCloth — see the affected versions and patch details below.
RedCloth Regular Expression Denial of Service issue
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
RedClothReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects RubyGems packages — download data is not available via public APIs for these ecosystems.
Description
A Regular Expression Denial of Service (ReDoS) issue was discovered in the sanitize_html function of redcloth gem v4.0.0. This vulnerability allows attackers to cause a Denial of Service (DoS) via supplying a crafted payload.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 💎RubyGems | RedCloth | all versions | 4.3.3bundle update RedCloth --conservative |
Affected Products
redclothpromptworksResearch use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for RedCloth, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update RedCloth to 4.3.3 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2023-31606 is resolved across your whole dependency graph.
Workarounds
Cap what an attacker can consume: apply request size, rate and timeout limits in front of the affected component, and run it with memory and CPU limits so exhaustion degrades one worker rather than the whole service.
Frequently Asked Questions
Is CVE-2023-31606 in your dependencies?
Find it across RubyGems, including transitive dependencies.