CVE-2018-25031 Spoofing attack in swagger-ui
Remote attackers can force Swagger UI to load malicious OpenAPI definitions via crafted URLs, enabling spoofing and potential data exposure.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2018-25031?
CVE-2018-25031 is a medium-severity server-side request forgery vulnerability in n/a, published on 11 Mar 2022. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Official 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.
Which versions are affected by CVE-2018-25031?
4 open source packages ship an affected version, including org.webjars:swagger-ui and swagger-ui. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
org.webjars:swagger-ui Maven | All versions | 4.1.3 |
org.webjars:swagger-ui Maven | All versions | 4.1.3 |
swagger-ui npm | All versions | 4.1.3 |
swagger-ui npm | All versions | 4.1.3 |
Products include Smartbear Swagger Ui.
How do I fix CVE-2018-25031?
Upgrade org.webjars:swagger-ui to 4.1.3 or later.
Upgrade, and send outbound requests through an allow-list that blocks internal addresses. More about Server-side request forgery.
Is CVE-2018-25031 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2018-25031 exists.
Public exploit code: 15 proofs of concept on GitHub.
Other vulnerabilities in n/a
Sources
Also known as GHSA-cr3q-pqgq-m8c2.