CVE-2025-25184: Possible Log Injection in Rack::CommonLogger
5.7
CVSS Score
4.0
Basic Information
CVE ID
GHSA ID
EPSS Score
0.51364%
CWE
Published
2/12/2025
Updated
2/18/2025
KEV Status
No
Technology
Ruby
Technical Details
CVSS Vector
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:P/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
rack | rubygems | < 2.2.11 | 2.2.11 |
rack | rubygems | >= 3.0, < 3.0.12 | 3.0.12 |
rack | rubygems | >= 3.1, < 3.1.10 | 3.1.10 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from Rack::CommonLogger
's logging logic handling user-supplied usernames. The commit diff shows: 1) The FORMAT string's trailing newline was removed, 2) The regex in msg.gsub!
was changed from excluding newlines (/[^[:print:]\n]/
) to escaping all non-printables, and 3) A forced newline was appended after sanitization. This indicates the pre-patch log method failed to escape CRLF characters in user-controlled fields like REMOTE_USER
, allowing log format manipulation. The test additions explicitly verify newline escaping in usernames, confirming this was the attack vector.