CVE-2023-36479: Jetty vulnerable to errant command quoting in CGI Servlet

Published Sep 14, 2023
·
Updated

Eclipse Jetty Canonical Repository is the canonical repository for the Jetty project. Users of the CgiServlet with a very specific command structure may have the wrong command executed. 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. This issue was patched in version 9.4.52, 10.0.16, 11.0.16 and 12.0.0-beta2.

Other sources

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

Affected Software

23 affected componentsFixes available
maven/org.eclipse.jetty.ee8:jetty-ee8-servlets<=12.0.0-beta1
12.0.0-beta2
maven/org.eclipse.jetty.ee9:jetty-ee9-servlets<=12.0.0-beta1
12.0.0-beta2
maven/org.eclipse.jetty.ee10:jetty-ee10-servlets<=12.0.0-beta1
12.0.0-beta2
maven/org.eclipse.jetty:jetty-servlets>=11.0.0<=11.0.15
11.0.16
maven/org.eclipse.jetty:jetty-servlets>=10.0.0<=10.0.15
10.0.16
maven/org.eclipse.jetty:jetty-servlets>=9.0.0<=9.4.51
9.4.52
debian/jetty9<=9.4.16-0+deb10u1
9.4.50-4+deb10u19.4.39-3+deb11u29.4.50-4+deb11u19.4.50-4+deb12u29.4.53-1
redhat/jetty<12.0.0
12.0.0
redhat/jetty<9.4.52
9.4.52
redhat/jetty<10.0.16
10.0.16
redhat/jetty<11.0.16
11.0.16
Eclipse Jetty>=9.0.0<9.4.52
Eclipse Jetty>=10.0.0<10.0.16
Eclipse Jetty>=11.0.0<11.0.16
Eclipse Jetty=12.0.0-alpha1
Eclipse Jetty=12.0.0-alpha2
Eclipse Jetty=12.0.0-alpha3
Eclipse Jetty=12.0.0-beta0
Eclipse Jetty=12.0.0-beta1
Debian Debian Linux=10.0
Debian Debian Linux=11.0
Debian Debian Linux=12.0
IBM InfoSphere Data Architect<=9.2.1

Event History

Sep 14, 2023
Advisory Published
04:16 PM
Sep 15, 2023
CVE Published
via MITRE·06:37 PM
Data Sourced
via MITRE·06:37 PM
DescriptionSeverityWeakness
Mar 4, 2026
Data Sourced
via IBM·12:00 AM
DescriptionAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is CVE-2023-36479?

CVE-2023-36479 is a vulnerability in Eclipse Jetty that allows remote attackers to execute arbitrary commands via a specially crafted request.

2

What is the severity of CVE-2023-36479?

The severity of CVE-2023-36479 is medium, with a CVSS score of 4.3.

3

Which versions of Eclipse Jetty are affected by CVE-2023-36479?

Eclipse Jetty versions 9.0.0 to 9.4.51, 10.0.0 to 10.0.15, and 11.0.0 to 11.0.15 are affected by CVE-2023-36479.

4

How can I fix CVE-2023-36479?

To fix CVE-2023-36479, upgrade to Jetty version 9.4.52, 10.0.16, or 11.0.16.

5

Where can I find more information about CVE-2023-36479?

You can find more information about CVE-2023-36479 in the following references: [Link 1](https://github.com/eclipse/jetty.project/pull/9516), [Link 2](https://github.com/eclipse/jetty.project/pull/9888), [Link 3](https://github.com/eclipse/jetty.project/pull/9889).

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203