Uncaught Exception Affecting @strapi/plugin-upload package, versions <4.22.0


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
0.04% (16th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Uncaught Exception vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-STRAPIPLUGINUPLOAD-7251014
  • published13 Jun 2024
  • disclosed12 Jun 2024
  • creditCxDavidepaalte

Introduced: 12 Jun 2024

CVE-2024-31217  (opens in a new tab)
CWE-248  (opens in a new tab)

How to fix?

Upgrade @strapi/plugin-upload to version 4.22.0 or higher.

Overview

@strapi/plugin-upload is a Makes it easy to upload images and files to your Strapi Application.

Affected versions of this package are vulnerable to Uncaught Exception in the media upload process. An attacker can cause the server to crash without restarting, affecting either development and production environments. Notes:

  1. By sending a specially-crafted request, the entire server crashes with the thrown error instead of crashing only the single request and returning error 500 to the user.

  2. Any user with access to the file upload functionality is able to exploit this vulnerability, affecting applications running in both development mode and production mode as well.

PoC

The issue can be reproduced by following these steps:

  1. Configure Burp’s proxy between a browser and a Strapi server

  2. Log in and upload an image through the Media Library page while having Burp’s interceptor turned on

  3. After capturing the upload POST request in Burp, add %00 at the end of the file extension from the Content-Disposition, in the filename parameter (See reference image 1 below)

  4. Using the cursor, select the added %00 and right-click it. Click in Convert selection > URL > URL decode to transform the selected text into a null byte

  5. Forward the modified request. The server should print an error and crash with the error ERR_INVALID_ARG_VALUE (See reference log 1 below)

References

CVSS Scores

version 3.1