Submit #1077725: mage-ai Mage <= 0.9.80 Path Traversal (write only)info

Titlemage-ai Mage <= 0.9.80 Path Traversal (write only)
DescriptionA vulnerability was found in Mage-AI (project repository: https://github.com/mage-ai/mage-ai, PyPI package mage-ai), affecting version 0.9.80 and versions up to the current repository HEAD (9c633199 at the time of testing). This issue has been classified as CWE-22: Improper Limitation of a Pathname to a Restricted Directory ("Path Traversal"). The POST /api/projects endpoint joins two attacker-controlled JSON fields (uuid, repo_path) into a filesystem path without any validation or traversal filtering, then creates a full project directory tree there (ProjectResource.create, api/resources/ProjectResource.py:117-133; path base from settings/utils.py:6). This allows arbitrary directory creation - and, when the dbt CLI is installed, an attacker-named profiles.yml file write - at any path the server process can access, outside the project root. With REQUIRE_USER_AUTHENTICATION=False (a supported, documented setting), the endpoint is reachable with no credentials at all. This is a write-only primitive: it does not read or return file contents. With authentication enabled, create is restricted by policy scope (verified: editor-scope tokens receive 403), so the unauthenticated case is the primary impact. The codebase already contains the correct containment helper - ensure_file_is_in_project() (data_preparation/models/file.py:513) performs a commonpath check and is applied to the file-content read endpoint - but the project-create path simply never calls it. Proof of concept (server running via "mage start <project>", default port 6789): curl -s -X POST "http://127.0.0.1:6789/api/projects" -H 'Content-Type: application/json' -d '{"project":{"uuid":"../../../../tmp/poc/hostkeep","repo_path":"..","type":"standalone"}}' A full mage project template (about 36 files / 25 directories) is created at /tmp/poc/hostkeep. curl -s -X POST "http://127.0.0.1:6789/api/projects" -H 'Content-Type: application/json' -d '{"project":{"uuid":"pocfile_host","repo_path":"../../../../../tmp/poc","type":"dbt"}}' The file /tmp/poc/pocfile_host/profiles.yml is created (requires dbt on PATH). Both requests return HTTP 200 with no credentials; the number of ../ segments depends on the project root's depth. Implementation notes for triage: the request body must be wrapped in {"project": {...}} - the API reads body["project"] (api/operations/base.py:831); a flat body is silently ignored (HTTP 200, no action). Sending an existing absolute path (e.g. uuid: "../../../../etc/passwd") returns a 500 whose error message leaks the fully resolved traversal path ("Repository /tmp/proj/../../../../../etc/passwd already exists"), confirming the path resolves to arbitrary absolute locations. Impact: arbitrary directory-tree creation anywhere the server user can write (cron directories, ~/.ssh/, web roots, container images), and an attacker-named profiles.yml file write with fixed content. This enables persistence/backdoor potential by planting config or code files that other tooling executes or loads. Write-only: no file read (the file-content endpoint is properly guarded), and no content injection was observed. Reachability: unauthenticated when REQUIRE_USER_AUTHENTICATION=False (documented configuration). CVSS 3.1 Score: 7.5 (AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H) for the authenticated-restricted case; up to 9.1+ when authentication is disabled. The vendor was contacted beforehand under responsible disclosure via email (no SECURITY.md is published on the repository). No CVE has been assigned and no patch is available as of the time of this submission. The vulnerability was discovered by the independent security researcher Ayoub Safa (sandh0t). Full technical write-up with proof of concept: https://gist.github.com/sandh0t/22b60bcc673398e7d862aa8d2938e16e
Source⚠️ https://gist.github.com/sandh0t/22b60bcc673398e7d862aa8d2938e16e
User
 sandh0t (UID 101360)
Submission11/06/2026 12:17 (27 days ago)
Moderation12/03/2026 00:23 (27 days later)
StatusAccepted
VulDB entry448225 [mage-ai Mage AI up to 0.9.81 Project Creation API ProjectResource.py create repo_path path traversal]
Points20

Do you want to use VulDB in your project?

Use the official API to access entries easily!