GHSA-4W5Q-WG7V-W6GP
Regular Expression Denial of Service in Addressable templates with several exploded variables
Overview
Description
Within the URI template implementation in Addressable, expressions with several exploded variables (e.g., {+a*,b*}, {+a*,b*,c*}, {/a*,b*}, {?a*,b*}) generate regular expressions vulnerable to excessive backtracking. A run of members can be divided among the exploded variables in O(n^k) ways for k variables. When Template#match or Template#extract is called with a maliciously crafted URI, this can result in uncontrolled resource consumption, leading to denial of service. With 2.9.0, {+a*,b*,c*} takes over 12 seconds to reject 1 KB of input on MRI Ruby 3.2.
Users of the URI parsing capabilities in Addressable but not the URI template matching capabilities are unaffected. Users who only call Template#expand are unaffected.
Credits
Reported by Daniel Coles (@manus-pi).
Source: OX vulnerability database
Severity
MEDIUM
No CVSS vector in the source. Severity comes from the advisory.
Affected packages · 1
| Ecosystem | Package | Vulnerable | Fixed in |
|---|---|---|---|
| RubyGems | addressable | — | 2.9.1 |
Open a package to see all its vulnerabilities.
Operating systems
No Linux distribution reports this ID.
References
- github.com https://github.com/sporkmonger/addressable/blob/main/CHANGELOG.md#v2.9.1
- github.com https://github.com/sporkmonger/addressable/compare/addressable-2.9.0...addressable-2.9.1
- github.com https://github.com/sporkmonger/addressable/security/advisories/GHSA-4w5q-wg7v-w6gp
- rubygems.org https://rubygems.org/gems/addressable/versions/2.9.1
OX Radar and Response Center
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.