GHSA-h99w-9q5r-gjq9 CVE-2022-24790
Puma vulnerable to HTTP Request Smuggling
- Severity
- 9.1 / 10
- Critical · CVSS 3.1
- Exploit chance (EPSS)
- 2.19%
- Chance of exploitation in the next 30 days. Higher than 82.45% 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.6.4- Upgrade puma to this version or later
Description
When using Puma behind a proxy that does not properly validate that the incoming HTTP request matches the RFC7230 standard, Puma and the frontend proxy may disagree on where a request starts and ends. This would allow requests to be smuggled via the front-end proxy to Puma.
The following vulnerabilities are addressed by this advisory:
- Lenient parsing of
Transfer-Encodingheaders, when unsupported encodings should be rejected and the final encoding must bechunked. - Lenient parsing of malformed
Content-Lengthheaders and chunk sizes, when only digits and hex digits should be allowed. - Lenient parsing of duplicate
Content-Lengthheaders, when they should be rejected. - Lenient parsing of the ending of chunked segments, when they should end with
\r\n.
The vulnerability has been fixed in 5.6.4 and 4.3.12. When deploying a proxy in front of Puma, turning on any and all functionality to make sure that the request matches the RFC7230 standard.
These proxy servers are known to have "good" behavior re: this standard and upgrading Puma may not be necessary. Users are encouraged to validate for themselves.
- Nginx (latest)
- Apache (latest)
- Haproxy 2.5+
- Caddy (latest)
- Traefik (latest)
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.6.4
- bundler
bundle update puma # Gemfile: gem "puma", ">= 5.6.4"
Severity breakdown
CVSS 3.1 9.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- High
- 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-h99w-9q5r-gjq9
- github.com/puma/puma/commit/5bb7d202e24dec00a898dca4aa11db391d7787a5
- github.com/rubysec/ruby-advisory-db/blob/master/gems/puma/CVE-2022-24790.yml
- lists.debian.org/debian-lts-announce/2022/08/msg00015.html
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/F6YWG…
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/L7NES…
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/TUBFJ…
- portswigger.net/web-security/request-smuggling
- 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-rmj8-8hhh-gv5h Puma used with Rails may lead to Information Exposure | High | Also affects puma |
| GHSA-48w2-rm65-62xx Puma with proxy which forwards LF characters as line endings could allow HTTP request smuggling | Low | 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