CVE-2019-17495: Swagger ui Cross-Site Scripting Vulnerability
CRITICALCVE-2019-17495 is a CRITICAL (CVSS 9.8) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Swagger ui libraries in the npm ecosystem. The issue involves cross-site scripting in swagger-ui. Remediation is available by upgrading affected packages to version 3.23.11, 2.10.0.
CVE-2019-17495 at a Glance
Security Impact
CVSS: 9.8
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:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2019-17495
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@3.23.11
<dependency>
<groupId>org.webjars</groupId>
<artifactId>swagger-ui</artifactId>
<version>3.23.11</version>
</dependency>
<dependency>
<groupId>org.webjars.npm</groupId>
<artifactId>swagger-ui</artifactId>
<version>3.23.11</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.10.0</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-2019-17495, 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 3.23.11), 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-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. 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-2019-17495 Affected Swagger ui Versions
4 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
swagger-ui
|
npm |
< 3.23.11
|
3.23.11
|
|
org.webjars:swagger-ui
|
Maven |
< 3.23.11
|
3.23.11
|
|
org.webjars.npm:swagger-ui
|
Maven |
< 3.23.11
|
3.23.11
|
|
io.springfox:springfox-swagger-ui
|
Maven |
< 2.10.0
|
2.10.0
|
References
Frequently Asked Questions
What is CVE-2019-17495?
Which Swagger ui versions are affected?
What version fixes CVE-2019-17495?
Is swagger-ui affected?
Is springfox-swagger-ui affected?
What is the CVSS score of CVE-2019-17495?
What CWE is associated with CVE-2019-17495?
How can I check npm dependencies for CVE-2019-17495?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-c427-hjc3-wrfw",
"modified" : "2024-08-26T15:52:58Z",
"published" : "2019-10-15T19:27:05Z",
"aliases" : [ "CVE-2019-17495" ],
"summary" : "Cross-site scripting in Swagger-UI",
"details" : "A Cascading Style Sheets (CSS) injection vulnerability in Swagger UI before 3.23.11 allows attackers to use the Relative Path Overwrite (RPO) technique to perform CSS-based input field value exfiltration, such as exfiltration of a CSRF token value. In other words, this product intentionally allows the embedding of untrusted JSON data from remote servers, but it was not previously known that <style>@import within the JSON data was a functional attack method.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "swagger-ui"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.23.11"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.webjars:swagger-ui"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.23.11"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.webjars.npm:swagger-ui"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.23.11"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "io.springfox:springfox-swagger-ui"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.10.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2019-17495"
}, {
"type" : "WEB",
"url" : "https://github.com/springfox/springfox/commit/26f72f0d16b166e12c20255a4ee907dc10685cf8"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/swagger-api/swagger-ui"
}, {
"type" : "WEB",
"url" : "https://github.com/swagger-api/swagger-ui/releases/tag/v3.23.11"
}, {
"type" : "WEB",
"url" : "https://github.com/tarantula-team/CSS-injection-in-Swagger-UI"
}, {
"type" : "WEB",
"url" : "https://lists.apache.org/thread.html/r103579b01da2d0aa0f672b88f811224bbf8ef493aaad845895955e91@%3Ccommits.airflow.apache.org%3E"
}, {
"type" : "WEB",
"url" : "https://lists.apache.org/thread.html/r3acb7e494cf1aab99b6784b7c5bbddfd0d4f8a484ab534c3a61ef9cf@%3Ccommits.airflow.apache.org%3E"
}, {
"type" : "WEB",
"url" : "https://lists.apache.org/thread.html/r84b327f7a8b6b28857b906c07a66dd98e1d341191fa8d7816514ef96@%3Ccommits.airflow.apache.org%3E"
}, {
"type" : "WEB",
"url" : "https://lists.apache.org/thread.html/r853ffeb915a400f899de78124d4e0d77a19379d2e11bf8f4e98c624f@%3Ccommits.airflow.apache.org%3E"
}, {
"type" : "WEB",
"url" : "https://lists.apache.org/thread.html/ref70b940c4f69560d29d6ba792d6c82865e74de3dcad4c92d99b1f8f@%3Ccommits.airflow.apache.org%3E"
}, {
"type" : "WEB",
"url" : "https://security.snyk.io/vuln/maven?search=CVE-2019-17495"
}, {
"type" : "WEB",
"url" : "https://www.oracle.com/security-alerts/cpuApr2021.html"
}, {
"type" : "WEB",
"url" : "https://www.oracle.com/security-alerts/cpujan2022.html"
}, {
"type" : "WEB",
"url" : "https://www.oracle.com/security-alerts/cpujul2022.html"
}, {
"type" : "WEB",
"url" : "https://www.oracle.com/security-alerts/cpuoct2020.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-352", "CWE-79" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2019-10-14T20:13:46Z",
"nvd_published_at" : "2019-10-10T22:15:00Z"
}
}