Moderate severityNVD Advisory· Published Mar 4, 2025· Updated Nov 3, 2025
Escape Sequence Injection vulnerability in Rack lead to Possible Log Injection
CVE-2025-27111
Description
Rack is a modular Ruby web server interface. The Rack::Sendfile middleware logs unsanitised header values from the X-Sendfile-Type header. An attacker can exploit this by injecting escape sequences (such as newline characters) into the header, resulting in log injection. This vulnerability is fixed in 2.2.12, 3.0.13, and 3.1.11.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
rackRubyGems | < 2.2.12 | 2.2.12 |
rackRubyGems | >= 3.0, < 3.0.13 | 3.0.13 |
rackRubyGems | >= 3.1, < 3.1.11 | 3.1.11 |
Affected products
1Patches
3803aa221e830Use `#inspect` to prevent log injection.
3 files changed · +67 −3
CHANGELOG.md+65 −1 modified@@ -2,11 +2,17 @@ All notable changes to this project will be documented in this file. For info on how to format all future additions to this file please reference [Keep A Changelog](https://keepachangelog.com/en/1.0.0/). +## [3.0.13] - 2025-03-04 + +### Security + +- [CVE-2025-27111](https://github.com/rack/rack/security/advisories/GHSA-8cgq-6mh2-7j6v) Possible Log Injection in `Rack::Sendfile`. + ## [3.0.12] - 2025-02-12 ### Security -- [CVE-2025-25184](https://github.com/rack/rack/security/advisories/GHSA-7g2v-jj9q-g3rg) Possible Log Injection in Rack::CommonLogger. +- [CVE-2025-25184](https://github.com/rack/rack/security/advisories/GHSA-7g2v-jj9q-g3rg) Possible Log Injection in `Rack::CommonLogger`. ## [3.0.11] - 2024-05-10 @@ -184,6 +190,64 @@ All notable changes to this project will be documented in this file. For info on - Fix multipart filename generation for filenames that contain spaces. Encode spaces as "%20" instead of "+" which will be decoded properly by the multipart parser. ([#1736](https://github.com/rack/rack/pull/1645), [@muirdm](https://github.com/muirdm)) - `Rack::Request#scheme` returns `ws` or `wss` when one of the `X-Forwarded-Scheme` / `X-Forwarded-Proto` headers is set to `ws` or `wss`, respectively. ([#1730](https://github.com/rack/rack/issues/1730), [@erwanst](https://github.com/erwanst)) +## [2.2.12] - 2025-03-04 + +### Security + +- [CVE-2025-27111](https://github.com/rack/rack/security/advisories/GHSA-8cgq-6mh2-7j6v) Possible Log Injection in `Rack::Sendfile`. + +## [2.2.11] - 2025-02-12 + +### Security + +- [CVE-2025-25184](https://github.com/rack/rack/security/advisories/GHSA-7g2v-jj9q-g3rg) Possible Log Injection in `Rack::CommonLogger`. + +## [2.2.10] - 2024-10-14 + +- Fix compatibility issues with Ruby v3.4.0. ([#2248](https://github.com/rack/rack/pull/2248), [@byroot](https://github.com/byroot)) + +## [2.2.9] - 2023-03-21 + +- Return empty when parsing a multi-part POST with only one end delimiter. ([#2104](https://github.com/rack/rack/pull/2104), [@alpaca-tc]) + +## [2.2.8] - 2023-07-31 + +- Regenerate SPEC ([#2102](https://github.com/rack/rack/pull/2102), [@skipkayhil](https://github.com/skipkayhil)) +- Limit file extension length of multipart tempfiles ([#2015](https://github.com/rack/rack/pull/2015), [@dentarg](https://github.com/dentarg)) +- Fix "undefined method DelegateClass for Rack::Session::Cookie:Class" ([#2092](https://github.com/rack/rack/pull/2092), [@onigra](https://github.com/onigra) [@dchandekstark](https://github.com/dchandekstark)) + +## [2.2.7] - 2023-03-13 + +- Correct the year number in the changelog ([#2015](https://github.com/rack/rack/pull/2015), [@kimulab](https://github.com/kimulab)) +- Support underscore in host names for Rack 2.2 (Fixes [#2070](https://github.com/rack/rack/issues/2070)) ([#2015](https://github.com/rack/rack/pull/2071), [@jeremyevans](https://github.com/jeremyevans)) + +## [2.2.6.4] - 2023-03-13 + +- [CVE-2023-27539] Avoid ReDoS in header parsing + +## [2.2.6.3] - 2023-03-02 + +- [CVE-2023-27530] Introduce multipart_total_part_limit to limit total parts + +## [2.2.6.2] - 2023-01-17 + +- [CVE-2022-44570] Fix ReDoS in Rack::Utils.get_byte_ranges + +## [2.2.6.1] - 2023-01-17 + +- [CVE-2022-44571] Fix ReDoS vulnerability in multipart parser +- [CVE-2022-44572] Forbid control characters in attributes (also ReDoS) + +## [2.2.6] - 2023-01-17 + +- Extend `Rack::MethodOverride` to handle `QueryParser::ParamsTooDeepError` error. ([#2011](https://github.com/rack/rack/pull/2011), [@byroot](https://github.com/byroot)) + +## [2.2.5] - 2022-12-27 + +### Fixed + +- `Rack::URLMap` uses non-deprecated form of `Regexp.new`. ([#1998](https://github.com/rack/rack/pull/1998), [@weizheheng](https://github.com/weizheheng)) + ## [2.2.4] - 2022-06-30 - Better support for lower case headers in `Rack::ETag` middleware. ([#1919](https://github.com/rack/rack/pull/1919), [@ioquatix](https://github.com/ioquatix))
lib/rack/sendfile.rb+1 −1 modified@@ -138,7 +138,7 @@ def call(env) end when '', nil else - env[RACK_ERRORS].puts "Unknown x-sendfile variation: '#{type}'.\n" + env[RACK_ERRORS].puts "Unknown x-sendfile variation: #{type.inspect}" end end response
test/spec_sendfile.rb+1 −1 modified@@ -54,7 +54,7 @@ def open_file(path) response.headers.wont_include 'x-sendfile' io.rewind - io.read.must_equal "Unknown x-sendfile variation: 'X-Banana'.\n" + io.read.must_equal "Unknown x-sendfile variation: \"X-Banana\"\n" end end
aeac570bb808Use `#inspect` to prevent log injection.
3 files changed · +79 −3
CHANGELOG.md+77 −1 modified@@ -2,11 +2,17 @@ All notable changes to this project will be documented in this file. For info on how to format all future additions to this file please reference [Keep A Changelog](https://keepachangelog.com/en/1.0.0/). +## [3.1.11] - 2025-03-04 + +### Security + +- [CVE-2025-27111](https://github.com/rack/rack/security/advisories/GHSA-8cgq-6mh2-7j6v) Possible Log Injection in `Rack::Sendfile`. + ## [3.1.10] - 2025-02-12 ### Security -- [CVE-2025-25184](https://github.com/rack/rack/security/advisories/GHSA-7g2v-jj9q-g3rg) Possible Log Injection in Rack::CommonLogger. +- [CVE-2025-25184](https://github.com/rack/rack/security/advisories/GHSA-7g2v-jj9q-g3rg) Possible Log Injection in `Rack::CommonLogger`. ## [3.1.9] - 2025-01-31 @@ -117,6 +123,18 @@ Rack v3.1 is primarily a maintenance release that removes features deprecated in - In `Rack::Files`, ignore the `Range` header if served file is 0 bytes. ([#2159](https://github.com/rack/rack/pull/2159), [@zarqman]) +## [3.0.13] - 2025-03-04 + +### Security + +- [CVE-2025-27111](https://github.com/rack/rack/security/advisories/GHSA-8cgq-6mh2-7j6v) Possible Log Injection in `Rack::Sendfile`. + +## [3.0.12] - 2025-02-12 + +### Security + +- [CVE-2025-25184](https://github.com/rack/rack/security/advisories/GHSA-7g2v-jj9q-g3rg) Possible Log Injection in `Rack::CommonLogger`. + ## [3.0.11] - 2024-05-10 - Backport #2062 to 3-0-stable: Do not allow `BodyProxy` to respond to `to_str`, make `to_ary` call close . ([#2062](https://github.com/rack/rack/pull/2062), [@jeremyevans](https://github.com/jeremyevans)) @@ -293,6 +311,64 @@ Rack v3.1 is primarily a maintenance release that removes features deprecated in - Fix multipart filename generation for filenames that contain spaces. Encode spaces as "%20" instead of "+" which will be decoded properly by the multipart parser. ([#1736](https://github.com/rack/rack/pull/1645), [@muirdm](https://github.com/muirdm)) - `Rack::Request#scheme` returns `ws` or `wss` when one of the `X-Forwarded-Scheme` / `X-Forwarded-Proto` headers is set to `ws` or `wss`, respectively. ([#1730](https://github.com/rack/rack/issues/1730), [@erwanst](https://github.com/erwanst)) +## [2.2.12] - 2025-03-04 + +### Security + +- [CVE-2025-27111](https://github.com/rack/rack/security/advisories/GHSA-8cgq-6mh2-7j6v) Possible Log Injection in `Rack::Sendfile`. + +## [2.2.11] - 2025-02-12 + +### Security + +- [CVE-2025-25184](https://github.com/rack/rack/security/advisories/GHSA-7g2v-jj9q-g3rg) Possible Log Injection in `Rack::CommonLogger`. + +## [2.2.10] - 2024-10-14 + +- Fix compatibility issues with Ruby v3.4.0. ([#2248](https://github.com/rack/rack/pull/2248), [@byroot](https://github.com/byroot)) + +## [2.2.9] - 2023-03-21 + +- Return empty when parsing a multi-part POST with only one end delimiter. ([#2104](https://github.com/rack/rack/pull/2104), [@alpaca-tc]) + +## [2.2.8] - 2023-07-31 + +- Regenerate SPEC ([#2102](https://github.com/rack/rack/pull/2102), [@skipkayhil](https://github.com/skipkayhil)) +- Limit file extension length of multipart tempfiles ([#2015](https://github.com/rack/rack/pull/2015), [@dentarg](https://github.com/dentarg)) +- Fix "undefined method DelegateClass for Rack::Session::Cookie:Class" ([#2092](https://github.com/rack/rack/pull/2092), [@onigra](https://github.com/onigra) [@dchandekstark](https://github.com/dchandekstark)) + +## [2.2.7] - 2023-03-13 + +- Correct the year number in the changelog ([#2015](https://github.com/rack/rack/pull/2015), [@kimulab](https://github.com/kimulab)) +- Support underscore in host names for Rack 2.2 (Fixes [#2070](https://github.com/rack/rack/issues/2070)) ([#2015](https://github.com/rack/rack/pull/2071), [@jeremyevans](https://github.com/jeremyevans)) + +## [2.2.6.4] - 2023-03-13 + +- [CVE-2023-27539] Avoid ReDoS in header parsing + +## [2.2.6.3] - 2023-03-02 + +- [CVE-2023-27530] Introduce multipart_total_part_limit to limit total parts + +## [2.2.6.2] - 2023-01-17 + +- [CVE-2022-44570] Fix ReDoS in Rack::Utils.get_byte_ranges + +## [2.2.6.1] - 2023-01-17 + +- [CVE-2022-44571] Fix ReDoS vulnerability in multipart parser +- [CVE-2022-44572] Forbid control characters in attributes (also ReDoS) + +## [2.2.6] - 2023-01-17 + +- Extend `Rack::MethodOverride` to handle `QueryParser::ParamsTooDeepError` error. ([#2011](https://github.com/rack/rack/pull/2011), [@byroot](https://github.com/byroot)) + +## [2.2.5] - 2022-12-27 + +### Fixed + +- `Rack::URLMap` uses non-deprecated form of `Regexp.new`. ([#1998](https://github.com/rack/rack/pull/1998), [@weizheheng](https://github.com/weizheheng)) + ## [2.2.4] - 2022-06-30 - Better support for lower case headers in `Rack::ETag` middleware. ([#1919](https://github.com/rack/rack/pull/1919), [@ioquatix](https://github.com/ioquatix))
lib/rack/sendfile.rb+1 −1 modified@@ -138,7 +138,7 @@ def call(env) end when '', nil else - env[RACK_ERRORS].puts "Unknown x-sendfile variation: '#{type}'.\n" + env[RACK_ERRORS].puts "Unknown x-sendfile variation: #{type.inspect}" end end response
test/spec_sendfile.rb+1 −1 modified@@ -54,7 +54,7 @@ def open_file(path) response.headers.wont_include 'x-sendfile' io.rewind - io.read.must_equal "Unknown x-sendfile variation: 'X-Banana'.\n" + io.read.must_equal "Unknown x-sendfile variation: \"X-Banana\"\n" end end
b13bc6bfc750Use `#inspect` to prevent log injection.
3 files changed · +8 −4
CHANGELOG.md+6 −2 modified@@ -2,13 +2,17 @@ All notable changes to this project will be documented in this file. For info on how to format all future additions to this file please reference [Keep A Changelog](https://keepachangelog.com/en/1.0.0/). -## Unreleased +## [2.2.12] - 2025-03-04 + +### Security + +- [CVE-2025-27111](https://github.com/rack/rack/security/advisories/GHSA-8cgq-6mh2-7j6v) Possible Log Injection in `Rack::Sendfile`. ## [2.2.11] - 2025-02-12 ### Security -- [CVE-2025-25184](https://github.com/rack/rack/security/advisories/GHSA-7g2v-jj9q-g3rg) Possible Log Injection in Rack::CommonLogger. +- [CVE-2025-25184](https://github.com/rack/rack/security/advisories/GHSA-7g2v-jj9q-g3rg) Possible Log Injection in `Rack::CommonLogger`. ## [2.2.10] - 2024-10-14
lib/rack/sendfile.rb+1 −1 modified@@ -133,7 +133,7 @@ def call(env) end when '', nil else - env[RACK_ERRORS].puts "Unknown x-sendfile variation: '#{type}'.\n" + env[RACK_ERRORS].puts "Unknown x-sendfile variation: #{type.inspect}" end end [status, headers, body]
test/spec_sendfile.rb+1 −1 modified@@ -48,7 +48,7 @@ def open_file(path) response.headers.wont_include 'X-Sendfile' io.rewind - io.read.must_equal "Unknown x-sendfile variation: 'X-Banana'.\n" + io.read.must_equal "Unknown x-sendfile variation: \"X-Banana\"\n" end end
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
8- github.com/advisories/GHSA-8cgq-6mh2-7j6vghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2025-27111ghsaADVISORY
- github.com/rack/rack/commit/803aa221e8302719715e224f4476e438f2531a53ghsax_refsource_MISCWEB
- github.com/rack/rack/commit/aeac570bb8080ca7b53b7f2e2f67498be7ebd30bghsax_refsource_MISCWEB
- github.com/rack/rack/commit/b13bc6bfc7506aca3478dc5ac1c2ec6fc53f82a3ghsax_refsource_MISCWEB
- github.com/rack/rack/security/advisories/GHSA-8cgq-6mh2-7j6vghsax_refsource_CONFIRMWEB
- github.com/rubysec/ruby-advisory-db/blob/master/gems/rack/CVE-2025-27111.ymlghsaWEB
- lists.debian.org/debian-lts-announce/2025/03/msg00016.htmlghsaWEB
News mentions
0No linked articles in our index yet.