Vulnerabilities in pkg:maven/org.webjars.npm/swagger-ui

PACKAGE
Advisory Identifier: GHSA-c427-hjc3-wrfw
Advisory Summary

CVE-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.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:maven/org.webjars.npm/swagger-ui

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:maven/org.webjars.npm/swagger-ui. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-c427-hjc3-wrfw CVE-2019-17495 CRITICAL Cross-site scripting in Swagger-UI

CVE-2019-17495 at a Glance

CVE Identifier CVE-2019-17495
GHSA Identifier GHSA-c427-hjc3-wrfw
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Swagger ui
Package Ecosystem npm
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (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.

swagger-ui fixed: 3.23.11
npm install swagger-ui@3.23.11
org.webjars:swagger-ui fixed: 3.23.11
<dependency>
    <groupId>org.webjars</groupId>
    <artifactId>swagger-ui</artifactId>
    <version>3.23.11</version>
</dependency>
org.webjars.npm:swagger-ui fixed: 3.23.11
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>swagger-ui</artifactId>
    <version>3.23.11</version>
</dependency>
io.springfox:springfox-swagger-ui fixed: 2.10.0
<dependency>
    <groupId>io.springfox</groupId>
    <artifactId>springfox-swagger-ui</artifactId>
    <version>2.10.0</version>
</dependency>
Verify Direct and Transitive Dependencies

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

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.

CVE-2019-17495 Affected Swagger ui Versions

4 component(s)
Fixed Versions:
3.23.112.10.0
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

NVD — CVE-2019-17495 NVD
https://nvd.nist.gov/vuln/detail/CVE-2019-17495
Security Fix Commit FIX COMMIT
https://github.com/springfox/springfox/commit/26f72f0d16b166e12c20255a4ee907dc10685cf8
Swagger ui Source Repository REPOSITORY
https://github.com/swagger-api/swagger-ui
Swagger ui Release RELEASE
https://github.com/swagger-api/swagger-ui/releases/tag/v3.23.11
Swagger ui Source Repository REPOSITORY
https://github.com/tarantula-team/CSS-injection-in-Swagger-UI
lists.apache.org/thread.html/r103579... WEB
https://lists.apache.org/thread.html/r103579b01da2d0aa0f672b88f811224bbf8ef493aaad845895955e91@%3Ccommits.airflow.apache.org%3E
lists.apache.org/thread.html/r3acb7e... WEB
https://lists.apache.org/thread.html/r3acb7e494cf1aab99b6784b7c5bbddfd0d4f8a484ab534c3a61ef9cf@%3Ccommits.airflow.apache.org%3E
lists.apache.org/thread.html/r84b327... WEB
https://lists.apache.org/thread.html/r84b327f7a8b6b28857b906c07a66dd98e1d341191fa8d7816514ef96@%3Ccommits.airflow.apache.org%3E
lists.apache.org/thread.html/r853ffe... WEB
https://lists.apache.org/thread.html/r853ffeb915a400f899de78124d4e0d77a19379d2e11bf8f4e98c624f@%3Ccommits.airflow.apache.org%3E
lists.apache.org/thread.html/ref70b9... WEB
https://lists.apache.org/thread.html/ref70b940c4f69560d29d6ba792d6c82865e74de3dcad4c92d99b1f8f@%3Ccommits.airflow.apache.org%3E
Swagger ui Security Information SECURITY
https://security.snyk.io/vuln/maven?search=CVE-2019-17495
Swagger ui Security Information SECURITY
https://www.oracle.com/security-alerts/cpuApr2021.html
Swagger ui Security Information SECURITY
https://www.oracle.com/security-alerts/cpujan2022.html
Swagger ui Security Information SECURITY
https://www.oracle.com/security-alerts/cpujul2022.html
Swagger ui Security Information SECURITY
https://www.oracle.com/security-alerts/cpuoct2020.html

Frequently Asked Questions

What is CVE-2019-17495?
CVE-2019-17495 is a security vulnerability in Swagger ui involving Cross-site scripting in Swagger-UI under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Swagger ui versions are affected?
Affected versions include releases prior to 3.23.11, 2.10.0 across affected packages: swagger-ui, org.webjars:swagger-ui, org.webjars.npm:swagger-ui, io.springfox:springfox-swagger-ui.
What version fixes CVE-2019-17495?
Upgrading to 3.23.11, 2.10.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is swagger-ui affected?
Yes, swagger-ui is affected in releases prior to 3.23.11. Upgrade your dependency to 3.23.11 or later.
Is springfox-swagger-ui affected?
Yes, io.springfox:springfox-swagger-ui is affected in releases prior to 2.10.0. Upgrade your dependency to 2.10.0 or later.
What is the CVSS score of CVE-2019-17495?
CVE-2019-17495 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2019-17495?
CVE-2019-17495 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (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.).
How can I check npm dependencies for CVE-2019-17495?
Run the dependency tree command: 'npm ls swagger-ui'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}