Skip to main content

RubyLLM EUVDEUVD-2026-89427

| CVE-2026-67987 HIGH
Inefficient Regular Expression Complexity (ReDoS) (CWE-1333)
2026-09-29 cve@mitre.org GHSA-5m38-526f-3498
7.5
CVSS 3.1 · Vendor: mitre
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Influence or control LLM endpoint response
  2. Delivery
    Return payload with many unterminated <think> tags
  3. Exploit
    App parses response via vulnerable think-tag regexes
  4. Execution
    Polynomial backtracking spikes CPU
  5. Impact
    Chat-completion processing delayed/degraded

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V2 - Validation and Business Logic Regex complexity limits
MITRE ATT&CK

1 technique across 1 tactic: Impact

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Requires three stacked conditions: (1) the application uses crmne/ruby_llm at/around commit fa6f2798 with the regex-based <think>-tag response parsing in chat.rb and stream_accumulator.rb; (2) it runs on Ruby 3.1.x, since Ruby 3.2+ regex optimizations mitigate the backtracking; and (3) the attacker can shape the MODEL RESPONSE to include many unterminated <think> tags - a malicious or compromised model endpoint, a prompt-injection coercing such output, or a MitM on the LLM API connection. The host application exposes no direct unauthenticated network surface for this; exploitation is gated by control over the upstream model output rather than by any ruby_llm configuration. Impact is limited to CPU consumption and processing delay in the request handling the response.

Impact

All real-world signals point to a low priority despite the input CVSS of 7.5. The vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H is network, low-complexity and unauthenticated, but the A:H (high availability impact) appears inflated: the flaw is a POLYNOMIAL-time ReDoS (CWE-1333), not exponential, and the description itself characterizes the effect as 'excessive CPU consumption' that 'delay[s] chat-completion processing' rather than a crash or sustained outage - this argues for A:L and a real base score closer to 5.3. EPSS is 0.17% (5th percentile), among the lowest tiers, consistent with no public exploit and no scanning interest. Not in CISA KEV; no POC identified. A nuance limits the PR:N framing: although ruby_llm requires no application authentication, triggering the bug requires an attacker to influence the MODEL RESPONSE (many unterminated <think> tags), which in practice means a malicious/compromised model endpoint, a prompt-injection coercing such output, or a MitM on the LLM API connection - the host app is not a direct network attack surface. Finally the condition is Ruby-version-specific: Ruby 3.1.x is affected, while Ruby 3.2+ regex linear-time/memoization optimizations largely mitigate this class. Net: low real-world risk, further gated by product obscurity and runtime version.

Exploit ScenarioDerived

An application using the ruby_llm gem at the vulnerable commit on Ruby 3.1.x connects to an LLM endpoint an attacker controls or can influence (malicious provider, prompt-injected output, or MitM). The attacker returns a chat completion containing many unterminated <think> tags, driving lazy backtracking in the two think-tag parsing regexes to consume excessive CPU and delay request processing. No public exploit code or active exploitation is identified at time of analysis.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
No patch listed yet 0.2% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Oct 01, 2026

Polynomial-time regular expression denial-of-service in the crmne/ruby_llm library's <think>-tag response parsing can be triggered when a model response contains many unterminated <think> tags, driving excessive CPU consumption and delaying chat-completion processing. Only deployments pinned near commit fa6f279847d6d7027814539d9c0dfc3bbdfd2a83 and running on Ruby 3.1.x are affected, since Ruby 3.2+ regex engine optimizations mitigate the backtracking; RubyLLM exposes no direct network surface of its own, so an attacker must be able to shape the upstream LLM response (malicious/compromised model endpoint, prompt injection, or interception of the model API connection). No public exploit code has been identified at time of analysis, EPSS is 0.17% (5th percentile), and there is no CISA KEV listing; the consensus signal is a low-priority issue despite the vendor-assigned 7.5 score, with real impact limited to CPU consumption and processing delay in the request handling the response.

