---
id: "CVE-2026-113658"
kind: "vulnerability"
aliases: ["CVE-2026-113658", "GHSA-qhcq-9pm2-c9w9"]
title: "ApostropheCMS: Unauthenticated CSV import requests leave rejected uploads in the system temporary directory"
severity: "high"
cvss: 7.5
epss: 0.005379999987781048
exploited: false
status: "open"
category: "package"
products: [{"name": "apostrophe", "fixed": ["4.33.0"], "affected": "< 4.33.0", "ecosystem": "npm"}]
ecosystems: ["npm"]
tags: ["apostrophe", "cwe-400", "cwe-459", "cwe-770", "node", "npm", "package", "self-hosted"]
not_affected_if: ["managed-hosting", "version-4.33.0-or-later"]
published_at: "2026-10-20T17:17:36+00:00"
first_seen_at: "2026-10-23T19:11:32+00:00"
updated_at: "2026-10-23T21:57:20+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-qhcq-9pm2-c9w9", "first_seen_at": "2026-10-23T19:11:32+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-113658", "first_seen_at": "2026-10-23T21:57:20+00:00"}]
---

# ApostropheCMS: Unauthenticated CSV import requests leave rejected uploads in the system temporary directory

ApostropheCMS leaves rejected CSV uploads in the OS temporary directory because the Multer temp file is not deleted when the extension check fails. An unauthenticated attacker can repeat large uploads to fill the temp partition, which can break Apostrophe and other services on the same host.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- npm:apostrophe affected < 4.33.0 fixed 4.33.0

## How to check

Look for apostrophe in package.json or package-lock.json and check the version is below 4.33.0.
After POST to /api/v1/@apostrophecms/rich-text-widget/generate-csv-table with a non-csv file, check whether new files remain in os.tmpdir() (e.g. ls -lt /tmp).

## Fix

Upgrade apostrophe to 4.33.0 or later.
Until then, unknown for a workaround in the sources.

## Timeline

- 2026-10-23T19:11:32+00:00 ghsa https://github.com/advisories/GHSA-qhcq-9pm2-c9w9
- 2026-10-23T21:57:20+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-113658

## From the sources

### Summary

A rejected upload can remain in the operating system temporary directory.

Multer 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.

### Details

The endpoint is:

```text
POST /api/v1/@apostrophecms/rich-text-widget/generate-csv-table
```

In `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.

The route does not require an authenticated user. A normal CSRF cookie is sufficient.

During 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.

### Relationship to prior public work

I 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.

### POC

Create a small test file. A larger file can be used to demonstrate disk growth, but 1 MiB is enough for a safe local reproduction:

```bash
dd if=/dev/zero of=rejected.txt bs=1M count=1
```

Obtain the normal site cookies and send the rejected upload:

```bash
curl -c cookies.txt 'http://127.0.0.1:3000/' > /dev/null

curl -i -b cookies.txt \
  -F 'file=@rejected.txt;filename=rejected.txt;type=text/plain' \
  'http://127.0.0.1:3000/api/v1/@apostrophecms/rich-text-widget/generate-csv-table'
```

The response is HTTP 400. Compare the contents of the system temporary directory before and after the request:

```bash
ls -lt /tmp
```

A new randomly named file remains present and contains the uploaded bytes.

No login is required. Repeating the multipart request creates additional persistent temporary files.

### Impact

A 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.

The attack requires only repeated HTTP requests and the stored files remain after each rejected response.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
