|
| 1 | +--- |
| 2 | +layout: advisory |
| 3 | +title: 'CVE-2025-59830 (rack): Rack has an unsafe default in Rack::QueryParser allows |
| 4 | + params_limit bypass via semicolon-separated parameters' |
| 5 | +comments: false |
| 6 | +categories: |
| 7 | +- rack |
| 8 | +advisory: |
| 9 | + gem: rack |
| 10 | + cve: 2025-59830 |
| 11 | + ghsa: 625h-95r8-8xpm |
| 12 | + url: https://github.com/rack/rack/security/advisories/GHSA-625h-95r8-8xpm |
| 13 | + title: Rack has an unsafe default in Rack::QueryParser allows params_limit bypass |
| 14 | + via semicolon-separated parameters |
| 15 | + date: 2025-09-25 |
| 16 | + description: | |
| 17 | + ## Summary |
| 18 | +
|
| 19 | + `Rack::QueryParser` in version `< 2.2.18` enforces its `params_limit` |
| 20 | + only for parameters separated by `&`, while still splitting on both |
| 21 | + `&` and `;`. As a result, attackers could use `;` separators to |
| 22 | + bypass the parameter count limit and submit more parameters than intended. |
| 23 | +
|
| 24 | + ## Details |
| 25 | +
|
| 26 | + The issue arises because `Rack::QueryParser#check_query_string` |
| 27 | + counts only `&` characters when determining the number of parameters, |
| 28 | + but the default separator regex `DEFAULT_SEP = /[&;] */n` splits on |
| 29 | + both `&` and `;`. This mismatch means that queries using `;` |
| 30 | + separators were not included in the parameter count, allowing |
| 31 | + `params_limit` to be bypassed. |
| 32 | +
|
| 33 | + Other safeguards (`bytesize_limit` and `key_space_limit`) still |
| 34 | + applied, but did not prevent this particular bypass. |
| 35 | +
|
| 36 | + ## Impact |
| 37 | +
|
| 38 | + Applications or middleware that directly invoke `Rack::QueryParser` |
| 39 | + with its default configuration (no explicit delimiter) could be |
| 40 | + exposed to increased CPU and memory consumption. This can be abused |
| 41 | + as a limited denial-of-service vector. |
| 42 | +
|
| 43 | + `Rack::Request`, the primary entry point for typical Rack applications, |
| 44 | + uses `QueryParser` in a safe way and does not appear vulnerable by |
| 45 | + default. As such, the severity is considered **low**, with the impact |
| 46 | + limited to edge cases where `QueryParser` is used directly. |
| 47 | +
|
| 48 | + ## Mitigation |
| 49 | +
|
| 50 | + * Upgrade to a patched version of Rack where both `&` and `;` are |
| 51 | + counted consistently toward `params_limit`. |
| 52 | + * If upgrading is not immediately possible, configure `QueryParser` |
| 53 | + with an explicit delimiter (e.g., `&`) to avoid the mismatch. |
| 54 | + * As a general precaution, enforce query string and request size |
| 55 | + limits at the web server or proxy layer (e.g., Nginx, Apache, or |
| 56 | + a CDN) to mitigate excessive parsing overhead. |
| 57 | + cvss_v3: 7.5 |
| 58 | + patched_versions: |
| 59 | + - ">= 2.2.18" |
| 60 | + related: |
| 61 | + url: |
| 62 | + - https://nvd.nist.gov/vuln/detail/CVE-2025-59830 |
| 63 | + - https://github.com/rack/rack/security/advisories/GHSA-625h-95r8-8xpm |
| 64 | + - https://github.com/rack/rack/commit/54e4ffdd5affebcb0c015cc6ae74635c0831ed71 |
| 65 | + - https://github.com/advisories/GHSA-625h-95r8-8xpm |
| 66 | +--- |
0 commit comments