RemediationAI

Upstream fix available (PR/commit); released patched version not independently confirmed - apply commit 5e88411f171721b381853fa77d254e266dcf6ad8 (https://github.com/crmne/ruby_llm/commit/5e88411f171721b381853fa77d254e266dcf6ad8), which removes the regex-based <think>-tag extraction in lib/ruby_llm/protocols/chat_completions/chat.rb and the stream-accumulator tag state machine; confirm your pinned revision is at or after that commit rather than assuming a specific gem version number, since none is confirmed in the source data. If the patch cannot be applied immediately, the most surgical mitigation is to stop passing string content through think-tag extraction (the code path removed by the fix), at the cost of losing inline reasoning-block splitting and any UI that depends on separate thinking text. Running the application on Ruby 3.2 or later also mitigates the backtracking via regex engine optimizations, though this is a runtime-wide upgrade with broader regression-testing implications rather than a targeted fix. Because exploitation requires control over the model response, reduce that prerequisite: use TLS and, where supported, certificate pinning to the LLM endpoint to defeat interception, treat all model output as untrusted and constrain prompt-injection surface, and cap or truncate response body size before parsing so a pathological payload cannot be delivered at scale. Vendor references: https://github.com/crmne/ruby_llm and https://nvd.nist.gov/vuln/detail/CVE-2026-67987 (EUVD-2026-89427).

Affected VersionsENISA

n/a n/a

Affects your stack

Find out whether the stacks and servers you run are on an affected version.

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

RubyLLM is a Ruby library for interacting with LLM chat-completion APIs. Its chat-completions protocol layer (lib/ruby_llm/protocols/chat_completions/chat.rb) and its streaming accumulator (lib/ruby_llm/stream_accumulator.rb) previously parsed model output for inline reasoning blocks delimited by <think>...</think> and stripped them from the user-visible content. The extraction logic used two consecutive regular expressions - a scan of %r{<think>(.*?)</think>}m and a gsub of %r{<think>.*?</think>}m - plus a streaming state machine that held back partial tags across chunk boundaries. Because these patterns involve nested quantifiers over arbitrary-length content, they exhibit catastrophic/polynomial backtracking on inputs containing many opening <think> tags with no matching closing tag; this is CWE-1333, Inefficient Regular Expression Complexity. The pathological behavior is runtime-dependent: Ruby 3.1.x's regex engine does not have the internal optimizations introduced in Ruby 3.2+, which is why the advisory scopes the issue specifically to Ruby 3.1.x. The upstream fix (commit 5e88411f171721b381853fa77d254e266dcf6ad8) removes the regex-based think-tag extraction entirely, deletes extract_think_tag_content and the stream-accumulator tag state machine (handling content as opaque text) and updates the thinking feature documentation accordingly; the code is reachable only by the client parsing a response, not by a remotely reachable endpoint in the library itself.

Know when Ruby gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (mitre) PRIMARY 7.5 HIGH
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
vuln.today AI 5.3 MEDIUM

PR:N since no app auth is needed, but A:L not A:H because the polynomial ReDoS causes CPU delay rather than full denial of service.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N

Primary rating from Vendor (mitre).

CVSS VectorVendor: mitre

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

Lifecycle Timeline

3
CVSS changed
Oct 01, 2026 - 16:22 NVD
7.5 (HIGH)
CVE Published
Sep 29, 2026 - 20:17 cve.org
UNKNOWN (no severity yet)
CVE Published
Sep 29, 2026 - 20:17 cve.org
HIGH 7.5

DescriptionCVE.org

crmne/ruby_llm at commit fa6f279847d6d7027814539d9c0dfc3bbdfd2a83 contains polynomial-time regular expression denial-of-service conditions in think-tag response parsing on Ruby 3.1.x. A malicious or anomalous model response containing many unterminated <think> tags can cause excessive CPU consumption in two consecutive regular expressions and delay chat-completion processing

Executive ViewAI

Why It Matters

The crmne/ruby_llm library at commit fa6f279847d6d7027814539d9c0dfc3bbdfd2a83, when run on Ruby 3.1.x, can experience excessive CPU consumption and delayed chat-completion processing if an attacker can influence the upstream model response to contain many unterminated <think> tags. Affected teams are those running that pinned library and Ruby version combination while relying on external LLM endpoints that could be malicious, compromised, or intercepted. Leadership should care because this is a low-likelihood availability issue for AI chat features rather than a broadly exploitable network-facing vulnerability; no public exploit identified at time of analysis, with no CISA KEV listing.

Business Impact: Low
Compensating Controls

No vendor-released patch identified at time of analysis; interim mitigations include upgrading Ruby 3.1.x to Ruby 3.2+ where possible, limiting and validating model response size and content, stripping or rejecting unterminated <think> tags before parsing, enforcing request timeouts, concurrency caps, CPU quotas, and process isolation, restricting LLM endpoints to trusted sources, protecting model API connection integrity, and monitoring for CPU spikes.

Threat Intelligence Overview

EPSS Score
0.2%
Top 95% exploitable
Prevalence
Low
niche open-source Ruby LLM-client gem, limited production footprint
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.2%
Patch available No
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
Yes
Human Impact
Low
Technical Impact
Partial

Priority Score

38
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +38
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

More in Ruby

View all
CVE-2017-17405 HIGH POC
8.8 Dec 15

Ruby before 2.4.3 allows Net::FTP command injection. Rated high severity (CVSS 8.8), this vulnerability is remotely expl

CVE-2017-17790 CRITICAL POC
9.8 Dec 20

The lazy_initialize function in lib/resolv.rb in Ruby through 2.4.3 uses Kernel#open, which might allow Command Injectio

CVE-2017-14064 CRITICAL POC
9.8 Aug 31

Ruby through 2.2.7, 2.3.x through 2.3.4, and 2.4.x through 2.4.1 can expose arbitrary memory during a JSON.generate call

CVE-2016-2336 CRITICAL POC
9.8 Jan 06

Type confusion exists in two methods of Ruby's WIN32OLE class, ole_invoke and ole_query_interface. Rated critical severi

CVE-2026-77602 CRITICAL POC
9.9 Sep 23

Authenticated remote code execution in OpenC3 COSMOS (Ruby gem 'openc3' versions 5.1.0 through 7.2.1) lets any logged-in

CVE-2016-2337 CRITICAL POC
9.8 Jan 06

Type confusion exists in _cancel_eval Ruby's TclTkIp class method. Rated critical severity (CVSS 9.8), this vulnerabilit

CVE-2016-2339 CRITICAL POC
9.8 Jan 06

An exploitable heap overflow vulnerability exists in the Fiddle::Function.new "initialize" function functionality of Rub

CVE-2017-9225 CRITICAL POC
9.8 May 24

An issue was discovered in Oniguruma 6.2.0, as used in Oniguruma-mod in Ruby through 2.4.1 and mbstring in PHP through 7

CVE-2026-27614 CRITICAL POC
9.3 Feb 25

Stored XSS in Bugsink error tracking tool before 2.0.13 allows unauthenticated attackers to inject persistent scripts th

CVE-2017-0898 CRITICAL POC
9.1 Sep 15

Ruby before 2.4.2, 2.3.5, and 2.2.8 is vulnerable to a malicious format string which contains a precious specifier (*) w

CVE-2013-4164 MEDIUM POC
6.8 Nov 23

Heap-based buffer overflow in Ruby 1.8, 1.9 before 1.9.3-p484, 2.0 before 2.0.0-p353, 2.1 before 2.1.0 preview2, and tru

CVE-2026-71847 HIGH POC
8.7 Aug 07

Heap-use-after-free in the Ruby json gem's native C extension (versions 2.20.0 through 2.21.1) allows an unauthenticated

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy