LOW 4.9
CVE-2025-11966
Vert.x-Web vulnerable to Stored Cross-site Scripting in directory listings via file names
Description
Description
- In the
StaticHandlerImpl#sendDirectoryListing(...)method under thetext/htmlbranch, file and directory names are directly embedded into thehref,title, and link text without proper HTML escaping. - As a result, in environments where an attacker can control file names, injecting HTML/JavaScript is possible. Simply accessing the directory listing page will trigger an XSS.
- Affected Code:
- File:
vertx-web/src/main/java/io/vertx/ext/web/handler/impl/StaticHandlerImpl.java - Lines:
- 709–713:
normalizedDiris constructed without escaping - 714–731:
<li><a ...>elements insert file names directly into attributes and body without escaping - 744: parent directory name construction
- 746–751:
{directory},{parent}, and{files}are inserted into the HTML template without escaping
- 709–713:
- File:
Reproduction Steps
Prerequisites:
- Directory listing is enabled using
StaticHandler
(e.g.,StaticHandler.create("public").setDirectoryListing(true)) - The attacker has the ability to create arbitrary file names under a public directory (e.g., via upload functionality or a shared directory)
- Directory listing is enabled using
Create a malicious file name (example for Unix-based OS):
- Create an empty file in
public/with one of the following names:<img src=x onerror=alert('XSS')>.txt- Or attribute injection:
evil" onmouseover="alert('XSS')".txt
- Example:
mkdir -p public printf 'test' > "public/<img src=x onerror=alert('XSS')>.txt"
- Create an empty file in
Start the server (example):
- Routing:
router.route("/public/*").handler(StaticHandler.create("public").setDirectoryListing(true)); - Server:
vertx.createHttpServer().requestHandler(router).listen(8890);
- Routing:
Verification request (raw HTTP):
GET /public/ HTTP/1.1 Host: 127.0.0.1:8890 Accept: text/html Connection: closeExample response excerpt:
<ul id="files"> <li> <a href="/public/<img src=x onerror=alert('XSS')>.txt" title="<img src=x onerror=alert('XSS')>.txt"> <img src=x onerror=alert('XSS')>.txt </a> </li> ... </ul>
- When accessing
/public/in a browser, the unescaped file name is interpreted as HTML, and event handlers such asonerrorare executed.
Potential Impact
Stored XSS
- Arbitrary JavaScript executes in the browser context of users viewing the listing page
- Possible consequences:
- Theft of session tokens, JWTs, localStorage contents, or CSRF tokens
- Unauthorized actions with admin privileges (user creation, permission changes, settings modifications)
- Watering hole attacks, including malware distribution or malicious script injection to other pages
Common Conditions That Make Exploitation Easier
- Uploaded files are served directly under a publicly accessible directory
- Shared/synced directories (e.g., NFS, SMB, WebDAV, or cloud sync) are exposed
- ZIP/TAR archives are extracted directly under the webroot and directory listing is enabled in production environments
Similar CVEs Previously Reported
- CVE‑2024‑32966
- CVE‑2019‑15603
Affected Maven artifacts (1)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| io.vertx » vertx-web | < 4.5.22>= 5.0.0, < 5.0.5 | 4.5.22, 5.0.5 |
Blast radius
1affected artifacts
198affected versions
4,844dependent artifacts (est.)
216,917dependent versions
45% of the dependent artifacts (2,212) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 22,642 |
| 2 hops | 44,541 |
| 3 hops | 80,477 |
| 4 hops | 50,990 |
| 5 hops | 14,746 |
| 6 hops | 3,521 |
Most used dependents
- io.quarkus » quarkus-junit52,452 usages
- io.quarkus » quarkus-resteasy1,251 usages
- io.quarkus » quarkus-arc-deployment1,077 usages
- org.apache.camel.springboot » camel-core-starter558 usages
- io.quarkus » quarkus-resteasy-jackson543 usages
- org.apache.camel.springboot » camel-spring-boot-starter478 usages
- io.quarkus » quarkus-smallrye-health469 usages
- io.quarkus » quarkus-smallrye-openapi419 usages
- io.quarkus » quarkus-rest-jackson380 usages
- io.quarkus » quarkus-rest372 usages
- io.quarkus » quarkus-grpc357 usages
- org.apache.camel.quarkus » camel-quarkus-maven-plugin302 usages
- io.quarkus » quarkus-resteasy-jsonb231 usages
- io.quarkus » quarkus-jackson-deployment214 usages
- io.quarkus » quarkus-vertx-http209 usages
Computed from the dependency graph of build 20261124.0621 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
