Disclosed vulnerabilities
Fixed: Mar 26, 2024
CVE-2024-31217 Published: Apr 4, 2024

Denial-of-Service via Improper Exception Handling in @strapi/plugin-upload

5.3 Medium Severity Denial dos js npm Service
Davide Teixeira Reported by Checkmarx Zero

Summary

A Denial-of-Service was found in NPM’s @strapi/plugin-upload package during the file upload process. This vulnerability allows an attacker to crash the node server, affecting either development and production environments.

Product

This vulnerability affects NPM’s package @strapi/plugin-upload in versions 4.x prior to 4.22.0, and 5.x prior to 5.0.0-beta2.

Impact

Denial-of-Service occurs when a service becomes unavailable for users or other services.
By sending a specially crafted request, the server crashes instead of gracefully handling the exception.
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.

Steps to reproduce

Due to a bug in what we believe to be Burp’s decoding system, we couldn’t produce a valid file to easily reproduce the vulnerability. Instead, 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.
  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.

Expected result

The server should print an error and crash with the error ERR_INVALID_ARG_VALUE.

Remediation

A fix was released in PR #19913, where input validation and error handling were implemented to protect against Denial of Service issues. Users are recommended to upgrade to version 4.22.0, which includes this fix.

Credit

This issue was discovered and reported by Checkmarx SCA Security Analyst Davide Teixeira.

Resources

  1. Pull Request
  2. Commit

Stay connected and never miss a research update!