CVE-2023-24815: Disclosure of classpath resources on Windows when mounted on a wildcard route in vertx-web
Summary
When running vertx web applications that serve files using StaticHandler on Windows Operating Systems and Windows File Systems, if the mount point is a wildcard () then an attacker can exfiltrate any class path resource.
Details When computing the relative path to locate the resource, in case of wildcards, the code:
https://github.com/vert-x3/vertx-web/blob/62c0d66fa1c179ae6a4d57344631679a2b97e60f/vertx-web/src/main/java/io/vertx/ext/web/impl/Utils.java#L83
returns the user input (without validation) as the segment to lookup. Even though checks are performed to avoid escaping the sandbox, given that the input was not sanitized \ are not properly handled and an attacker can build a path that is valid within the classpath.
PoC
https://github.com/adrien-aubert-drovio/vertx-statichandler-windows-traversal-path-vulnerability
Other sources
A flaw was found in Vert.X Web. When running the application that serves files using StaticHandler on Windows Operating Systems and Windows File Systems, if the mount point is a wildcard (), an attacker can exfiltrate any class path resource.
Eclipse Vert.x-Web could allow a remote attacker to obtain sensitive information, caused by a flaw when mounted on a wildcard route. By sending a specially-crafted request, an attacker could exploit this vulnerability to exfiltrate any class path resource, and use this information to launch further attacks against the affected system.
— IBM
Vert.x-Web is a set of building blocks for building web applications in the java programming language. When running vertx web applications that serve files using StaticHandler on Windows Operating Systems and Windows File Systems, if the mount point is a wildcard () then an attacker can exfiltrate any class path resource. When computing the relative path to locate the resource, in case of wildcards, the code: return "/" + rest; from Utils.java returns the user input (without validation) as the segment to lookup. Even though checks are performed to avoid escaping the sandbox, given that the input was not sanitized \ are not properly handled and an attacker can build a path that is valid within the classpath. This issue only affects users deploying in windows environments and upgrading is the advised remediation path. There are no known workarounds for this vulnerability.
When running vertx web applications that serve files using StaticHandler on Windows Operating Systems and Windows File Systems, if the mount point is a wildcard () then an attacker can exfiltrate any class path resource.
— Red Hat
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
maven/io.vertx:vertx-webto a version that resolves this vulnerability.Fixed in 4.3.8 - Upgrade
Upgrade
redhat/vertx-webto a version that resolves this vulnerability.Fixed in 4.3.8
Event History
Frequently Asked Questions
What is CVE-2023-24815?
CVE-2023-24815 is a vulnerability found in Vert.X Web that allows an attacker to exfiltrate files when serving files using `StaticHandler` on Windows Operating Systems and Windows File Systems.
How severe is CVE-2023-24815?
CVE-2023-24815 has a severity score of 5.3, which is considered medium.
What software is affected by CVE-2023-24815?
CVE-2023-24815 affects Vert.x-Web version up to exclusive 4.3.8.
How do I fix CVE-2023-24815?
To fix CVE-2023-24815, update Vert.x-Web to version 4.3.8 or later.
Where can I find more information about CVE-2023-24815?
You can find more information about CVE-2023-24815 on the CVE website, NVD website, GitHub security advisories, Red Hat Bugzilla, and Red Hat Errata.