CVE-2022-24790: Puma Puma Vulnerable To HTTP Request Vulnerability

CRITICAL
Advisory Identifier: GHSA-h99w-9q5r-gjq9
CVSS 9.1
CWE-444
Published
Advisory Summary

CVE-2022-24790 is a CRITICAL (CVSS 9.1) puma vulnerable to http request vulnerability (CWE-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling')) affecting Puma libraries in the RubyGems ecosystem. The issue involves puma vulnerable to http request smuggling. Remediation is available by upgrading affected packages to version 5.6.4, 4.3.12.

CVE-2022-24790 at a Glance

CVE Identifier CVE-2022-24790
GHSA Identifier GHSA-h99w-9q5r-gjq9
Severity CRITICAL
CVSS v3.1 Base Score 9.1
CWE Classification CWE-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling')
Affected Product Puma
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 9.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2022-24790

To remediate this vulnerability, upgrade all affected Puma dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

puma fixed: 5.6.4
Upgrade puma to 5.6.4
puma fixed: 4.3.12
Upgrade puma to 4.3.12
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for puma

How to Check if You Are Affected

To determine whether your application is affected by CVE-2022-24790, inspect your project dependencies for Puma:

inspect dependencies for puma

Analyze the terminal output to locate any version of Puma in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.6.4), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling'), where 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. In Puma, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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)

CVE-2022-24790 Affected Puma Versions

2 component(s)
Fixed Versions:
5.6.44.3.12
Product / Package Ecosystem Affected Versions Fixed Version
puma
RubyGems
≥ 5.0.0
< 5.6.4
5.6.4
puma
RubyGems
< 4.3.12
4.3.12

References

Frequently Asked Questions

What is CVE-2022-24790?
CVE-2022-24790 is a security vulnerability in Puma involving Puma vulnerable to HTTP Request Smuggling under CWE-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling').
Which Puma versions are affected?
Affected versions include releases prior to 5.6.4, 4.3.12 across affected packages: puma.
What version fixes CVE-2022-24790?
Upgrading to 5.6.4, 4.3.12 (or the latest patched release for your respective branch) resolves the vulnerability.
Is puma affected?
Yes, puma is affected in releases prior to 5.6.4, 4.3.12. Upgrade your dependency to 5.6.4, 4.3.12 or later.
What is the CVSS score of CVE-2022-24790?
CVE-2022-24790 has a CVSS v3.1 base score of 9.1 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2022-24790?
CVE-2022-24790 is classified under 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 can I check RubyGems dependencies for CVE-2022-24790?
Run the dependency tree command: 'inspect dependencies for puma'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-h99w-9q5r-gjq9",
  "modified" : "2022-08-16T19:37:40Z",
  "published" : "2022-03-30T21:48:50Z",
  "aliases" : [ "CVE-2022-24790" ],
  "summary" : "Puma vulnerable to HTTP Request Smuggling",
  "details" : "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.\n\nThe following vulnerabilities are addressed by this advisory:\n- Lenient parsing of `Transfer-Encoding` headers, when unsupported encodings should be rejected and the final encoding must be `chunked`.\n- Lenient parsing of malformed `Content-Length` headers and chunk sizes, when only digits and hex digits should be allowed.\n- Lenient parsing of duplicate `Content-Length` headers, when they should be rejected.\n- Lenient parsing of the ending of chunked segments, when they should end with `\\r\\n`.\n\nThe 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. \n\nThese 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.\n\n- Nginx (latest)\n- Apache (latest)\n- Haproxy 2.5+\n- Caddy (latest)\n- Traefik (latest)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "puma"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.0.0"
      }, {
        "fixed" : "5.6.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "puma"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.3.12"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/puma/puma/security/advisories/GHSA-h99w-9q5r-gjq9"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-24790"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/puma/puma/commit/5bb7d202e24dec00a898dca4aa11db391d7787a5"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/puma/puma"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/puma/CVE-2022-24790.yml"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2022/08/msg00015.html"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/F6YWGIIKL7KKTS3ZOAYMYPC7D6WQ5OA5"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/L7NESIBFCNSR3XH7LXDPKVMSUBNUB43G"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/TUBFJ44NCKJ34LECZRAP4N5VL6USJSIB"
  }, {
    "type" : "WEB",
    "url" : "https://portswigger.net/web-security/request-smuggling"
  }, {
    "type" : "WEB",
    "url" : "https://security.gentoo.org/glsa/202208-28"
  }, {
    "type" : "WEB",
    "url" : "https://www.debian.org/security/2022/dsa-5146"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-444" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-03-30T21:48:50Z",
    "nvd_published_at" : "2022-03-30T22:15:00Z"
  }
}