Vulnerabilities in pkg:maven/org.webjars/swagger-ui
PACKAGECVE-2018-25031 is a MODERATE (CVSS 4.3) spoofing attack vulnerability (CWE-922: Insecure Storage of Sensitive Information) affecting Swagger ui libraries in the npm ecosystem. The issue involves spoofing attack in swagger-ui. Remediation is available by upgrading affected packages to version 4.1.3.
pkg:maven/org.webjars/swagger-ui
Vulnerability advisories affecting package pkg:maven/org.webjars/swagger-ui. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-cr3q-pqgq-m8c2 | CVE-2018-25031 | MODERATE | Spoofing attack in swagger-ui |
| GHSA-c427-hjc3-wrfw | CVE-2019-17495 | CRITICAL | Cross-site scripting in Swagger-UI |
CVE-2018-25031 at a Glance
Security Impact
CVSS: 4.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N).
How to Fix CVE-2018-25031
To remediate this vulnerability, upgrade all affected Swagger ui dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install swagger-ui@4.1.3
<dependency>
<groupId>org.webjars</groupId>
<artifactId>swagger-ui</artifactId>
<version>4.1.3</version>
</dependency>
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls swagger-ui
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2018-25031, inspect your project dependencies using npm:
npm ls swagger-ui
Analyze the terminal output to locate any version of Swagger ui in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.1.3), your application is affected.
Note: The npm ls swagger-ui command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-922: Insecure Storage of Sensitive Information, where the product stores sensitive information without properly limiting read or write access by unauthorized actors. In Swagger ui, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2018-25031 Affected Swagger ui Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
swagger-ui
|
npm |
< 4.1.3
|
4.1.3
|
|
org.webjars:swagger-ui
|
Maven |
< 4.1.3
|
4.1.3
|
References
Frequently Asked Questions
What is CVE-2018-25031?
Which Swagger ui versions are affected?
What version fixes CVE-2018-25031?
Is swagger-ui affected?
What is the CVSS score of CVE-2018-25031?
What CWE is associated with CVE-2018-25031?
How can I check npm dependencies for CVE-2018-25031?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-cr3q-pqgq-m8c2",
"modified" : "2025-09-02T22:23:59Z",
"published" : "2022-03-12T00:00:36Z",
"aliases" : [ "CVE-2018-25031" ],
"summary" : "Spoofing attack in swagger-ui",
"details" : "Swagger UI before 4.1.3 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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "swagger-ui"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "4.1.3"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.webjars:swagger-ui"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "4.1.3"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2018-25031"
}, {
"type" : "WEB",
"url" : "https://github.com/swagger-api/swagger-ui/issues/4872"
}, {
"type" : "WEB",
"url" : "https://github.com/swagger-api/swagger-ui/pull/7697"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/swagger-api/swagger-ui"
}, {
"type" : "WEB",
"url" : "https://github.com/swagger-api/swagger-ui/releases/tag/v4.1.3"
}, {
"type" : "WEB",
"url" : "https://security.netapp.com/advisory/ntap-20220407-0004"
}, {
"type" : "WEB",
"url" : "https://security.snyk.io/vuln/SNYK-JS-SWAGGERUI-2314885"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-20", "CWE-918", "CWE-922" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2022-03-14T23:31:48Z",
"nvd_published_at" : "2022-03-11T07:15:00Z"
}
}