CVE-2004-2381: Jetty Denial of Service Vulnerability

MODERATE
Advisory Identifier: GHSA-p5rr-q5g6-gm42
CWE-400
Published
Advisory Summary

CVE-2004-2381 is a MODERATE denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Jetty libraries in the Maven ecosystem. The issue involves jetty http server denial of service vulnerability. Remediation is available by upgrading affected packages to version 4.2.19.

CVE-2004-2381 at a Glance

CVE Identifier CVE-2004-2381
GHSA Identifier GHSA-p5rr-q5g6-gm42
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Jetty
Package Ecosystem Maven
Published Date
Last Updated

How to Fix CVE-2004-2381

To remediate this vulnerability, upgrade all affected Jetty 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.mortbay.jetty:jetty fixed: 4.2.19
<dependency>
    <groupId>org.mortbay.jetty</groupId>
    <artifactId>jetty</artifactId>
    <version>4.2.19</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.mortbay.jetty

How to Check if You Are Affected

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

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

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

Note: The mvn dependency:tree -Dincludes=org.mortbay.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-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Jetty, 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

HttpRequest.java in Jetty HTTP Server before 4.2.19 allows remote attackers to cause denial of service (memory usage and application crash) via HTTP requests with a large Content-Length.

CVE-2004-2381 Affected Jetty Versions

1 component(s)
Fixed Versions:
4.2.19
Product / Package Ecosystem Affected Versions Fixed Version
org.mortbay.jetty:jetty
Maven
< 4.2.19
4.2.19

References

Frequently Asked Questions

What is CVE-2004-2381?
CVE-2004-2381 is a security vulnerability in Jetty involving Jetty HTTP Server Denial of Service vulnerability under CWE-400: Uncontrolled Resource Consumption.
Which Jetty versions are affected?
Affected versions include releases prior to 4.2.19 across affected packages: org.mortbay.jetty:jetty.
What version fixes CVE-2004-2381?
Upgrading to 4.2.19 (or the latest patched release for your respective branch) resolves the vulnerability.
Is jetty affected?
Yes, org.mortbay.jetty:jetty is affected in releases prior to 4.2.19. Upgrade your dependency to 4.2.19 or later.
What CWE is associated with CVE-2004-2381?
CVE-2004-2381 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check Maven dependencies for CVE-2004-2381?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.mortbay.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-p5rr-q5g6-gm42",
  "modified" : "2023-09-18T22:57:43Z",
  "published" : "2022-04-29T03:01:19Z",
  "aliases" : [ "CVE-2004-2381" ],
  "summary" : "Jetty HTTP Server Denial of Service vulnerability",
  "details" : "HttpRequest.java in Jetty HTTP Server before 4.2.19 allows remote attackers to cause denial of service (memory usage and application crash) via HTTP requests with a large Content-Length.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.mortbay.jetty:jetty"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.2.19"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2004-2381"
  }, {
    "type" : "WEB",
    "url" : "https://exchange.xforce.ibmcloud.com/vulnerabilities/15537"
  }, {
    "type" : "WEB",
    "url" : "http://cvs.sourceforge.net/viewcvs.py/jetty/Jetty/src/org/mortbay/http/HttpRequest.java?r1=1.75&r2=1.76"
  }, {
    "type" : "WEB",
    "url" : "http://sourceforge.net/project/shownotes.php?release_id=224743"
  }, {
    "type" : "WEB",
    "url" : "http://www.osvdb.org/4387"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-400" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-09-18T22:57:43Z",
    "nvd_published_at" : "2004-12-31T05:00:00Z"
  }
}