CVE-2018-25031 is a medium-severity (CVSS 4.3) Improper Input Validation vulnerability in org.webjars:swagger-ui. 1 public exploit or proof-of-concept reference is indexed, so weaponization risk is real. A fix is available for org.webjars:swagger-ui — see the affected versions and patch details below.
Spoofing attack in swagger-ui
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
Exploitation and automatability from CISA’s SSVC triage for CVE-2018-25031.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
swagger-uinpmDescription
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.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| ☕Maven | org.webjars:swagger-ui | all versions | 4.1.3org.webjars:swagger-ui:4.1.3 |
| 📦npm | swagger-ui | all versions | 4.1.3npm install swagger-ui@4.1.3 |
Affected Products
swagger uismartbearResearch use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for org.webjars:swagger-ui, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update org.webjars:swagger-ui to 4.1.3 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2018-25031 is resolved across your whole dependency graph.
Workarounds
Restrict outbound requests from the affected component to an allowlist of hosts, block access to link-local and internal address ranges at the network layer, and require authentication on internal services so a forged request cannot reach them unauthenticated.
Frequently Asked Questions
Is CVE-2018-25031 in your dependencies?
Find it across Maven, npm, including transitive dependencies.