{"id":"CVE-2026-113658","aliases":["GHSA-qhcq-9pm2-c9w9"],"title":"ApostropheCMS: Unauthenticated CSV import requests leave rejected uploads in the system temporary directory","summary":"ApostropheCMS: Unauthenticated CSV import requests leave rejected uploads in the system temporary directory","severity":"high","cvss":7.5,"cwe":["CWE-400","CWE-459","CWE-770"],"vendor":"apostrophe","product":"apostrophe","ecosystem":"npm","affected":["apostrophe < 4.33.0"],"patched":["apostrophe 4.33.0"],"published":"2026-10-20","updated":"2026-10-20","sourceUpdated":"2026-10-20T18:10:32Z","source":"GHSA","sourceUrl":"https://github.com/advisories/GHSA-qhcq-9pm2-c9w9","references":[{"url":"https://github.com/apostrophecms/apostrophe/security/advisories/GHSA-qhcq-9pm2-c9w9"},{"url":"https://github.com/apostrophecms/apostrophe/commit/9500b8b0e1d630d5e07fbb5fd2c25ed0943845ce"},{"url":"https://github.com/apostrophecms/apostrophe/commit/f84fd41cbf6c22eb8d0008fc9c25df1f7130b350"},{"url":"https://github.com/apostrophecms/apostrophe/releases/tag/apostrophe@4.33.0"},{"url":"https://github.com/advisories/GHSA-qhcq-9pm2-c9w9"}],"tags":["ghsa","npm","cve.org"],"ingestedAt":"2026-10-20T17:12:53.594Z","slug":"CVE-2026-113658","body":"## Overview\n\n### Summary\n\nA rejected upload can remain in the operating system temporary directory.\n\nMulter writes the file before its extension is checked, and the rejection path does not remove that temporary file. An unauthenticated requester can repeat this with large files and steadily consume temporary disk space.\n\n### Details\n\nThe endpoint is:\n\n```text\nPOST /api/v1/@apostrophecms/rich-text-widget/generate-csv-table\n```\n\nIn `packages/apostrophe/modules/@apostrophecms/rich-text-widget/lib/apiRoutes.js`, Multer first writes the upload to `os.tmpdir()`. The handler then rejects filenames whose extension is not `csv`, but there is no cleanup of the Multer file on this error path.\n\nThe route does not require an authenticated user. A normal CSRF cookie is sufficient.\n\nDuring testing, the request returned HTTP 400 with `Only csv files are supported`, while the complete uploaded content remained in a randomly named file in the configured temporary directory after the response.\n\n### Relationship to prior public work\n\nI reviewed [PR #5013](https://github.com/apostrophecms/apostrophe/pull/5013), which migrated the Rich Text CSV upload path from `connect-multiparty` to Multer. This report concerns cleanup after that migration: the rejected Multer file remains on disk, a behavior not described in the PR or its review discussion.\n\n### POC\n\nCreate a small test file. A larger file can be used to demonstrate disk growth, but 1 MiB is enough for a safe local reproduction:\n\n```bash\ndd if=/dev/zero of=rejected.txt bs=1M count=1\n```\n\nObtain the normal site cookies and send the rejected upload:\n\n```bash\ncurl -c cookies.txt 'http://127.0.0.1:3000/' > /dev/null\n\ncurl -i -b cookies.txt \\\n  -F 'file=@rejected.txt;filename=rejected.txt;type=text/plain' \\\n  'http://127.0.0.1:3000/api/v1/@apostrophecms/rich-text-widget/generate-csv-table'\n```\n\nThe response is HTTP 400. Compare the contents of the system temporary directory before and after the request:\n\n```bash\nls -lt /tmp\n```\n\nA new randomly named file remains present and contains the uploaded bytes.\n\nNo login is required. Repeating the multipart request creates additional persistent temporary files.\n\n### Impact\n\nA remote unauthenticated attacker can fill the partition used by the operating system temporary directory. Once that partition is exhausted, Apostrophe and unrelated services on the same host may fail to upload files, create temporary data, or continue operating normally.\n\nThe attack requires only repeated HTTP requests and the stored files remain after each rejected response.\n\n## Affected packages\n\n- `apostrophe < 4.33.0`\n\n## Remediation\n\nUpgrade to a patched release:\n\n- `apostrophe 4.33.0`","depth":"twilight","depthScore":41,"depthScoreParts":{"impact":41.3,"likelihood":0,"exploitation":0,"ransomware":0},"changes":[]}