CVE-2023-40167: Jetty http Jetty Accepts "+" Prefixed Value Vulnerability

MODERATE
Advisory Identifier: GHSA-hmr7-m48g-48f6
CVSS 5.3
CWE-130
Published
Advisory Summary

CVE-2023-40167 is a MODERATE (CVSS 5.3) jetty accepts "+" prefixed value vulnerability (CWE-130: Improper Handling of Length Parameter Inconsistency) affecting Jetty http libraries in the Maven ecosystem. The issue involves jetty accepts "+" prefixed value in content-length. Remediation is available by upgrading affected packages to version 9.4.52, 10.0.16, 11.0.16, 12.0.1.

CVE-2023-40167 at a Glance

CVE Identifier CVE-2023-40167
GHSA Identifier GHSA-hmr7-m48g-48f6
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-130: Improper Handling of Length Parameter Inconsistency
Affected Product Jetty http
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 5.3

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:N/I:L/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 None (C:N)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2023-40167

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

org.eclipse.jetty:jetty-http fixed: 9.4.52
<dependency>
    <groupId>org.eclipse.jetty</groupId>
    <artifactId>jetty-http</artifactId>
    <version>9.4.52</version>
</dependency>
org.eclipse.jetty:jetty-http fixed: 10.0.16
<dependency>
    <groupId>org.eclipse.jetty</groupId>
    <artifactId>jetty-http</artifactId>
    <version>10.0.16</version>
</dependency>
org.eclipse.jetty:jetty-http fixed: 11.0.16
<dependency>
    <groupId>org.eclipse.jetty</groupId>
    <artifactId>jetty-http</artifactId>
    <version>11.0.16</version>
</dependency>
org.eclipse.jetty:jetty-http fixed: 12.0.1
<dependency>
    <groupId>org.eclipse.jetty</groupId>
    <artifactId>jetty-http</artifactId>
    <version>12.0.1</version>
</dependency>
Verify Direct and Transitive Dependencies

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

mvn dependency:tree -Dincludes=org.eclipse.jetty

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2023-40167, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.eclipse.jetty

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

Note: The mvn dependency:tree -Dincludes=org.eclipse.jetty command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-130: Improper Handling of Length Parameter Inconsistency, where the product parses a formatted message or structure, but it does not handle or incorrectly handles a length field that is inconsistent with the actual length of the associated data. In Jetty http, 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

### Impact Jetty accepts the '+' character proceeding the content-length value in a HTTP/1 header field. This is more permissive than allowed by the RFC and other servers routinely reject such requests with 400 responses. There is no known exploit scenario, but it is conceivable that request smuggling could result if jetty is used in combination with a server that does not close the connection after sending such a 400 response. ### Workarounds There is no workaround as there is no known exploit scenario. ### Original Report [RFC 9110 Secion 8.6](https://www.rfc-editor.org/rfc/rfc9110#section-8.6) defined the value of Content-Length header should be a string of 0-9 digits. However we found that Jetty accepts "+" prefixed Content-Length, which could lead to potential HTTP request smuggling. Payload: ``` POST / HTTP/1.1 Host: a.com Content-Length: +16 Connection: close ​ 0123456789abcdef ``` When sending this payload to Jetty, it can successfully parse and identify the length. When sending this payload to NGINX, Apache HTTPd or other HTTP servers/parsers, they will return 400 bad request. This behavior can lead to HTTP request smuggling and can be leveraged to bypass WAF or IDS.

CVE-2023-40167 Affected Jetty http Versions

4 component(s)
Fixed Versions:
9.4.5210.0.1611.0.1612.0.1
Product / Package Ecosystem Affected Versions Fixed Version
org.eclipse.jetty:jetty-http
Maven
≥ 9.0.0
< 9.4.52
9.4.52
org.eclipse.jetty:jetty-http
Maven
≥ 10.0.0
< 10.0.16
10.0.16
org.eclipse.jetty:jetty-http
Maven
≥ 11.0.0
< 11.0.16
11.0.16
org.eclipse.jetty:jetty-http
Maven
≥ 12.0.0
< 12.0.1
All 1 versions
12.0.0
12.0.1

