Swagger UI 3.14.0 < 3.38.0 Cross-Site Scripting

medium Web App Scanning Plugin ID 113267

Synopsis

Swagger UI 3.14.0 < 3.38.0 Cross-Site Scripting

Description

Swagger UI is a popular library used to beautify API specifications and render it to the users. Swagger UI versions 3.14.1 to 3.37.2 suffer from a DOM Cross-Site Scripting (XSS) vulnerability due to an outdated `DomPurify` embedded library and a feature available in the Swagger UI library itself which allows to fetch a remote API specifications file.

By crafting a malicious specification file and link it through Swagger UI, an attacker could leverage this vulnerability to execute arbitrary JavaScript in the context of the victim user and conduct advanced attacks.

Solution

Update to Swagger UI version 3.38.0 or later.

See Also

https://swagger.io/tools/swagger-ui/

https://www.vidocsecurity.com/blog/hacking-swagger-ui-from-xss-to-account-takeovers/

Plugin Details

Severity: Medium

ID: 113267

Type: remote

Published: 7/18/2022

Updated: 7/18/2022

Scan Template: api, basic, full, pci, scan

Risk Information

VPR

Risk Factor: Medium

Score: 4.2

CVSS v2

Risk Factor: Medium

Base Score: 5.8

Vector: CVSS2#AV:N/AC:M/Au:N/C:P/I:P/A:N

CVSS Score Source: Tenable

CVSS v3

Risk Factor: Medium

Base Score: 6.1

Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

CVSS Score Source: Tenable

Vulnerability Information

CPE: cpe:2.3:a:smartbear:swagger-ui:*:*:*:*:*:*:*:*

Exploit Ease: Exploits are available

Reference Information