CVE-2025-55746: Directus Directus Allows Unauthenticated File Upload Vulnerability

CRITICAL
Advisory Identifier: GHSA-mv33-9f6j-pfmc
CVSS 9.3
CWE-73
Published
Advisory Summary

CVE-2025-55746 is a CRITICAL (CVSS 9.3) directus allows unauthenticated file upload vulnerability (CWE-73: External Control of File Name or Path) affecting Directus libraries in the npm ecosystem. The issue involves directus allows unauthenticated file upload and file modification due to lacking input sanitization. Remediation is available by upgrading affected packages to version 11.9.3, 28.0.2.

CVE-2025-55746 at a Glance

CVE Identifier CVE-2025-55746
GHSA Identifier GHSA-mv33-9f6j-pfmc
Severity CRITICAL
CVSS v3.1 Base Score 9.3
CWE Classification CWE-73: External Control of File Name or Path
Affected Product Directus
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 9.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality None (C:N)
Integrity High (I:H)
Availability Low (A:L)

How to Fix CVE-2025-55746

To remediate this vulnerability, upgrade all affected Directus dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

directus fixed: 11.9.3
npm install directus@11.9.3
@directus/api fixed: 28.0.2
npm install @directus/api@28.0.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls directus

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2025-55746, inspect your project dependencies using npm:

npm ls directus

Analyze the terminal output to locate any version of Directus in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 11.9.3), your application is affected.

