CVE-2023-36479: Jetty servlets Jetty Vulnerable To Errant Command Vulnerability

LOW
Advisory Identifier: GHSA-3gh6-v5v9-6v9j
CVSS 3.5
CWE-149
Published
Advisory Summary

CVE-2023-36479 is a LOW (CVSS 3.5) jetty vulnerable to errant command vulnerability (CWE-149: Improper Neutralization of Quoting Syntax) affecting Jetty servlets libraries in the Maven ecosystem. The issue involves jetty vulnerable to errant command quoting in cgi servlet. Remediation is available by upgrading affected packages to version 9.4.52, 10.0.16, 11.0.16, 12.0.0-beta2.

CVE-2023-36479 at a Glance

CVE Identifier CVE-2023-36479
GHSA Identifier GHSA-3gh6-v5v9-6v9j
Severity LOW
CVSS v3.1 Base Score 3.5
CWE Classification CWE-149: Improper Neutralization of Quoting Syntax
Affected Product Jetty servlets
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 3.5

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

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

How to Fix CVE-2023-36479

To remediate this vulnerability, upgrade all affected Jetty servlets 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-servlets fixed: 9.4.52
<dependency>
    <groupId>org.eclipse.jetty</groupId>
    <artifactId>jetty-servlets</artifactId>
    <version>9.4.52</version>
</dependency>
org.eclipse.jetty:jetty-servlets fixed: 10.0.16
<dependency>
    <groupId>org.eclipse.jetty</groupId>
    <artifactId>jetty-servlets</artifactId>
    <version>10.0.16</version>
</dependency>
org.eclipse.jetty:jetty-servlets fixed: 11.0.16
<dependency>
    <groupId>org.eclipse.jetty</groupId>
    <artifactId>jetty-servlets</artifactId>
    <version>11.0.16</version>
</dependency>
org.eclipse.jetty.ee10:jetty-ee10-servlets fixed: 12.0.0-beta2
<dependency>
    <groupId>org.eclipse.jetty.ee10</groupId>
    <artifactId>jetty-ee10-servlets</artifactId>
    <version>12.0.0-beta2</version>
</dependency>
org.eclipse.jetty.ee9:jetty-ee9-servlets fixed: 12.0.0-beta2
<dependency>
    <groupId>org.eclipse.jetty.ee9</groupId>
    <artifactId>jetty-ee9-servlets</artifactId>
    <version>12.0.0-beta2</version>
</dependency>
org.eclipse.jetty.ee8:jetty-ee8-servlets fixed: 12.0.0-beta2
<dependency>
    <groupId>org.eclipse.jetty.ee8</groupId>
    <artifactId>jetty-ee8-servlets</artifactId>
    <version>12.0.0-beta2</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-36479, 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 servlets 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-149: Improper Neutralization of Quoting Syntax, where quotes injected into a product can be used to compromise a system. as data are parsed, an injected/absent/duplicate/malformed use of quotes may cause the process to take unexpected actions. In Jetty servlets, 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

If a user sends a request to a `org.eclipse.jetty.servlets.CGI` Servlet for a binary with a space in its name, the servlet will escape the command by wrapping it in quotation marks. This wrapped command, plus an optional command prefix, will then be executed through a call to Runtime.exec. If the original binary name provided by the user contains a quotation mark followed by a space, the resulting command line will contain multiple tokens instead of one. For example, if a request references a binary called file” name “here, the escaping algorithm will generate the command line string “file” name “here”, which will invoke the binary named file, not the one that the user requested. ```java if (execCmd.length() > 0 && execCmd.charAt(0) != '"' && execCmd.contains(" ")) execCmd = "\"" + execCmd + "\""; ``` ### Exploit Scenario The cgi-bin directory contains a binary named exec and a subdirectory named exec” commands, which contains a file called bin1. The user sends to the CGI servlet a request for the filename exec” commands/bin1. This request will pass the file existence check on lines 194 through 205. The servlet will add quotation marks around this filename, resulting in the command line string “exec” commands/bin1”. When this string is passed to Runtime.exec, instead of executing the bin1 binary, the server will execute the exec binary with the argument commands/file1”. In addition to being incorrect, this behavior may bypass alias checks, and it may cause other unintended behaviors if a command prefix is configured. If the useFullPath configuration setting is off, the command need not pass the existence check. The attack would not rely on a binary and subdirectory having similar names, and the attack will succeed on a much wider variety of directory structures. ### Impact Users of the `org.eclipse.jetty.servlets.CGI` Servlet with a very specific command structure may have the wrong command executed. ### Patches No patch. In Jetty 9.x, 10.x, and 11.x the `org.eclipse.jetty.servlets.CGI` has been deprecated. In Jetty 12 (all environments) the `org.eclipse.jetty.servlets.CGI` has been entirely removed. ### Workarounds The `org.eclipse.jetty.servlets.CGI` Servlet should not be used. Fast CGI support is available instead. ### References * https://github.com/eclipse/jetty.project/pull/9516 * https://github.com/eclipse/jetty.project/pull/9889 * https://github.com/eclipse/jetty.project/pull/9888

CVE-2023-36479 Affected Jetty servlets Versions

6 component(s)
Fixed Versions:
9.4.5210.0.1611.0.1612.0.0-beta2
Product / Package Ecosystem Affected Versions Fixed Version
org.eclipse.jetty:jetty-servlets
Maven
≥ 9.0.0
< 9.4.52
9.4.52
org.eclipse.jetty:jetty-servlets
Maven
≥ 10.0.0
< 10.0.16
10.0.16
org.eclipse.jetty:jetty-servlets
Maven
≥ 11.0.0
< 11.0.16
11.0.16
org.eclipse.jetty.ee10:jetty-ee10-servlets
Maven
< 12.0.0-beta2
12.0.0-beta2
org.eclipse.jetty.ee9:jetty-ee9-servlets
Maven
< 12.0.0-beta2
12.0.0-beta2
org.eclipse.jetty.ee8:jetty-ee8-servlets
Maven
< 12.0.0-beta2
12.0.0-beta2