References

Frequently Asked Questions

What is CVE-2023-40167?
CVE-2023-40167 is a security vulnerability in Jetty http involving Jetty accepts "+" prefixed value in Content-Length under CWE-130: Improper Handling of Length Parameter Inconsistency.
Which Jetty http versions are affected?
Affected versions include releases prior to 9.4.52, 10.0.16, 11.0.16, 12.0.1 across affected packages: org.eclipse.jetty:jetty-http.
What version fixes CVE-2023-40167?
Upgrading to 9.4.52, 10.0.16, 11.0.16, 12.0.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is jetty-http affected?
Yes, org.eclipse.jetty:jetty-http is affected in releases prior to 9.4.52, 10.0.16, 11.0.16, 12.0.1. Upgrade your dependency to 9.4.52, 10.0.16, 11.0.16, 12.0.1 or later.
What is the CVSS score of CVE-2023-40167?
CVE-2023-40167 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N.
What CWE is associated with CVE-2023-40167?
CVE-2023-40167 is classified under CWE-130: Improper Handling of Length Parameter Inconsistency (The product parses a formatted message or structure, but it does not handle or incorrectly handles a length field that is inconsistent with the actual length of the associated data.).
How can I check Maven dependencies for CVE-2023-40167?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.eclipse.jetty'. 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-hmr7-m48g-48f6",
  "modified" : "2023-10-02T21:03:21Z",
  "published" : "2023-09-14T16:17:27Z",
  "aliases" : [ "CVE-2023-40167" ],
  "summary" : "Jetty accepts \"+\" prefixed value in Content-Length",
  "details" : "### Impact\n\nJetty accepts the '+' character proceeding the content-length value in a HTTP/1 header field.  This is more permissive than allowed by the RFC and other servers routinely reject such requests with 400 responses.  There is no known exploit scenario, but it is conceivable that request smuggling could result if jetty is used in combination with a server that does not close the connection after sending such a 400 response.\n\n### Workarounds\n\nThere is no workaround as there is no known exploit scenario.   \n\n### Original Report \n\n[RFC 9110 Secion 8.6](https://www.rfc-editor.org/rfc/rfc9110#section-8.6) defined the value of Content-Length header should be a string of 0-9 digits. However we found that Jetty accepts \"+\" prefixed Content-Length, which could lead to potential HTTP request smuggling.\n\nPayload:\n\n```\n POST / HTTP/1.1\n Host: a.com\n Content-Length: +16\n Connection: close\n ​\n 0123456789abcdef\n```\n\nWhen sending this payload to Jetty, it can successfully parse and identify the length.\n\nWhen sending this payload to NGINX, Apache HTTPd or other HTTP servers/parsers, they will return 400 bad request.\n\nThis behavior can lead to HTTP request smuggling and can be leveraged to bypass WAF or IDS.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.eclipse.jetty:jetty-http"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "9.0.0"
      }, {
        "fixed" : "9.4.52"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 9.4.51"
    }
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.eclipse.jetty:jetty-http"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "10.0.0"
      }, {
        "fixed" : "10.0.16"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 10.0.15"
    }
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.eclipse.jetty:jetty-http"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "11.0.0"
      }, {
        "fixed" : "11.0.16"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 11.0.15"
    }
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.eclipse.jetty:jetty-http"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "12.0.0"
      }, {
        "fixed" : "12.0.1"
      } ]
    } ],
    "versions" : [ "12.0.0" ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/eclipse/jetty.project/security/advisories/GHSA-hmr7-m48g-48f6"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-40167"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/eclipse/jetty.project"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2023/09/msg00039.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.debian.org/security/2023/dsa-5507"
  }, {
    "type" : "WEB",
    "url" : "https://www.rfc-editor.org/rfc/rfc9110#section-8.6"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-130" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-09-14T16:17:27Z",
    "nvd_published_at" : "2023-09-15T20:15:09Z"
  }
}