GHSA-48w2-rm65-62xx CVE-2021-41136
Puma with proxy which forwards LF characters as line endings could allow HTTP request smuggling
- Severity
- 3.7 / 10
- Low · CVSS 3.1
- Exploit chance (EPSS)
- 1.20%
- Chance of exploitation in the next 30 days. Higher than 68.26% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-444 Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling')
- Fix
5.5.1- Upgrade puma to this version or later
Description
Impact
Prior to puma version 5.5.0, using puma with a proxy which forwards LF characters as line endings could allow HTTP request smuggling. A client could smuggle a request through a proxy, causing the proxy to send a response back to another unknown client.
This behavior (forwarding LF characters as line endings) is very uncommon amongst proxy servers, so we have graded the impact here as "low". Puma is only aware of a single proxy server which has this behavior.
If the proxy uses persistent connections and the client adds another request in via HTTP pipelining, the proxy may mistake it as the first request's body. Puma, however, would see it as two requests, and when processing the second request, send back a response that the proxy does not expect. If the proxy has reused the persistent connection to Puma to send another request for a different client, the second response from the first client will be sent to the second client.
Patches
This vulnerability was patched in Puma 5.5.1 and 4.3.9.
Workarounds
This vulnerability only affects Puma installations without any proxy in front.
Use a proxy which does not forward LF characters as line endings.
Proxies which do not forward LF characters as line endings:
- Nginx
- Apache (>2.4.25)
- Haproxy
- Caddy
- Traefik
Possible Breakage
If you are dealing with legacy clients that want to send LF as a line ending in an HTTP header, this will cause those clients to receive a 400 error.
References
For more information
If you have any questions or comments about this advisory:
- Open an issue in Puma
- See our security policy
Affected versions
RubyGems
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
puma RubyGems → 5.5.1
- bundler
bundle update puma # Gemfile: gem "puma", ">= 5.5.1"
Severity breakdown
CVSS 3.1 3.7
CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:L/I:L/A:N
- Attack vector
- Network
- Attack complexity
- High
- Privileges required
- Low
- User interaction
- Required
- Scope
- Unchanged
- Confidentiality
- Low
- Integrity
- Low
- Availability
- None
Weakness
CWE-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling')
The product acts as an intermediary HTTP agent (such as a proxy or firewall) in the data flow between two entities such as a client and server, but it does not interpret malformed HTTP requests or responses in ways that are consistent with how the messages will be processed by those entities that are at the ultimate destination.
How to prevent it
- Implementation: Use a web server that employs a strict HTTP parsing procedure, such as Apache [REF-433].
- Implementation: Use only SSL communication.
- Implementation: Terminate the client session after each request.
- System Configuration: Turn all pages to non-cacheable.
References
Advisories
Packages
Other links
- github.com/puma/puma/security/advisories/GHSA-48w2-rm65-62xx
- github.com/puma/puma/commit/436c71807f00e07070902a03f79fd3e130eb6b18
- github.com/puma/puma/commit/acdc3ae571dfae0e045cf09a295280127db65c7f
- github.com/puma/puma/commit/fb6ad8f8013ab5cdbb2f444cbfabd0b4fde71139
- github.com/puma/puma/releases/tag/v4.3.9
- github.com/puma/puma/releases/tag/v5.5.1
- github.com/rubysec/ruby-advisory-db/blob/master/gems/puma/CVE-2021-41136.yml
- lists.debian.org/debian-lts-announce/2022/08/msg00015.html
- security.gentoo.org/glsa/202208-28
- debian.org/security/2022/dsa-5146
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-2vqw-3mp8-cgmx Puma PROXY Protocol v1 Accepts Repeated Protocol Headers on Persistent Connections | High | Also affects puma |
| GHSA-qpgp-93vx-g8v8 Puma PROXY Protocol v1 Parser Allows Remote Memory Exhaustion | High | Also affects puma |
| GHSA-9hf4-67fc-4vf4 Puma's header normalization allows for client to clobber proxy set headers | Medium | Also affects puma |
| GHSA-c2f4-cvqm-65w2 Puma HTTP Request/Response Smuggling vulnerability | High | Also affects puma |
| GHSA-68xg-gqqm-vgj8 Puma HTTP Request/Response Smuggling vulnerability | Critical | Also affects puma |
| GHSA-h99w-9q5r-gjq9 Puma vulnerable to HTTP Request Smuggling | Critical | Also affects puma |
| GHSA-rmj8-8hhh-gv5h Puma used with Rails may lead to Information Exposure | High | Also affects puma |
| GHSA-q28m-8xjw-8vr5 Puma's Keepalive Connections Causing Denial Of Service | High | Also affects puma |
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor