# CVE-2018-25031: Spoofing attack in swagger-ui

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 4.3
- **CVSS:** 4.3 (v3.1, CNA) `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Privileges required: None; User interaction: Required; Scope: Unchanged; Confidentiality impact: Low; Integrity impact: None; Availability impact: None
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** Yes (see exploit references)
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 65.58% (percentile 99, 2026-11-26)
- **CWE:** CWE-20, CWE-918, CWE-922
- **Aliases:** EDB-51379, GHSA-cr3q-pqgq-m8c2
- **Published:** 2022-03-11T06:47:46.000Z
- **Modified:** 2026-11-23T00:00:00.000Z

## Who should check

- Projects that depend on npm package swagger-ui (\< 4.1.3)
- Projects that depend on Maven package org.webjars:swagger-ui (\< 4.1.3)
- Anyone running n/a (versions: see the vendor advisory)
- Anyone running smartbear swagger\_ui \<= 4.1.2

## 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.

## Affected and fixed versions

- npm `swagger-ui`: affected \< 4.1.3; fixed 4.1.3 (osv)
- Maven `org.webjars:swagger-ui`: affected \< 4.1.3; fixed 4.1.3 (osv)
- n/a: see vendor advisory (nvd)
- smartbear swagger\_ui: \<= 4.1.2 (nvd)

## Mitigation

- Upgrade swagger-ui to 4.1.3 or later.
- Upgrade org.webjars:swagger-ui to 4.1.3 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2018-25031. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2018-25031.md
Affected: swagger-ui < 4.1.3; org.webjars:swagger-ui < 4.1.3
Fixed in: 4.1.3

Steps:
1. Search this machine and project for swagger-ui (npm), org.webjars:swagger-ui (Maven), n/a, smartbear swagger_ui: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2018-25031 being exploited?

There is no confirmed exploitation: CVE-2018-25031 is not in the CISA Known Exploited Vulnerabilities catalog. Public exploit code or a proof of concept is available. EPSS estimates a 65.58% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2018-25031?

Medium: CVSS 4.3 (v3.1, scored by CNA). Remote, no login needed. A user has to take an action, such as opening a link, for the attack to work.

### Which versions are affected by CVE-2018-25031?

swagger-ui \< 4.1.3; org.webjars:swagger-ui \< 4.1.3.

### Is there a fix for CVE-2018-25031?

Yes. Fixed in 4.1.3. Upgrade swagger-ui to 4.1.3 or later. Upgrade org.webjars:swagger-ui to 4.1.3 or later.

### How do I check if I'm affected by CVE-2018-25031?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2018-25031>
- patch: <https://security.snyk.io/vuln/SNYK-JS-SWAGGERUI-2314885>
- patch: <https://github.com/swagger-api/swagger-ui/issues/4872>
- patch: <https://github.com/swagger-api/swagger-ui/pull/7697>
- exploit: <https://www.exploit-db.com/exploits/51379>
- other: <https://github.com/swagger-api/swagger-ui/releases/tag/v4.1.3>
- other: <https://security.netapp.com/advisory/ntap-20220407-0004/>
- other: <https://github.com/swagger-api/swagger-ui>
- other: <https://security.netapp.com/advisory/ntap-20220407-0004>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2018-25031>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-cr3q-pqgq-m8c2> (license: <https://creativecommons.org/licenses/by/4.0/>)
- Exploit-DB: Exploit metadata (ID and link only) from the Exploit Database <https://www.exploit-db.com/exploits/51379>

HTML: <https://flawdb.com/CVE-2018-25031> · JSON: <https://flawdb.com/api/v1/entries/CVE-2018-25031>
