Baja

Jetty vulnerable to errant command quoting in CGI Servlet

  • Publicada: 14.09.2023
  • Actualizado: 11.10.2026 13:20

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

Software afectado

Haz clic en una tecnología para ver todas sus vulnerabilidades.

PlataformaPaqueteVersiones vulnerablesCorregida en
Java / Kotlin (Maven) org.eclipse.jetty.ee10:jetty-ee10-servlets < 12.0.0-beta2 12.0.0-beta2
Java / Kotlin (Maven) org.eclipse.jetty.ee8:jetty-ee8-servlets < 12.0.0-beta2 12.0.0-beta2
Java / Kotlin (Maven) org.eclipse.jetty.ee9:jetty-ee9-servlets < 12.0.0-beta2 12.0.0-beta2
Java / Kotlin (Maven) org.eclipse.jetty:jetty-servlets >= 9.0.0, < 9.4.52, >= 10.0.0, < 10.0.16, >= 11.0.0, < 11.0.16 9.4.52, 10.0.16, 11.0.16

Referencias

Puntuación CVSS 3.5/10
Vector CVSS
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:N/I:L/A:N
Debilidad (CWE)
CWE-149
Plataforma
Java / Kotlin (Maven)
Paquete
org.eclipse.jetty.ee10:jetty-ee10-servlets, org.eclipse.jetty.ee8:jetty-ee8-servlets, org.eclipse.jetty.ee9:jetty-ee9-servlets
Publicada
14.09.2023
Actualizado
11.10.2026 13:20

Fuentes y licencias

OSV / GitHub Advisory Database - GHSA-3gh6-v5v9-6v9j - CC BY 4.0

Historial de vulnerabilidades: org.eclipse.jetty.ee10:jetty-ee10-servlets

Todas las vulnerabilidades publicadas de este paquete (Java / Kotlin (Maven)), de la más reciente a la más antigua. Muestra si es un fallo aislado o un paquete que hay que vigilar.

Entradas en total
2
Primera → última
09.2023 10.2024
Sin corrección
0
Explotada en ataques
0

Distribución por gravedad

  • Media 1
  • Baja 1

Divulgaciones por año

  1. 2023: 1
  2. 2024: 1
  3. 2025: 0
  4. 2026: 0
  1. Media · 5.3 CVE-2024-9823 >= 12.0.0, < 12.0.3 12.0.3
  2. Jetty vulnerable to errant command quoting in CGI Servlet esta entrada
    Baja · 3.5 CVE-2023-36479 < 12.0.0-beta2 12.0.0-beta2

Identifica las vulnerabilidades de tu aplicación

Con la integración de DockRay y el inventario de software activado, DockRay compara las versiones notificadas de los componentes con las vulnerabilidades conocidas y avisa de las coincidencias confirmadas. La cobertura depende de la tecnología compatible y de los avisos disponibles.

Conectar tu aplicación
Newsletter DockRay

La seguridad de tus aplicaciones en tu correo

Vulnerabilidades importantes, recomendaciones concretas y consejos prácticos para tus aplicaciones. Elige tus tecnologías y sigue lo que importa para tu proyecto.

  • Un resumen diario de nuevas vulnerabilidades, también las críticas.
  • Avisos sobre actualizaciones importantes.
  • Consejos prácticos sobre seguridad y monitorización de aplicaciones.

Déjalo vacío para recibir avisos de todas las tecnologías.

Suscripción gratuita. Date de baja con un clic en cualquier correo.