Dev.to Security πŸ” Cybersecurity πŸ‘ 2 πŸ“– 4 min read

CVE-2026-142610: CVE-2026-142610: Resource Exhaustion Denial of Service via Arbitrary-Precision Math in Laravel Framework

CVE-2026-142610: Resource Exhaustion Denial of Service via Arbitrary-Precision Math in Laravel Framework Vulnerability ID: CVE-2026-142610 CVSS Score: 7.5 Published: 2026-12-04 CVE-2026-142610 (GHSA-c25c-x5r7-2v5m)

CVE-2026-142610: Resource Exhaustion Denial of Service via Arbitrary-Precision Math in Laravel Framework

Vulnerability ID: CVE-2026-142610
CVSS Score: 7.5
Published: 2026-12-04

CVE-2026-142610 (GHSA-c25c-x5r7-2v5m) is an allocation of resources without limits or throttling vulnerability (CWE-770) in the Laravel Framework (laravel/framework). The flaw exists in how Laravel passes user-supplied numeric strings to the brick/math arbitrary-precision arithmetic library during specific validation rules (multiple_of, gt, gte, lt, lte) and Eloquent model decimal casting (decimal:X). When an unauthenticated remote attacker supplies a numeric string formatted in scientific notation with a large positive or negative exponent (e.g., 1e-100000000), Brick\Math\BigDecimal and Brick\Math\BigNumber attempt to expand the full numeric representation in memory. This operation immediately exhausts the PHP process memory limit and causes high CPU utilization, terminating worker threads and resulting in an application-layer Denial of Service (DoS). The vulnerability is remediated in Laravel versions 12.74.0 and 13.44.1.

TL;DR

Laravel Framework versions prior to 12.74.0 and 13.44.1 fail to restrict scientific notation exponents before passing user input to the brick/math library in multiple_of validation, dynamic field comparison rules (gt, gte, lt, lte), and Eloquent decimal attribute casts. Submitting values like 1e-100000000 causes PHP workers to allocate hundreds of megabytes of RAM and crash with fatal out-of-memory errors.

⚠️ Exploit Status: POC

Technical Details

  • CVE / Advisory ID: CVE-2026-142610 / GHSA-c25c-x5r7-2v5m
  • Weakness Class: CWE-770: Allocation of Resources Without Limits or Throttling
  • CVSS v3.1 Score: 7.5 High (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H)
  • Attack Vector: Remote / Unauthenticated HTTP Request
  • Impact: Application Denial of Service (PHP Memory Limit & CPU Exhaustion)
  • Affected Components: ValidatesAttributes (multiple_of, gt, gte, lt, lte) & HasAttributes (asDecimal)
  • Patched Versions: laravel/framework 12.74.0 and 13.44.1
  • EPSS / KEV Status: 0.68% (53.67th Percentile) / Not in CISA KEV

Affected Systems

  • Laravel Framework (laravel/framework) < 12.74.0
  • Laravel Framework (laravel/framework) >= 13.0.0, < 13.44.1
  • laravel/framework: < 12.74.0 (Fixed in: 12.74.0)
  • laravel/framework: >= 13.0.0, < 13.44.1 (Fixed in: 13.44.1)

Code Analysis

Commit: bfb21ce

[13.x] Enforce exponent range limits in multiple_of, field-to-field gt/gte/lt/lte validation rules, and Eloquent asDecimal casting

diff --git a/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php b/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php
index bb4d1d823df6..8bb8c3e6459a 100644
--- a/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php
+++ b/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php
@@ -1548,8 +1548,14 @@ public function fromFloat($value)
      */
     protected function asDecimal($value, $decimals)
     {
+        $value = (string) $value;
+
+        if (preg_match('/e([+-]?\d+)$/i', $value, $matches) && abs((int) $matches[1]) > 1000) {
+            throw new MathException('Unable to cast value to a decimal.');
+        }
+
         try {
-            return (string) BigDecimal::of((string) $value)->toScale($decimals, RoundingMode::HalfUp);
+            return (string) BigDecimal::of($value)->toScale($decimals, RoundingMode::HalfUp);
         } catch (BrickMathException $e) {
             throw new MathException('Unable to cast value to a decimal.', previous: $e);
         }
diff --git a/src/Illuminate/Validation/Concerns/ValidatesAttributes.php b/src/Illuminate/Validation/Concerns/ValidatesAttributes.php
index d00a352c7440..f7d5fc6897bc 100644
--- a/src/Illuminate/Validation/Concerns/ValidatesAttributes.php
+++ b/src/Illuminate/Validation/Concerns/ValidatesAttributes.php
@@ -1349,7 +1349,7 @@ public function validateGt($attribute, $value, $parameters)

         if ($this->hasRule($attribute, $this->numericRules) && $this->isNumeric($value) && $this->isNumeric($comparedToValue)) {
             try {
-                return BigNumber::of($this->trim($value))->isGreaterThan($this->trim($comparedToValue));
+                return BigNumber::of($this->ensureExponentWithinAllowedRange($attribute, $this->trim($value)))->isGreaterThan($this->ensureExponentWithinAllowedRange($attribute, $this->trim($comparedToValue)));
             } catch (MathException|BrickMathException) {
                 return false;
             }
@@ -1980,7 +1980,7 @@ public function validateMultipleOf($attribute, $value, $parameters)
         }

         try {
-            $numerator = BigDecimal::of($this->trim($value));
+            $numerator = BigDecimal::of($this->ensureExponentWithinAllowedRange($attribute, $this->trim($value)));
             $denominator = BigDecimal::of($this->trim($parameters[0]));

Commit: d3dfc8c

[12.x] Backport exponent range checks for multiple_of, dynamic comparison rules, and Eloquent asDecimal

Mitigation Strategies

  • Upgrade laravel/framework to patched versions 12.74.0 or 13.44.1 where exponent bounds checking (abs(exponent) <= 1000) is enforced across all Brick\Math entry points.
  • Use the 'bail' validation rule combined with preceding 'between:min,max' or 'min'/'max' rules so that out-of-range scientific notation exponents halt validation before reaching 'multiple_of' or field-to-field comparison rules.
  • Deploy WAF or Laravel HTTP middleware filtering to reject incoming parameters containing scientific notation exponents greater than 3 digits (e.g., e+1000 or e-1000).

Remediation Steps:

  1. Audit the codebase for uses of 'multiple_of', field-to-field comparisons ('gt:', 'gte:', 'lt:', 'lte:'), and Eloquent '$casts' using 'decimal:'.
  2. Run 'composer update laravel/framework' to upgrade to 12.74.0+ (for 12.x) or 13.44.1+ (for 13.x).
  3. Verify the installed version using 'composer show laravel/framework' and restart any persistent PHP workers (PHP-FPM, Laravel Octane, Horizon/Queue workers).

References

Read the full report for CVE-2026-142610 on our website for more details including interactive diagrams and full exploit analysis.

πŸ“° Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.