CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-33176
6.6

CVE-2026-33176: Denial of Service via Scientific Notation in Rails Active Support Number Helpers

Alon Barad
Alon Barad
Software Engineer

Mar 23, 2026·5 min read·4 visits

No Known Exploit

Executive Summary (TL;DR)

Rails Active Support number helpers are vulnerable to DoS attacks due to unbounded memory expansion when processing scientific notation strings into BigDecimals.

A medium-severity Denial of Service (DoS) vulnerability exists in the Active Support component of Ruby on Rails. Unsanitized string inputs containing scientific notation cause excessive memory allocation and CPU consumption during BigDecimal formatting operations, resulting in application resource exhaustion.

Vulnerability Overview

Rails Active Support provides various number helper functions, such as number_to_currency and number_to_percentage. These functions facilitate the formatting of numerical data for presentation in web applications. The vulnerability, tracked as CVE-2026-33176 and classified under CWE-400 and CWE-770, affects how these specific helpers process string-based inputs.

The attack vector involves a network-based denial of service. The flaw is triggered when application endpoints pass unvalidated, user-supplied strings directly into the vulnerable helpers. The underlying mechanical failure lies in the conversion of string-based scientific notation into highly expanded floating-point representations during the formatting sequence.

Applications processing malicious inputs experience immediate and severe resource exhaustion. The Ruby interpreter attempts to allocate exceptionally large string objects to satisfy the formatting requirements. This operation results in out-of-memory errors or significant thread blocking, severely degrading application availability.

Root Cause Analysis

The root cause is located in the ActiveSupport::NumberHelper::NumberConverter#valid_bigdecimal method. This function normalizes diverse numerical inputs into a BigDecimal object to ensure precision during the formatting process.

Ruby's native BigDecimal constructor accepts strings containing scientific notation, such as "1e1000000". The constructor parses these values successfully without allocating the fully expanded string in memory immediately. The problem surfaces during subsequent string formatting operations invoked by the Active Support helpers.

Formatting operations require the expanded, base-10 representation of the number. When the helper attempts to append decimal places or thousand separators, the Ruby interpreter computes the fixed-point string representation of the parsed BigDecimal.

Processing "1e1000000" forces the interpreter to generate a string exceeding one million characters in length. This operation blocks the executing thread synchronously and rapidly consumes available heap memory, leading directly to uncontrolled resource consumption.

Code Analysis

Reviewing the vulnerable implementation in activesupport/lib/active_support/number_helper/number_converter.rb reveals the unconstrained instantiation of BigDecimal. The valid_bigdecimal method processes incoming parameters based on their class type.

def valid_bigdecimal
  case number
  when Float, Rational
    number.to_d(0)
  when String
    BigDecimal(number, exception: false)
  else
    number.to_d rescue nil
  end
end

The String when clause passes the raw string directly to BigDecimal(number, exception: false). The constructor processes the string, identifying scientific notation markers ('e', 'E', 'd', 'D') and establishing an internal representation with a large exponent. The framework fails to enforce bounds on the magnitude of this exponent before passing the object down the execution chain.

The patched implementation introduces a preventative regular expression check. By validating that the string does not contain 'd', 'D', 'e', or 'E', the framework structurally prevents the interpretation of scientific notation.

def valid_bigdecimal
  case number
  when Float, Rational
    number.to_d(0)
  when String
    BigDecimal(number, exception: false) unless number.to_s.match?(/[de]/i)
  else
    number.to_d rescue nil
  end
end

This fix addresses the immediate attack vector at the perimeter of the component. Inputs containing scientific notation are correctly rejected and process fallbacks are executed, preserving memory limits during formatting.

Exploitation Mechanics

Exploitation requires an application execution flow where user-controlled string input is passed unmodified into a formatting helper. A common scenario is a product price display or a financial dashboard that reflects unvalidated URL parameters.

The attacker constructs a minimal payload consisting of a large exponent string. A payload of 1e1000000 is only nine bytes in length. This small footprint easily bypasses standard input length constraints, typical application parameter limits, and web application firewall size restrictions.

Upon submission, the web application routes the parameter to the vulnerable helper. The application thread blocks synchronously while the Ruby interpreter attempts to allocate and format the resulting string.

The resulting operation exhausts the computational resources allocated to the thread, generating a denial of service condition.

Impact Assessment

The primary impact of this vulnerability is a severe denial of service. Successful exploitation results in immediate memory exhaustion and CPU saturation for the affected Ruby process.

In concurrent environments utilizing application servers like Puma or Unicorn, a single malicious request ties up a worker thread entirely. A low-volume automated attack targeting this vector systematically saturates all available application workers. Once all workers are locked in string expansion operations, the entire service becomes unresponsive to legitimate user traffic.

The vulnerability carries a CVSS v4.0 score of 6.6. This metric reflects the low complexity of the attack, the lack of required authentication, and the high impact on system availability. Confidentiality and integrity boundaries remain unaffected by this specific flaw.

Recovery from this state typically requires manual intervention or an automated orchestration restart of the affected pods or instances. The process will not recover gracefully if the requested memory allocation exceeds the operating system limits, triggering the OOM killer.

Remediation Guidance

The definitive resolution requires updating the activesupport gem to a patched release. The Rails core team provides fixes in versions 8.1.2.1, 8.0.4.1, and 7.2.3.1. Upgrading the framework ensures the regular expression validation is applied globally across all number helper invocations.

Applications running on end-of-life Rails versions must backport the regular expression validation into their local NumberConverter implementation, or sanitize inputs prior to helper invocation.

As a temporary mitigation, developers can sanitize inputs before passing them to number helpers. Implementing a wrapper method that rejects strings matching /[de]/i effectively neutralizes the attack vector without requiring a framework upgrade.

def safe_number_to_currency(val)
  return val if val.is_a?(String) && val.match?(/[de]/i)
  number_to_currency(val)
end

Security teams should monitor application logs for anomalous parameter structures containing standard scientific notation markers, specifically targeting endpoints known to process formatting helpers.

Official Patches

Ruby on RailsRails Release Tag 8.1.2.1

Fix Analysis (3)

Technical Appendix

CVSS Score
6.6/ 10
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:U

Affected Systems

Ruby on Rails Active SupportRails 8.1Rails 8.0Rails 7.2

Affected Versions Detail

Product
Affected Versions
Fixed Version
activesupport
Ruby on Rails
>= 8.1.0.beta1, < 8.1.2.18.1.2.1
activesupport
Ruby on Rails
>= 8.0.0.beta1, < 8.0.4.18.0.4.1
activesupport
Ruby on Rails
< 7.2.3.17.2.3.1
AttributeDetail
CWE IDCWE-400, CWE-770
Attack VectorNetwork
CVSS v4.06.6 (Medium)
ImpactDenial of Service (Availability: High)
Exploit StatusNone
CISA KEVNot Listed

MITRE ATT&CK Mapping

T1499Endpoint Denial of Service
Impact
CWE-400
Uncontrolled Resource Consumption

The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed.

Vulnerability Timeline

Technical fix developed by Jean Boussier.
2025-06-11
Final release preparation (Rails 8.1.2.1).
2026-03-17
Public disclosure and advisory publication.
2026-03-23

References & Sources

  • [1]GitHub Security Advisory GHSA-2j26-frm8-cmj9
  • [2]CVE.org Record for CVE-2026-33176

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.