CVE-2016-1000233: Swagger ui Cross-Site Scripting Vulnerability
HIGHCVE-2016-1000233 is a HIGH 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 2.2.1.
CVE-2016-1000233 at a Glance
How to Fix CVE-2016-1000233
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@2.2.1
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-2016-1000233, 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 2.2.1), 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-2016-1000233 Affected Swagger ui Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
swagger-ui
|
npm |
< 2.2.1
|
2.2.1
|
References
Frequently Asked Questions
What is CVE-2016-1000233?
Which Swagger ui versions are affected?
What version fixes CVE-2016-1000233?
Is swagger-ui affected?
What CWE is associated with CVE-2016-1000233?
How can I check npm dependencies for CVE-2016-1000233?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-mrx7-8hxf-f853",
"modified" : "2021-09-23T21:33:20Z",
"published" : "2020-09-01T15:36:27Z",
"aliases" : [ "CVE-2016-1000233" ],
"summary" : "Cross-Site Scripting in swagger-ui",
"details" : "Affected versions of `swagger-ui` are vulnerable to cross-site scripting. This vulnerability exists because `swagger-ui` automatically executes external Javascript that is loaded in via the `url` query string parameter when a `Content-Type: application/javascript` header is included.\n\nAn attacker can create a server that replies with a malicious script and the proper content-type, and then craft a `swagger-ui` URL that includes the location to their server/script in the `url` query string parameter. When viewed, such a link would execute the attacker's malicious script.\n\n\n## Recommendation\n\nUpdate to 2.2.1 or later.",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "swagger-ui"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.2.1"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2016-1000233"
}, {
"type" : "WEB",
"url" : "https://github.com/swagger-api/swagger-ui/issues/1863"
}, {
"type" : "WEB",
"url" : "https://github.com/swagger-api/swagger-ui/commit/331d2be070d89162aa3174a8773ae4a0093f78bc"
}, {
"type" : "WEB",
"url" : "https://github.com/swagger-api/swagger-ui"
}, {
"type" : "WEB",
"url" : "https://www.npmjs.com/advisories/131"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2020-08-31T18:11:55Z",
"nvd_published_at" : null
}
}