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

swagger-ui Updated 02 Oct 2025

Summary

12/03/2022
Yes i
Moderate
4.3

CVE-2018-25031: Spoofing attack in swagger-ui. Affects swagger-ui versions < 4.1.3. Fixed in 4.1.3. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

Swagger UI is an open-source tool that allows developers to visualize and interact with the OpenAPI (formerly known as Swagger) specifications of their APIs. It provides a user-friendly interface for exploring and testing APIs. However, versions before 4.1.3 of Swagger UI are vulnerable to a spoofing attack.

Vulnerability Detail

The vulnerability in Swagger UI before 4.1.3 allows a remote attacker to conduct spoofing attacks. By tricking a victim into opening a specially crafted URL, the attacker can exploit this vulnerability to display remote OpenAPI definitions. This can lead to confusion and potential security risks as users may unknowingly interact with a malicious API.

How To Fix

Latest published version: 5.34.0 as of 22 Oct 2026

npm install swagger-ui@5.34.0

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

4.1.3

This is the first release that contains the fix.

npm install swagger-ui@4.1.3

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There is no known workaround for this vulnerability. It is essential to update to the fixed version of Swagger UI to mitigate the risk of spoofing attacks.

Conclusion

In conclusion, the vulnerability in Swagger UI before version 4.1.3 allows for spoofing attacks, which can lead to potential security risks. It is crucial to update to the fixed version to mitigate this vulnerability. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for swagger-ui →

Share this vulnerability

FAQ

Swagger UI is an open-source tool that provides a user-friendly interface for visualizing and interacting with API specifications.

A spoofing attack is when an attacker impersonates a trusted entity or source to deceive users and gain unauthorized access or manipulate data.

If you are using a version of Swagger UI before 4.1.3, you are vulnerable to spoofing attacks. It is recommended to update to the fixed version to mitigate this risk.

No, there are no known workarounds for this vulnerability. Updating to the fixed version is the only solution.

To update Swagger UI, use the package manager for your project, such as npm, and run the command: npm update swagger-ui.

Related vulnerabilities

Recent vulnerabilities recorded for swagger-ui.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Latest published version: 5.34.0 as of 22 Oct 2026

npm install swagger-ui@5.34.0

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

4.1.3

This is the first release that contains the fix.

npm install swagger-ui@4.1.3

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback