perwendel / spark

A simple expressive web framework for java. Spark has a kotlin DSL https://github.com/perwendel/spark-kotlin
Apache License 2.0
9.63k stars 1.56k forks source link

Security issue linked to Jetty-Server #1240

Closed mcgivrer closed 2 years ago

mcgivrer commented 3 years ago

Hello Here,

Using the SParkJava framwork for some personnal project, I detect the following security issue linked to SparkJava jetty usage, thanks to snyk.io.


High severity

Privilege Escalation

Affected module: org.eclipse.jetty:jetty-webapp@9.4.31.v20200723

Introduced through: com.sparkjava:spark-core@2.9.3

Exploit maturity: No known exploit

Fixed in: org.eclipse.jetty:jetty-webapp@9.4.33.v20201020, org.eclipse.jetty:jetty-webapp@jetty-10.0.0.beta3, org.eclipse.jetty:jetty-webapp@11.0.0.beta3

Detailed paths

Introduced through: com.sparkjava:spark-core@2.9.3 › org.eclipse.jetty:jetty-webapp@9.4.31.v20200723

Overview

org.eclipse.jetty:jetty-webapp is a maven plugin for Jetty web application support.

Affected versions of this package are vulnerable to Privilege Escalation. The system's temporary directory is shared between all users on that system. A collocated user can observe the process of creating a temporary sub directory in the shared temporary directory and race to complete the creation of the temporary subdirectory. If the attacker wins the race then they will have read and write permission to the subdirectory used to unpack web applications, including their WEB-INF/lib jar files and JSP files. If any code is ever executed out of this temporary directory, this can lead to a local privilege escalation vulnerability.


Would you mind upgrading the underlaying jetty-webapp to org.eclipse.jetty:jetty-webapp@9.4.33.v20201020 ?

Thanks in advanced.

McG.

Dahaden commented 3 years ago

Hey @mcgivrer sorry just jumping on this as well. Seems like there have been more jetty fixes recently and the lastest patched version is 9.4.39.v20210325. Are you able to update the PR to add this? https://github.com/eclipse/jetty.project/releases/tag/jetty-9.4.39.v20210325

Thanks :)