CVE-2023-31606
Ruby vulnerability analysis and mitigation

Overview

A Regular Expression Denial of Service (ReDoS) issue was discovered in the sanitize_html function of redcloth gem v4.0.0. This vulnerability was disclosed on June 6, 2023, affecting RedCloth versions from 4.0.0 up to 4.3.2. The vulnerability allows attackers to cause a Denial of Service (DoS) via supplying a crafted payload (NVD, Debian LTS).

Technical details

The vulnerability exists in the sanitize_html function which uses the regular expression pattern /<(/)([A-Za-z]\w*)(&gt;?)(\s?/?)>/ to sanitize HTML tags. When this regex pattern matches against user-provided input, it can trigger catastrophic backtracking, leading to excessive CPU usage and processing time. The vulnerability has been assigned a CVSS v3.1 base score of 7.5 (High) with the vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H (GitHub Issue, NVD).

Impact

When exploited, this vulnerability can cause significant server-side resource consumption, leading to a denial of service condition. The attack requires no privileges or user interaction and can be executed remotely, affecting the availability of the system while maintaining no impact on confidentiality or integrity (NVD).

Exploitability

The vulnerability can be exploited by supplying a specially crafted payload to the sanitize_html function. The attack can be triggered using the RedCloth.new(text, [:sanitize_html]).to_html function with malicious input. The exploitation requires no special privileges or user interaction, making it relatively easy to execute (GitHub POC).

Mitigation and workarounds

Various distributions have released patches to address this vulnerability. Debian 10 has fixed the issue in version 4.3.2-3+deb10u1, and Gentoo has released version 4.3.2-r5 to address the vulnerability. Ubuntu has also released fixes across multiple versions: 23.04 (4.3.2-4ubuntu0.23.04.1), 22.04 LTS (4.3.2-4ubuntu0.22.04.1), 20.04 LTS (4.3.2-3+deb10u1build0.20.04.1), and 18.04 LTS (4.3.2-3ubuntu0.1~esm1) (Debian LTS, Gentoo).

Additional resources


SourceThis report was generated using AI

Related Ruby vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-55107CRITICAL10
  • Ruby logoRuby
  • kobako
NoYesAug 18, 2026
CVE-2026-61666HIGH8.9
  • Ruby logoRuby
  • ruby-websocket-driver
NoYesAug 17, 2026
CVE-2026-73648MEDIUM5.1
  • Ruby logoRuby
  • ruby3.2-rails-8.0
NoYesAug 13, 2026
CVE-2026-73426MEDIUM4.6
  • JavaScript logoJavaScript
  • action_text-trix
NoYesAug 18, 2026
CVE-2026-73428MEDIUM4.6
  • JavaScript logoJavaScript
  • trix
NoYesAug 13, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management