Skip to content

Puma vulnerable to HTTP Request Smuggling

Critical severity GitHub Reviewed Published Mar 30, 2022 in puma/puma • Updated May 4, 2023

Package

bundler puma (RubyGems)

Affected versions

>= 5.0.0, < 5.6.4
< 4.3.12

Patched versions

5.6.4
4.3.12

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-Encoding headers, when unsupported encodings should be rejected and the final encoding must be chunked.
  • Lenient parsing of malformed Content-Length headers and chunk sizes, when only digits and hex digits should be allowed.
  • Lenient parsing of duplicate Content-Length headers, 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)

References

@nateberkopec nateberkopec published to puma/puma Mar 30, 2022
Published to the GitHub Advisory Database Mar 30, 2022
Reviewed Mar 30, 2022
Published by the National Vulnerability Database Mar 30, 2022
Last updated May 4, 2023

Severity

Critical
9.1
/ 10

CVSS base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
None
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N

Weaknesses

CVE ID

CVE-2022-24790

GHSA ID

GHSA-h99w-9q5r-gjq9

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.