Niska

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

  • Ujawniono: 22.10.2025
  • Aktualizacja: 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

Czego dotyczy

Kliknij technologię, aby zobaczyć wszystkie dotyczące jej podatności.

PlatformaPaczkaPodatne wersjePoprawka w wersji
Java / Kotlin (Maven) io.vertx:vertx-web < 4.5.22, >= 5.0.0, < 5.0.5 4.5.22, 5.0.5

Odnośniki

Ocena CVSS 4.9/10
Wektor CVSS
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:L/I:L/A:N
Słabość (CWE)
CWE-79
Platforma
Java / Kotlin (Maven)
Paczka
io.vertx:vertx-web
Ujawniono
22.10.2025
Aktualizacja
11.10.2026 13:20

Źródła i licencje

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

Historia podatności: io.vertx:vertx-web

Wszystkie opisane podatności tej paczki (Java / Kotlin (Maven)), od najnowszej. Widać, czy to jednorazowa wpadka, czy paczka, której trzeba pilnować.

Wszystkich wpisów
7
Pierwsza → ostatnia
10.2018 10.2025
Bez poprawki
0
Wykorzystywana w atakach
0

Rozkład istotności

  • Krytyczna 2
  • Wysoka 2
  • Średnia 2
  • Niska 1

Ujawnienia w latach

  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 ten wpis
    Niska · 4.9 CVE-2025-11966 < 4.5.22, >= 5.0.0, < 5.0.5 4.5.22, 5.0.5
  2. Krytyczna · 9.8 CVE-2019-17640 >= 3.0.0, < 3.9.4 3.9.4
  3. Wysoka · 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. Wysoka CVE-2018-12540 >= 3.0.0, < 3.5.3 3.5.3

Dowiedz się, które podatności dotyczą Twojej aplikacji

Po podłączeniu integracji DockRay i włączeniu raportowania oprogramowania DockRay porównuje zgłoszone wersje komponentów ze znanymi podatnościami i powiadamia o potwierdzonych dopasowaniach. Zakres zależy od obsługiwanej technologii i dostępnych biuletynów.

Podłącz swoją aplikację
Newsletter DockRay

Bezpieczeństwo aplikacji w Twojej skrzynce

Najważniejsze podatności, konkretne zalecenia i praktyczne wskazówki dla Twoich aplikacji. Wybierz technologie i śledź to, co ma znaczenie dla Twojego projektu.

  • Codzienne zestawienie nowych podatności, także krytycznych.
  • Powiadomienia o ważnych aktualizacjach.
  • Praktyczne porady o bezpieczeństwie i monitoringu aplikacji.

Pozostaw puste, aby otrzymywać informacje o wszystkich technologiach.

Zapis jest bezpłatny. Wypiszesz się jednym kliknięciem w wiadomości.