|
| 1 | +--- |
| 2 | +layout: advisory |
| 3 | +title: 'CVE-2025-25184 (rack): Possible Log Injection in Rack::CommonLogger' |
| 4 | +comments: false |
| 5 | +categories: |
| 6 | +- rack |
| 7 | +advisory: |
| 8 | + gem: rack |
| 9 | + cve: 2025-25184 |
| 10 | + ghsa: 7g2v-jj9q-g3rg |
| 11 | + url: https://github.com/rack/rack/security/advisories/GHSA-7g2v-jj9q-g3rg |
| 12 | + title: Possible Log Injection in Rack::CommonLogger |
| 13 | + date: 2025-02-12 |
| 14 | + description: | |
| 15 | + ## Summary |
| 16 | +
|
| 17 | + `Rack::CommonLogger` can be exploited by crafting input that includes |
| 18 | + newline characters to manipulate log entries. The supplied |
| 19 | + proof-of-concept demonstrates injecting malicious content into logs. |
| 20 | +
|
| 21 | + ## Details |
| 22 | +
|
| 23 | + When a user provides the authorization credentials via |
| 24 | + `Rack::Auth::Basic`, if success, the username will be put in |
| 25 | + `env['REMOTE_USER']` and later be used by `Rack::CommonLogger` |
| 26 | + for logging purposes. |
| 27 | +
|
| 28 | + The issue occurs when a server intentionally or unintentionally |
| 29 | + allows a user creation with the username contain CRLF and white |
| 30 | + space characters, or the server just want to log every login |
| 31 | + attempts. If an attacker enters a username with CRLF character, |
| 32 | + the logger will log the malicious username with CRLF characters |
| 33 | + into the logfile. |
| 34 | +
|
| 35 | + ## Impact |
| 36 | +
|
| 37 | + Attackers can break log formats or insert fraudulent entries, |
| 38 | + potentially obscuring real activity or injecting malicious data |
| 39 | + into log files. |
| 40 | +
|
| 41 | + ## Mitigation |
| 42 | +
|
| 43 | + - Update to the latest version of Rack. |
| 44 | + cvss_v4: 5.7 |
| 45 | + patched_versions: |
| 46 | + - "~> 2.2.11" |
| 47 | + - "~> 3.0.12" |
| 48 | + - ">= 3.1.10" |
| 49 | + related: |
| 50 | + url: |
| 51 | + - https://nvd.nist.gov/vuln/detail/CVE-2025-25184 |
| 52 | + - https://github.com/rack/rack/security/advisories/GHSA-7g2v-jj9q-g3rg |
| 53 | + - https://github.com/rack/rack/commit/074ae244430cda05c27ca91cda699709cfb3ad8e |
| 54 | + - https://github.com/advisories/GHSA-7g2v-jj9q-g3rg |
| 55 | +--- |
0 commit comments