References

Frequently Asked Questions

What is CVE-2023-36479?
CVE-2023-36479 is a security vulnerability in Jetty servlets involving Jetty vulnerable to errant command quoting in CGI Servlet under CWE-149: Improper Neutralization of Quoting Syntax.
Which Jetty servlets versions are affected?
Affected versions include releases prior to 9.4.52, 10.0.16, 11.0.16, 12.0.0-beta2 across affected packages: org.eclipse.jetty:jetty-servlets, org.eclipse.jetty.ee10:jetty-ee10-servlets, org.eclipse.jetty.ee9:jetty-ee9-servlets, org.eclipse.jetty.ee8:jetty-ee8-servlets.
What version fixes CVE-2023-36479?
Upgrading to 9.4.52, 10.0.16, 11.0.16, 12.0.0-beta2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is jetty-servlets affected?
Yes, org.eclipse.jetty:jetty-servlets is affected in releases prior to 9.4.52, 10.0.16, 11.0.16. Upgrade your dependency to 9.4.52, 10.0.16, 11.0.16 or later.
Is jetty-ee10-servlets affected?
Yes, org.eclipse.jetty.ee10:jetty-ee10-servlets is affected in releases prior to 12.0.0-beta2. Upgrade your dependency to 12.0.0-beta2 or later.
What is the CVSS score of CVE-2023-36479?
CVE-2023-36479 has a CVSS v3.1 base score of 3.5 (LOW) with vector string CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:N/I:L/A:N.
What CWE is associated with CVE-2023-36479?
CVE-2023-36479 is classified under CWE-149: Improper Neutralization of Quoting Syntax (Quotes injected into a product can be used to compromise a system. As data are parsed, an injected/absent/duplicate/malformed use of quotes may cause the process to take unexpected actions.).
How can I check Maven dependencies for CVE-2023-36479?
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-3gh6-v5v9-6v9j",
  "modified" : "2025-02-13T19:12:59Z",
  "published" : "2023-09-14T16:16:00Z",
  "aliases" : [ "CVE-2023-36479" ],
  "summary" : "Jetty vulnerable to errant command quoting in CGI Servlet",
  "details" : "If a user sends a request to a `org.eclipse.jetty.servlets.CGI` Servlet for a binary with a space in its name, the servlet will escape the command by wrapping it in quotation marks. This wrapped command, plus an optional command prefix, will then be executed through a call to Runtime.exec. If the original binary name provided by the user contains a quotation mark followed by a space, the resulting command line will contain multiple tokens instead of one. For example, if a request references a binary called file” name “here, the escaping algorithm will generate the command line string “file” name “here”, which will invoke the binary named file, not the one that the user requested.\n\n```java\nif (execCmd.length() > 0 && execCmd.charAt(0) != '\"' && execCmd.contains(\" \"))\nexecCmd = \"\\\"\" + execCmd + \"\\\"\";\n```\n\n### Exploit Scenario\nThe cgi-bin directory contains a binary named exec and a subdirectory named exec” commands, which contains a file called bin1. The user sends to the CGI servlet a request for the filename exec” commands/bin1. This request will pass the file existence check on lines 194 through 205. The servlet will add quotation marks around this filename, resulting in the command line string “exec” commands/bin1”. When this string is passed to Runtime.exec, instead of executing the bin1 binary, the server will execute the exec\nbinary with the argument commands/file1”. In addition to being incorrect, this behavior may bypass alias checks, and it may cause other unintended behaviors if a command prefix is configured.\n\nIf the useFullPath configuration setting is off, the command need not pass the existence check. The attack would not rely on a binary and subdirectory having similar names, and the attack will succeed on a much wider variety of directory structures.\n\n### Impact\nUsers of the `org.eclipse.jetty.servlets.CGI` Servlet with a very specific command structure may have the wrong command executed.\n\n### Patches\nNo patch.\nIn Jetty 9.x, 10.x, and 11.x the `org.eclipse.jetty.servlets.CGI` has been deprecated.\nIn Jetty 12 (all environments) the `org.eclipse.jetty.servlets.CGI` has been entirely removed.\n\n### Workarounds\nThe `org.eclipse.jetty.servlets.CGI` Servlet should not be used. Fast CGI support is available instead.\n\n### References\n* https://github.com/eclipse/jetty.project/pull/9516\n* https://github.com/eclipse/jetty.project/pull/9889\n* https://github.com/eclipse/jetty.project/pull/9888",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:N/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.eclipse.jetty:jetty-servlets"
    },
    "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-servlets"
    },
    "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-servlets"
    },
    "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.ee10:jetty-ee10-servlets"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "12.0.0-beta2"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 12.0.0-beta1"
    }
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.eclipse.jetty.ee9:jetty-ee9-servlets"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "12.0.0-beta2"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 12.0.0-beta1"
    }
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.eclipse.jetty.ee8:jetty-ee8-servlets"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "12.0.0-beta2"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 12.0.0-beta1"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/eclipse/jetty.project/security/advisories/GHSA-3gh6-v5v9-6v9j"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-36479"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/eclipse/jetty.project/pull/9516"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/eclipse/jetty.project/pull/9888"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/eclipse/jetty.project/pull/9889"
  }, {
    "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"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-149" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-09-14T16:16:00Z",
    "nvd_published_at" : "2023-09-15T19:15:08Z"
  }
}