Skip to content

Commit 55bb269

Browse files
authored
Merge pull request #1031 from jasnow/ghsa-syncbot-2026-04-08-09_52_08
GHSA/SYNC: 2 brand new advisories
2 parents 9033c45 + 084d872 commit 55bb269

2 files changed

Lines changed: 181 additions & 0 deletions

File tree

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
---
2+
gem: addressable
3+
cve: 2026-35611
4+
ghsa: h27x-rffw-24p4
5+
url: https://github.com/sporkmonger/addressable/security/advisories/GHSA-h27x-rffw-24p4
6+
title: Addressable has a Regular Expression Denial of Service in
7+
Addressable templates
8+
date: 2026-04-08
9+
description: |
10+
### Impact
11+
12+
Within the URI template implementation in Addressable, two classes
13+
of URI template generate regular expressions vulnerable to
14+
catastrophic backtracking:
15+
16+
1. Templates using the `*` (explode) modifier with any expansion
17+
operator (e.g., `{foo*}`, `{+var*}`, `{#var*}`, `{/var*}`,
18+
`{.var*}`, `{;var*}`, `{?var*}`, `{&var*}`) generate patterns
19+
with nested unbounded quantifiers that are O(2^n) when matched
20+
against a maliciously crafted URI.
21+
22+
2. Templates using multiple variables with the `+` or `#` operators
23+
(e.g., `{+v1,v2,v3}`) generate patterns with O(n^k) complexity
24+
due to the comma separator being within the matched character
25+
class, causing ambiguous backtracking across k variables.
26+
27+
When matched against a maliciously crafted URI, this can result
28+
in catastrophic backtracking and uncontrolled resource consumption,
29+
leading to denial of service. The first pattern was partially
30+
addressed in 2.8.10 for certain operator combinations. Both patterns
31+
are fully remediated in 2.9.0.
32+
33+
Users of the URI parsing capabilities in Addressable but not
34+
the URI template matching capabilities are unaffected.
35+
36+
### Affected Versions
37+
38+
This vulnerability affects Addressable >= 2.3.0 (note: 2.3.0 and
39+
2.3.1 were yanked; the earliest installable release is 2.3.2).
40+
It was partially fixed in version 2.8.10 and fully remediated in 2.9.0.
41+
42+
The vulnerability is more exploitable on MRI Ruby < 3.2 and on all
43+
versions of JRuby and TruffleRuby. MRI Ruby 3.2 and later ship with
44+
Onigmo 6.9, which introduces memoization that prevents catastrophic
45+
backtracking for the first class of template. JRuby and TruffleRuby
46+
do not implement equivalent memoization and remain vulnerable
47+
to all patterns.
48+
49+
This has been confirmed on the following runtimes:
50+
51+
| Runtime | Status |
52+
|--------------|--------|
53+
| MRI Ruby 2.6 | Vulnerable |
54+
| MRI Ruby 2.7 | Vulnerable |
55+
| MRI Ruby 3.0 | Vulnerable |
56+
| MRI Ruby 3.1 | Vulnerable |
57+
| MRI Ruby 3.2 | Partially vulnerable |
58+
| MRI Ruby 3.3 | Partially vulnerable |
59+
| MRI Ruby 3.4 | Partially vulnerable |
60+
| MRI Ruby 4.0 | Partially vulnerable |
61+
| JRuby 10.0 | Vulnerable |
62+
| TruffleRuby 21.2 | Vulnerable |
63+
64+
### Workarounds
65+
66+
- **Upgrade to MRI Ruby 3.2 or later**, if your application does
67+
not use JRuby or TruffleRuby. The Onigmo memoization introduced
68+
in MRI Ruby 3.2 prevents catastrophic backtracking from nested
69+
unbounded quantifiers (pattern 1 above — templates using the `*`
70+
modifier). It does not reliably mitigate the O(n^k) multi-variable
71+
case (pattern 2), so upgrading Ruby alone may not be sufficient
72+
if your templates use `{+v1,v2,...}` or `{#v1,v2,...}` syntax.
73+
74+
- **Avoid using vulnerable template patterns** when matching
75+
user-supplied input on unpatched versions of the library:
76+
77+
- Templates using the `*` (explode) modifier: `{foo*}`, `{+var*}`,
78+
`{#var*}`, `{.var*}`, `{/var*}`, `{;var*}`, `{?var*}`, `{&var*}`
79+
80+
- Templates using multiple variables with the `+` or `#`
81+
operators: `{+v1,v2}`, `{#v1,v2,v3}`, etc.
82+
83+
- **Apply a short timeout** around any call to `Template#match`
84+
or `Template#extract` that processes user-supplied data.
85+
86+
### Credits
87+
88+
Discovered in collaboration with @jamfish.
89+
90+
### For more information
91+
92+
If you have any questions or comments about this advisory:
93+
* [Open an issue](https://github.com/sporkmonger/addressable/issues)
94+
cvss_v3: 7.5
95+
unaffected_versions:
96+
- "< 2.3.0"
97+
patched_versions:
98+
- ">= 2.9.0"
99+
related:
100+
url:
101+
- https://nvd.nist.gov/vuln/detail/CVE-2026-35611
102+
- https://github.com/sporkmonger/addressable/security/advisories/GHSA-h27x-rffw-24p4
103+
- https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS
104+
- https://cwe.mitre.org/data/definitions/1333.html
105+
- https://www.regular-expressions.info/catastrophic.html
106+
- https://github.com/advisories/GHSA-h27x-rffw-24p4
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
gem: rack-session
3+
cve: 2026-39324
4+
ghsa: 33qg-7wpp-89cq
5+
url: https://github.com/rack/rack-session/security/advisories/GHSA-33qg-7wpp-89cq
6+
title: 'Rack::Session::Cookie secrets: decrypt failure fallback
7+
enables secretless session forgery and Marshal deserialization'
8+
date: 2026-04-08
9+
description: |
10+
'Rack::Session::Cookie incorrectly handles decryption failures when
11+
configured with `secrets:`. If cookie decryption fails, the
12+
implementation falls back to a default decoder instead of rejecting
13+
the cookie. This allows an unauthenticated attacker to supply a
14+
crafted session cookie that is accepted as valid session data
15+
without knowledge of any configured secret.
16+
17+
Because this mechanism is used to load session state, an attacker
18+
can manipulate session contents and potentially gain unauthorized access.
19+
20+
## Details
21+
22+
When `secrets:` is configured, `Rack::Session::Cookie` attempts to
23+
decrypt incoming session cookies using one of the configured encryptors.
24+
If all decrypt attempts fail, the implementation does not reject
25+
the cookie. Instead, it falls back to decoding the cookie using
26+
a default coder.
27+
28+
This fallback path processes attacker-controlled cookie data as
29+
trusted session state. The behavior is implicit and occurs even
30+
when encrypted cookies are expected.
31+
32+
The fallback decoder is applied automatically and does not require
33+
the application to opt into a non-encrypted session format. As a
34+
result, a client can send a specially crafted cookie value that
35+
bypasses the intended integrity protections provided by `secrets:`.
36+
37+
This issue affects both default configurations and those using
38+
alternative serializers for encrypted payloads.
39+
40+
## Impact
41+
42+
Any Rack application using `Rack::Session::Cookie` with
43+
`secrets:` may be affected.
44+
45+
> [!NOTE]
46+
> Rails applications are typically not affected — Rails uses
47+
> `ActionDispatch::Session::CookieStore`, which is a separate
48+
> implementation backed by `ActiveSupport::MessageEncryptor`
49+
> and does not share the vulnerable code path.
50+
51+
An unauthenticated attacker can supply a crafted session cookie
52+
that is accepted as valid session data. This can lead to authentication
53+
bypass or privilege escalation in applications that rely on session
54+
values for identity or authorization decisions.
55+
56+
Depending on application behavior and available runtime components,
57+
processing of untrusted session data may also expose additional risks.
58+
59+
## Mitigation
60+
61+
* Update to a patched version of `rack-session` that rejects cookies
62+
when decryption fails under the `secrets:` configuration.
63+
* After updating, rotate session secrets to invalidate existing
64+
session cookies, since attacker-supplied session data may have
65+
been accepted and re-issued prior to the fix.'
66+
cvss_v4: 9.3
67+
unaffected_versions:
68+
- "< 2.0.0"
69+
patched_versions:
70+
- ">= 2.1.2"
71+
related:
72+
url:
73+
- https://nvd.nist.gov/vuln/detail/CVE-2026-39324
74+
- https://github.com/rack/rack-session/security/advisories/GHSA-33qg-7wpp-89cq
75+
- https://github.com/advisories/GHSA-33qg-7wpp-89cq

0 commit comments

Comments
 (0)