Note: The npm ls directus command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-73: External Control of File Name or Path, where the product allows user input to control or influence paths or file names that are used in filesystem operations. In Directus, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary A vulnerability exists in the file update mechanism which allows an unauthenticated actor to modify existing files with arbitrary contents (without changes being applied to the files' database-resident metadata) and / or upload new files, with arbitrary content and extensions, which won't show up in the Directus UI. ## Details Directus exposes the CRUD operations for uploading or handling files under the `/files` route. The endpoint handler is responsible for updating an existing file identified by the provided primary key specified through the `pk` parameter. Primary keys are UUID values such as `/files/927b3abf-fb4b-4c66-bdaa-eb7dc48a51cb`. Here the `filename_disk` value is never sanitized, it's possible to pass a path containing traversal sequences (`../`) through it, but a fully arbitrary file write is not possible in case the "local" storage handler is used. (Other storage implementations haven't been checked during the research process). The `packages/storage-driver-local/src/index.ts` file defines two relevant functions: `write` and `fullpath`. The `write` method uses the `fullPath` method to create the absolute path for the to-be-created file. The `join` method is used to create the final path string. As the `fullPath` method uses `join` to create a relative path starting with the separator to be added under the download dir, this call normalizes the path and further upwards traversal is not possible during the write operation. With that being said, it is still possible, to make the system "ignore" the `temp_` prefix given to the file, resulting in an arbitrarily named file being placed in the upload folder. As a summary for the vulnerability: - It is possible, to change the contents of an existing file, as an existing UUID can be specified as the file name - The metadata won't change, so the mime type cannot be modified - This also makes the changes happen "silently", without directus knowing about the changes - A new, previously non-existent file can be created with arbitrary contents - The file won't show up in on the Directus UI, it can only be seen through other means (such as shell access) - An extension MUST be defined for the file to be modified - This prevents us from uploading executables or malware with no extensions, but these wouldn't be executable either way Recommendations for fixing the vulnerability can be found in later chapters. ## Requirements As providing a primary key is required for successful exploitation, at least one asset with a known UUID must be available for an attacker. This can usually be achieved by browsing an application that uses the given Directus instance to provide images. Naturally, the instance needs to be accessible over the network used by the attacker as well. Once network access and knowledge of at least one file UUID is available for the attacker, exploitation can be done by sending a single request. ## Potential impacts The impact of successful exploitation is highly dependent on how Directus is set up to be used by a different application. Many different configurations can be created, but the following are likely the most noteworthy: 1. Setting up a phishing site SVGs can be used to set up very sophisticated looking pages, as it allows the embedding of HTML, CSS and scripts. The issue is once again with the `default-src: none` CSP settings. This setting prevents the use of CSS in the SVG file, so the created page will look strange. While the page obviously looks strange, it's important to notice that since the domain checks out, the browser could fill out the login forms, making for a much more convincing page as shown below: An error message can be used to make it look like an error in the system! 2. Server serves files directly from the upload directory: In this setup, a server such ash nginx serves files in a static manner. The served files are loaded from a "public" folder made accessible through Directus as it's recommended in the files API docs. Quoting: "make a public folder and allow access to this", except the upload folder is directly served by the server: Since the files loaded by the server are sourced directly from the file storage, the arbitrary file write might allow an attacker to upload a webshell into the folder, giving it an arbitrary file extension. As the extension checks out as a valid PHP file for instance, and the contents are correct code, an attacker can achieve unauthenticated code execution on the server. 3. Poisoning hosted files The previous examples focused on active exploitation, but it's important to mention that the vulnerability allows for arbitrary changes in files. This can be used for many different attack primitives. Let's consider the following scenario: Directus is used not only to serve contents on a company's web page, but internally as well. Onboarding documents for new entries are hosted on the instance. Manuals with links to internal services are provided through PDF files. If the file can be accessed and modified by an attacker, it would be trivial to set up a spoofed instance which receives credentials for internal services but redirects to the original, internal service right after. ## Credits The bug was discovered by Zombor Máté, a security researcher at PCA Cyber Security (https://pcacybersecurity.com/)

CVE-2025-55746 Affected Directus Versions

2 component(s)
Fixed Versions:
11.9.328.0.2
Product / Package Ecosystem Affected Versions Fixed Version
directus
npm
≥ 10.8.0
< 11.9.3
11.9.3
@directus/api
npm
≥ 14.1.0
< 28.0.2
28.0.2

References

Frequently Asked Questions

What is CVE-2025-55746?
CVE-2025-55746 is a security vulnerability in Directus involving Directus allows unauthenticated file upload and file modification due to lacking input sanitization under CWE-73: External Control of File Name or Path.
Which Directus versions are affected?
Affected versions include releases prior to 11.9.3, 28.0.2 across affected packages: directus, @directus/api.
What version fixes CVE-2025-55746?
Upgrading to 11.9.3, 28.0.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is directus affected?
Yes, directus is affected in releases prior to 11.9.3. Upgrade your dependency to 11.9.3 or later.
Is @directus/api affected?
Yes, @directus/api is affected in releases prior to 28.0.2. Upgrade your dependency to 28.0.2 or later.
What is the CVSS score of CVE-2025-55746?
CVE-2025-55746 has a CVSS v3.1 base score of 9.3 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:L.
What CWE is associated with CVE-2025-55746?
CVE-2025-55746 is classified under CWE-73: External Control of File Name or Path (The product allows user input to control or influence paths or file names that are used in filesystem operations.).
How can I check npm dependencies for CVE-2025-55746?
Run the dependency tree command: 'npm ls directus'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-mv33-9f6j-pfmc",
  "modified" : "2025-08-20T19:08:20Z",
  "published" : "2025-08-20T19:08:20Z",
  "aliases" : [ "CVE-2025-55746" ],
  "summary" : "Directus allows unauthenticated file upload and file modification due to lacking input sanitization",
  "details" : "## Summary\n\nA vulnerability exists in the file update mechanism which allows an unauthenticated actor to modify existing files with arbitrary contents (without changes being applied to the files' database-resident metadata) and / or upload new files, with arbitrary content and extensions, which won't show up in the Directus UI.\n\n## Details\n\nDirectus exposes the CRUD operations for uploading or handling files under the `/files` route.\n\nThe endpoint handler is responsible for updating an existing file identified by the provided primary key specified through the `pk` parameter. Primary keys are UUID values such as `/files/927b3abf-fb4b-4c66-bdaa-eb7dc48a51cb`. Here the `filename_disk` value is never sanitized, it's possible to pass a path containing traversal sequences (`../`) through it, but a fully arbitrary file write is not possible in case the \"local\" storage handler is used. (Other storage implementations haven't been checked during the research process). The `packages/storage-driver-local/src/index.ts` file defines two relevant functions: `write` and `fullpath`.\n\nThe `write` method uses the `fullPath` method to create the absolute path for the to-be-created file. The `join` method is used to create the final path string. As the `fullPath` method uses `join` to create a relative path starting with the separator to be added under the download dir, this call normalizes the path and further upwards traversal is not possible during the write operation. With that being said, it is still possible, to make the system \"ignore\" the `temp_` prefix given to the file, resulting in an arbitrarily named file being placed in the upload folder.\n\nAs a summary for the vulnerability:\n\n- It is possible, to change the contents of an existing file, as an existing UUID can be specified as the file name\n        - The metadata won't change, so the mime type cannot be modified\n        - This also makes the changes happen \"silently\", without directus knowing about the changes\n- A new, previously non-existent file can be created with arbitrary contents\n        - The file won't show up in on the Directus UI, it can only be seen through other means (such as shell access)\n- An extension MUST be defined for the file to be modified\n        - This prevents us from uploading executables or malware with no extensions, but these wouldn't be executable either way\n\nRecommendations for fixing the vulnerability can be found in later chapters.\n\n## Requirements \n\nAs providing a primary key is required for successful exploitation, at least one asset with a known UUID must be available for an attacker. This can usually be achieved by browsing an application that uses the given Directus instance to provide images. \n\nNaturally, the instance needs to be accessible over the network used by the attacker as well.\n\nOnce network access and knowledge of at least one file UUID is available for the attacker, exploitation can be done by sending a single request.\n\n## Potential impacts\n\nThe impact of successful exploitation is highly dependent on how Directus is set up to be used by a different application. Many different configurations can be created, but the following are likely the most noteworthy:\n\n1. Setting up a phishing site\n\nSVGs can be used to set up very sophisticated looking pages, as it allows the embedding of HTML, CSS and scripts. The issue is once again with the `default-src: none` CSP settings. This setting prevents the use of CSS in the SVG file, so the created page will look strange.\n\nWhile the page obviously looks strange, it's important to notice that since the domain checks out, the browser could fill out the login forms, making for a much more convincing page as shown below:\n\nAn error message can be used to make it look like an error in the system!\n\n2. Server serves files directly from the upload directory:\n\nIn this setup, a server such ash nginx serves files in a static manner. The served files are loaded from a \"public\" folder made accessible through Directus as it's recommended in the files API docs. Quoting: \"make a public folder and allow access to this\", except the upload folder is directly served by the server:\n\nSince the files loaded by the server are sourced directly from the file storage, the arbitrary file write might allow an attacker to upload a webshell into the folder, giving it an arbitrary file extension. As the extension checks out as a valid PHP file for instance, and the contents are correct code, an attacker can achieve unauthenticated code execution on the server.\n\n3. Poisoning hosted files\n\nThe previous examples focused on active exploitation, but it's important to mention that the vulnerability allows for arbitrary changes in files. This can be used for many different attack primitives. Let's consider the following scenario: Directus is used not only to serve contents on a company's web page, but internally as well. Onboarding documents for new entries are hosted on the instance. Manuals with links to internal services are provided through PDF files. If the file can be accessed and modified by an attacker, it would be trivial to set up a spoofed instance which receives credentials for internal services but redirects to the original, internal service right after. \n\n## Credits\n\nThe bug was discovered by Zombor Máté, a security researcher at PCA Cyber Security (https://pcacybersecurity.com/)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "directus"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "10.8.0"
      }, {
        "fixed" : "11.9.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@directus/api"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "14.1.0"
      }, {
        "fixed" : "28.0.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/directus/directus/security/advisories/GHSA-mv33-9f6j-pfmc"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-55746"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/directus/directus/commit/d84dcc36f75fc5c858d43746b8f9c426c38d696b"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/directus/directus"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-73" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-08-20T19:08:20Z",
    "nvd_published_at" : "2025-08-20T18:15:35Z"
  }
}