icon

We found results for “

CVE-2022-22116

Date: January 10, 2022

Overview

In Directus, versions 9.0.0-alpha.4 through 9.4.1 are vulnerable to stored Cross-Site Scripting (XSS) vulnerability via SVG file upload in media upload functionality. A low privileged attacker can inject arbitrary javascript code which will be executed in a victim’s browser when they open the image URL.

Details

Directus application is affected by a stored XSS vulnerability via SVG file upload in media upload functionality. The script in the crafted file is executed in a victim’s browser when they open the image URL.

PoC Details

Login to the application with a low privileged user.
Go to the files section and upload the SVG file with the payload given below.
In a private window, login as administrator. Go to the file library and open the image in a new tab. Notice the XSS gets triggered.

PoC Code

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" baseProfile="full" xmlns="http://www.w3.org/2000/svg">
   <polygon id="triangle" points="0,0 0,50 50,0" fill="#009900" stroke="#004400"/>
   <script type="text/javascript">
      alert('This app is vulnerable to XSS attacks!');
   </script>
</svg>

Affected Environments

Github - v9.0.0-alpha.4 through v9.4.1; NPM - 9.0.0-alpha.5 through 9.4.1

Prevention

Update to directus version 9.4.2

Language: TYPE_SCRIPT

Good to know:

icon

Cross-Site Scripting (XSS)

CWE-79
icon

Upgrade Version

Upgrade to version directus - 9.4.2

Learn More

Base Score:
Attack Vector (AV): Network
Attack Complexity (AC): Low
Privileges Required (PR): Low
User Interaction (UI): Required
Scope (S): Changed
Confidentiality (C): Low
Integrity (I): Low
Availability (A): None
Base Score:
Access Vector (AV): Network
Access Complexity (AC): Medium
Authentication (AU): Single
Confidentiality (C): None
Integrity (I): Partial
Availability (A): None
Additional information: