{"id":"CVE-2025-11966","aliases":["CVE-2025-11966","GHSA-45p5-v273-3qqr"],"related":[],"kind":"vulnerability","state":"published","title":"Vert.x-Web vulnerable to Stored Cross-site Scripting in directory listings via file names","summary":"In Eclipse Vert.x versions [4.0.0, 4.5.21] and [5.0.0, 5.0.4], when \"directory listing\" is enabled, file and directory names are inserted into generated HTML without proper escaping in the href, title, and link attributes. An attacker who can create or rename files or directories within a served path can craft filenames containing malicious script or HTML content, leading to stored cross-site scripting (XSS) that executes in the context of users viewing the affected directory listing.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In Eclipse Vert.x versions [4.0.0, 4.5.21] and [5.0.0, 5.0.4], when \"directory listing\" is enabled, file and directory names are inserted into generated HTML without proper escaping in the href, title, and link attributes. An attacker who can create or rename files or directories within a served path can craft filenames containing malicious script or HTML content, leading to stored cross-site scripting (XSS) that executes in the context of users viewing the affected directory listing.","source":"cvelist"},{"lang":"en","text":"# Description\n\n- 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.\n- 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.\n- Affected Code:\n    - File: `vertx-web/src/main/java/io/vertx/ext/web/handler/impl/StaticHandlerImpl.java`\n    - Lines:\n        - 709–713: `normalizedDir` is constructed without escaping\n        - 714–731: `<li><a ...>` elements insert file names directly into attributes and body without escaping\n        - 744: parent directory name construction\n        - 746–751: `{directory}`, `{parent}`, and `{files}` are inserted into the HTML template without escaping\n\n# Reproduction Steps\n\n1. Prerequisites:\n    - Directory listing is enabled using `StaticHandler`  \n      (e.g., `StaticHandler.create(\"public\").setDirectoryListing(true)`)\n    - The attacker has the ability to create arbitrary file names under a public directory (e.g., via upload functionality or a shared directory)\n\n2. Create a malicious file name (example for Unix-based OS):\n    - Create an empty file in `public/` with one of the following names:\n      - `<img src=x onerror=alert('XSS')>.txt`\n      - Or attribute injection: `evil\" onmouseover=\"alert('XSS')\".txt`\n    - Example:\n      ```bash\n      mkdir -p public\n      printf 'test' > \"public/<img src=x onerror=alert('XSS')>.txt\"\n      ```\n\n3. Start the server (example):\n    - Routing: `router.route(\"/public/*\").handler(StaticHandler.create(\"public\").setDirectoryListing(true));`\n    - Server: `vertx.createHttpServer().requestHandler(router).listen(8890);`\n\n4. Verification request (raw HTTP):\n    ```\n    GET /public/ HTTP/1.1\n    Host: 127.0.0.1:8890\n    Accept: text/html\n    Connection: close\n    ```\n\n5. Example response excerpt:\n    ```html\n    <ul id=\"files\">\n      <li>\n        <a href=\"/public/<img src=x onerror=alert('XSS')>.txt\"\n           title=\"<img src=x onerror=alert('XSS')>.txt\">\n           <img src=x onerror=alert('XSS')>.txt\n        </a>\n      </li>\n      ...\n    </ul>\n    ```\n\n- When accessing `/public/` in a browser, the unescaped file name is interpreted as HTML, and event handlers such as `onerror` are executed.\n\n# Potential Impact\n\n- **Stored XSS**\n    - Arbitrary JavaScript executes in the browser context of users viewing the listing page\n    - Possible consequences:\n        - Theft of session tokens, JWTs, localStorage contents, or CSRF tokens\n        - Unauthorized actions with admin privileges (user creation, permission changes, settings modifications)\n        - Watering hole attacks, including malware distribution or malicious script injection to other pages\n\n- **Common Conditions That Make Exploitation Easier**\n    - Uploaded files are served directly under a publicly accessible directory\n    - Shared/synced directories (e.g., NFS, SMB, WebDAV, or cloud sync) are exposed\n    - ZIP/TAR archives are extracted directly under the webroot and directory listing is enabled in production environments\n\n# Similar CVEs Previously Reported\n\n- CVE‑2024‑32966  \n- CVE‑2019‑15603","format":"markdown","source":"ghsa"},{"lang":"es","text":"En las versiones de Eclipse Vert.x [4.0.0, 4.5.21] y [5.0.0, 5.0.4], cuando el 'listado de directorios' está habilitado, los nombres de archivos y directorios se insertan en el HTML generado sin el escape adecuado en los atributos href, title y link. Un atacante que puede crear o renombrar archivos o directorios dentro de una ruta servida puede elaborar nombres de archivo que contengan scripts maliciosos o contenido HTML, lo que lleva a un cross-site scripting (XSS) almacenado que se ejecuta en el contexto de los usuarios que ven el listado de directorios afectado.","source":"nvd"}],"published":"2025-10-22T14:44:24.145Z","modified":"2026-10-08T11:10:00.250Z","severity":{"scorer":"eclipse","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:H/AT:P/PR:L/UI:N/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N","score":2.3,"rating":"LOW"},"severities":[{"scorer":"eclipse","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:H/AT:P/PR:L/UI:N/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N","score":2.3,"rating":"LOW"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:L/I:L/A:N","score":4.9,"rating":"LOW"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:H/AT:P/PR:L/UI:N/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N","rating":"LOW"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N","score":6.4,"rating":"MEDIUM"}],"cwes":["CWE-79","CWE-80"],"affected":[{"ranges":[{"type":"maven","introduced":"4.0.0","fixed":"4.5.22","status":"affected"},{"type":"maven","introduced":"5.0.0","fixed":"5.0.5","status":"affected"}],"vendor":"Eclipse Foundation","product":"Vert.x","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"4.5.22"}],"ecosystem":"Maven","package":"io.vertx:vertx-web","purl":"pkg:maven/io.vertx/vertx-web","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"5.0.0","status":"affected","fixed":"5.0.5"}],"ecosystem":"Maven","package":"io.vertx:vertx-web","purl":"pkg:maven/io.vertx/vertx-web","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"4.0.0","fixed":"4.5.22"},{"status":"affected","introduced":"5.0.0","fixed":"5.0.5"}],"vendor":"eclipse","product":"vert.x","cpe":"cpe:2.3:a:eclipse:vert.x:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://gitlab.eclipse.org/security/vulnerability-reports/-/issues/303","tags":["exploit","issue-tracking","vendor-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/vert-x3/vertx-web/security/advisories/GHSA-45p5-v273-3qqr","tags":["web"],"sources":["ghsa"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-11966","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/vert-x3/vertx-web","tags":["package"],"sources":["ghsa"]}],"credits":["Sho Odagiri"],"assigner":"eclipse","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2025-10-22T15:24:31.799Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-11966","url":"https://www.cve.org/CVERecord?id=CVE-2025-11966","licence":"CVE Terms of Use","modified":"2025-10-22T15:26:41.527Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-45p5-v273-3qqr","url":"https://github.com/advisories/GHSA-45p5-v273-3qqr","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:29.197Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-11966","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-11966","licence":"Public domain","modified":"2026-10-08T11:10:00.250Z"}],"updatedAt":"2026-11-25T22:59:06.660Z","epss":{"score":0.00298,"percentile":0.24178,"date":"2026-12-01T12:00:22.000Z"}}