CVE-2018-25031

MEDIUM NUCLEI

Swagger UI < 4.1.3 - Server-Side Request Forgery via OpenAPI Definition URL

Title source: llm
STIX 2.1

Exploitation Summary

EIP tracks 15 public exploits for CVE-2018-25031. PoCs published by mathis2001, afine-com, rafaelcintralopes. A Nuclei detection template is also available.

AI-analyzed exploit summary This repository provides a proof-of-concept for CVE-2018-25031, a spoofing vulnerability in Swagger UI before 4.1.3. The exploit involves crafting URLs with 'configUrl' or 'url' parameters to display remote OpenAPI definitions, potentially leading to phishing or misinformation attacks.

Description

Swagger UI 4.1.2 and earlier could allow a remote attacker to conduct spoofing attacks. By persuading a victim to open a crafted URL, an attacker could exploit this vulnerability to display remote OpenAPI definitions. Note: This was originally claimed to be resolved in 4.1.3. However, third parties have indicated this is not resolved in 4.1.3 and even occurs in that version and possibly others.

Exploits (15)

nomisec WORKING POC 3 stars
by mathis2001 · poc
https://github.com/mathis2001/CVE-2018-25031

This repository provides a proof-of-concept for CVE-2018-25031, a spoofing vulnerability in Swagger UI before 4.1.3. The exploit involves crafting URLs with 'configUrl' or 'url' parameters to display remote OpenAPI definitions, potentially leading to phishing or misinformation attacks.

Classification
Working Poc 90%
Attack Type
Other
Complexity
Trivial
Reliability
Reliable
Target: Swagger UI before 4.1.3
No auth needed
Prerequisites: Victim interaction to open a crafted URL
devstral-2 · analyzed Feb 16, 2026 Full analysis →
nomisec WORKING POC 2 stars
by afine-com · poc
https://github.com/afine-com/CVE-2018-25031

This PoC demonstrates an OpenAPI definition spoofing vulnerability in Swagger UI before 4.1.3. By crafting a URL with a malicious `configUrl` or `url` parameter, an attacker can display arbitrary remote OpenAPI definitions, potentially leading to phishing or misinformation attacks.

Classification
Working Poc 90%
Attack Type
Other
Complexity
Trivial
Reliability
Reliable
Target: Swagger UI before 4.1.3
No auth needed
Prerequisites: Victim must open a crafted URL
devstral-2 · analyzed Feb 16, 2026 Full analysis →
nomisec SCANNER 2 stars
by rafaelcintralopes · poc
https://github.com/rafaelcintralopes/SwaggerUI-CVE-2018-25031

This PoC checks for CVE-2018-25031 in Swagger UI by testing if external URLs can be loaded via `configUrl` or `url` parameters, indicating potential UI misrepresentation. It uses Selenium to automate browser interactions and logs network requests to detect vulnerability.

Classification
Scanner 90%
Attack Type
Info Leak
Complexity
Moderate
Reliability
Reliable
Target: Swagger UI < 4.1.3
No auth needed
Prerequisites: Python 3 · Selenium · Chrome WebDriver · Target Swagger UI instance
devstral-2 · analyzed Feb 16, 2026 Full analysis →
nomisec WORKING POC
by rasinfosec · poc
https://github.com/rasinfosec/CVE-2018-25031

The repository contains functional exploit code demonstrating XSS vulnerabilities in DOMPurify via crafted OpenAPI/Swagger YAML files. The payloads include various XSS vectors embedded in API documentation descriptions, targeting CVE-2018-25031.

Classification
Working Poc 90%
Attack Type
Xss
Complexity
Trivial
Reliability
Reliable
Target: DOMPurify (versions affected by CVE-2018-25031)
No auth needed
Prerequisites: A vulnerable version of DOMPurify processing untrusted YAML/OpenAPI input
MITRE ATT&CK
devstral-2 · analyzed Feb 16, 2026 Full analysis →
nomisec SUSPICIOUS
by labeebSabbah · poc
https://github.com/labeebSabbah/CVE-2018-25031

The repository contains a YAML file with a Swagger API documentation that includes a login form pointing to an external IP address. There is no actual exploit code or technical details about CVE-2018-25031, making it appear as a potential lure for further interaction.

Classification
Suspicious 90%
Attack Type
Other
Complexity
Trivial
Reliability
Theoretical
Target: unspecified
Auth required
Prerequisites: access to the repository
devstral-2 · analyzed Feb 16, 2026 Full analysis →
nomisec WRITEUP
by RelicHunt3r · poc
https://github.com/RelicHunt3r/swagger-ui

The repository provides a detailed writeup and proof-of-concept for CVE-2018-25031, a vulnerability in Swagger UI that allows remote specification loading, leading to potential HTML injection, XSS, and SSRF attacks.

Classification
Writeup 90%
Attack Type
Xss | Ssrf | Info Leak
Complexity
Trivial
Reliability
Reliable
Target: Swagger UI
No auth needed
Prerequisites: Access to a vulnerable Swagger UI instance · Ability to host malicious configuration files
devstral-2 · analyzed Feb 16, 2026 Full analysis →
nomisec WORKING POC
by h4ckt0m · poc
https://github.com/h4ckt0m/CVE-2018-25031-test

This repository contains a YAML file demonstrating an XSS vulnerability in Swagger UI (CVE-2018-25031) via crafted API documentation. The payload injects malicious JavaScript into the description field, triggering an alert when rendered.

Classification
Working Poc 90%
Attack Type
Xss
Complexity
Trivial
Reliability
Reliable
Target: Swagger UI
No auth needed
Prerequisites: Access to a vulnerable Swagger UI instance
devstral-2 · analyzed Feb 16, 2026 Full analysis →
nomisec WORKING POC
by nigartest · poc
https://github.com/nigartest/CVE-2018-25031

This repository contains functional proof-of-concept code for CVE-2018-25031, demonstrating a DOM-based XSS vulnerability. The exploit leverages malformed Swagger/OpenAPI documentation to inject malicious JavaScript payloads, triggering XSS in vulnerable systems.

Classification
Working Poc 90%
Attack Type
Xss
Complexity
Trivial
Reliability
Reliable
Target: Swagger UI (versions affected by CVE-2018-25031)
No auth needed
Prerequisites: Access to a vulnerable Swagger UI instance
devstral-2 · analyzed Feb 16, 2026 Full analysis →
nomisec STUB
by KonEch0 · poc
https://github.com/KonEch0/CVE-2018-25031-SG

The repository contains only a minimal OpenAPI YAML file with no functional exploit code or technical details about CVE-2018-25031. It lacks any meaningful content to demonstrate or analyze the vulnerability.

Classification
Stub 90%
Attack Type
Other
Complexity
Trivial
Reliability
Theoretical
Target: unknown
No auth needed
devstral-2 · analyzed Feb 16, 2026 Full analysis →
nomisec STUB
by natpakun · poc
https://github.com/natpakun/SSRF-CVE-2018-25031-

The repository contains only a minimal YAML file with a title and description mentioning SSRF (CVE-2018-25031) but lacks any functional exploit code or technical details.

Classification
Stub 90%
Attack Type
Ssrf
Complexity
Trivial
Reliability
Theoretical
Target: Unknown (no details provided)
No auth needed
devstral-2 · analyzed Feb 16, 2026 Full analysis →
nomisec STUB
by h2oa · poc
https://github.com/h2oa/CVE-2018-25031

The repository contains a minimal OpenAPI YAML file with placeholder text and no functional exploit code. It lacks technical details or executable payloads related to CVE-2018-25031.

Classification
Stub 90%
Attack Type
Other
Complexity
Trivial
Reliability
Theoretical
Target: Unknown (h2oa referenced but no version or context)
No auth needed
Prerequisites: None identified
devstral-2 · analyzed Feb 16, 2026 Full analysis →
nomisec WORKING POC
by geozin · poc
https://github.com/geozin/POC-CVE-2018-25031

This PoC exploits CVE-2018-25031 in Swagger UI before 4.1.3 by tricking victims into entering an authorization code, which is then exfiltrated to an attacker-controlled URL. It leverages XSS via malicious configUrl or url parameters to capture sensitive data.

Classification
Working Poc 90%
Attack Type
Xss
Complexity
Trivial
Reliability
Reliable
Target: Swagger UI before 4.1.3
No auth needed
Prerequisites: Victim interaction required · Attacker-controlled JSON/YAML file
MITRE ATT&CK
devstral-2 · analyzed Feb 16, 2026 Full analysis →
nomisec WORKING POC
by johnlaurance · poc
https://github.com/johnlaurance/CVE-2018-25031-test2

The repository contains YAML files demonstrating an XSS vulnerability in Swagger UI by embedding malicious HTML/JavaScript payloads in API descriptions. The payloads attempt to steal cookies via an onerror event in an img tag.

Classification
Working Poc 90%
Attack Type
Xss
Complexity
Trivial
Reliability
Reliable
Target: Swagger UI (versions affected by CVE-2018-25031)
No auth needed
Prerequisites: Access to a vulnerable Swagger UI instance
MITRE ATT&CK
devstral-2 · analyzed Feb 16, 2026 Full analysis →
nomisec STUB
by hev0x · poc
https://github.com/hev0x/CVE-2018-25031-PoC

The repository contains only a README.md file with minimal information about CVE-2018-25031, lacking any actual exploit code or technical details. No proof-of-concept or exploit implementation is provided.

Classification
Stub 10%
Attack Type
Other
Complexity
Trivial
Reliability
Theoretical
Target: unknown
No auth needed
devstral-2 · analyzed Feb 16, 2026 Full analysis →
nomisec WORKING POC
by LUCASRENAA · poc
https://github.com/LUCASRENAA/CVE-2018-25031

This repository contains a Python-based PoC for CVE-2018-25031, demonstrating a Cross-Site Scripting (XSS) vulnerability in Swagger UI versions 2.9.2 and earlier. The script uses Selenium to automate testing of target URLs by injecting a malicious payload via the `configUrl` parameter.

Classification
Working Poc 90%
Attack Type
Xss
Complexity
Moderate
Reliability
Reliable
Target: Swagger UI <= 2.9.2
No auth needed
Prerequisites: Python · Selenium · ChromeDriver · List of target URLs in `sites_para_testar.txt`
MITRE ATT&CK
devstral-2 · analyzed Feb 16, 2026 Full analysis →

Nuclei Templates (1)

Swagger UI < 3.38.0 - Cross-Site Scripting
MEDIUMVERIFIEDby DhiyaneshDK
Shodan: http.component:"Swagger" || http.component:"swagger" || http.favicon.hash:"-1180440057"
FOFA: icon_hash="-1180440057"

References (4)

Core 4
Core References
Issue Tracking, Patch, Third Party Advisory
https://github.com/swagger-api/swagger-ui/issues/4872

Scores

CVSS v3 4.3
EPSS 0.8042
EPSS Percentile 99.2%
Attack Vector NETWORK
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N

CISA SSVC

Vulnrichment
Exploitation poc
Automatable no
Technical Impact partial

Details

CWE
CWE-918 CWE-20 CWE-922
Status published
Products (3)
npm/swagger-ui 0 - 4.1.3npm
org.webjars/swagger-ui 0 - 4.1.3Maven
smartbear/swagger_ui < 4.1.3
Published Mar 11, 2022
Tracked Since Feb 18, 2026