{"schema_version":"1.9.0","id":"GHSA-86wm-68pq-5jwq","published":"2026-10-21T13:51:21Z","modified":"2026-10-21T14:00:27.319644917Z","aliases":["CVE-2026-113711"],"summary":"ApostropheCMS: Unauthenticated resource exhaustion via pre-auth aposBigUpload processing in @apostrophecms/import-export","details":"## Summary\n\nA potential unauthenticated denial-of-service vulnerability exists in the chunked import upload path used by `@apostrophecms/import-export`.\n\nThe affected import API routes invoke:\n\n`self.apos.http.bigUploadMiddleware()`\n\nbefore the actual import handler performs its authentication check.\n\nBecause no `authorize` callback is supplied to `bigUploadMiddleware()`, unauthenticated requests can reach the `aposBigUpload` `start`, `chunk`, and `end` operations before the later `req.user` check rejects the import.\n\nAs a result, an unauthenticated remote attacker can create server-side upload state, write chunk data to upload storage, trigger temporary-file processing, and cause attacker-controlled cleanup operations before authentication is enforced.\n\n## Affected Component\n\nPackage:\n\n`@apostrophecms/import-export`\n\nConfirmed affected version:\n\n`3.6.2`\n\nPotential earlier affected versions:\n\nThe issue may affect earlier 3.x releases in which the current big-upload-based import implementation is present. I have not yet fully verified the exact introduction version and recommend that the maintainers confirm the affected version range.\n\n## Vulnerability Type\n\nPrimary:\n\n**CWE-400 — Uncontrolled Resource Consumption**\n\nRelated:\n\n**CWE-306 — Missing Authentication for Critical Function**\n\n**CWE-770 — Allocation of Resources Without Limits or Throttling**\n\n## Technical Details\n\nThe page import route registers the following middleware chain:\n\n`packages/import-export/modules/@apostrophecms/import-export-page/index.js`\n\n```javascript\nimportExportImport: [\n  self.apos.http.bigUploadMiddleware(),\n  async (req) => {\n    return self.apos.modules['@apostrophecms/import-export']\n      .import(req, self.__meta.name);\n  }\n]\n```\n\nNo `authorize` callback is passed to `bigUploadMiddleware()`.\n\nThe `bigUploadMiddleware()` implementation explicitly supports an `authorize` callback and performs that authorization before processing the `aposBigUpload` protocol when supplied.\n\nWithout that callback, requests containing:\n\n`aposBigUpload[type]=start`\n\n`aposBigUpload[type]=chunk`\n\nor\n\n`aposBigUpload[type]=end`\n\nare processed immediately.\n\nThe actual authentication check occurs later in:\n\n`packages/import-export/lib/methods/import.js`\n\n```javascript\nasync import(req, moduleName) {\n  if (!req.user) {\n    throw self.apos.error('forbidden');\n  }\n```\n\nThis means authentication occurs only after the chunked-upload middleware has already performed server-side work.\n\n## Attack Flow\n\n### 1. Start\n\nAn unauthenticated attacker submits an `aposBigUpload[type]=start` request.\n\nThe server generates an upload ID and stores attacker-supplied upload metadata, including the declared `chunks` count.\n\n### 2. Chunk\n\nThe attacker can upload chunk data.\n\n`bigUploadChunk()` copies attacker-controlled data into:\n\n`/big-uploads/<id>-<n>-<chunk>`\n\n### 3. End\n\nThe attacker sends an `aposBigUpload[type]=end` request.\n\n`bigUploadEnd()` begins processing the upload and creates temporary files before invoking the downstream import handler.\n\nOnly after this processing completes does execution reach the later authentication check in `import()`.\n\n### 4. Cleanup amplification\n\nThe attacker-controlled `chunks` value is also used by `bigUploadCleanupOne()`:\n\n```javascript\nfor (const { chunks } of Object.values(bigUpload.files)) {\n  for (let i = 0; (i < chunks); i++) {\n    await ufs.remove(...);\n  }\n}\n```\n\nNo small upper bound on the declared chunk count appears to be enforced at upload initialization.\n\nThis allows an unauthenticated attacker to increase the number of filesystem cleanup operations performed for an upload.\n\n## Proof of Concept\n\nThe following reproduction was performed only against an isolated test environment.\n\n### Start an upload without authentication\n\n```bash\ncurl -s -X POST \\\n  'http://localhost:3000/api/v1/@apostrophecms/page/importExportImport?aposBigUpload[type]=start' \\\n  -H 'Content-Type: application/json' \\\n  --data '{\"files\":{\"file\":{\"name\":\"evil.tar.gz\",\"size\":4,\"type\":\"application/gzip\",\"chunks\":1}}}'\n```\n\nThe server returns an upload ID despite the request having no authenticated session.\n\n### Upload a chunk\n\n```bash\nprintf 'PWN!' >/tmp/chunk.bin\n\ncurl -s -X POST \\\n  'http://localhost:3000/api/v1/@apostrophecms/page/importExportImport?aposBigUpload[type]=chunk&aposBigUpload[id]=<ID>&aposBigUpload[n]=0&aposBigUpload[chunk]=0' \\\n  -F 'chunk=@/tmp/chunk.bin;type=application/octet-stream'\n```\n\nThe request succeeds and causes server-side upload storage to be used.\n\n### Finalize the upload\n\n```bash\ncurl -i -X POST \\\n  'http://localhost:3000/api/v1/@apostrophecms/page/importExportImport?aposBigUpload[type]=end&aposBigUpload[id]=<ID>'\n```\n\nObserved behavior:\n\n* `start` returns HTTP 200 and an upload ID without authentication.\n* `chunk` returns HTTP 200 and results in server-side chunk storage.\n* `end` eventually reaches the downstream authentication check and is rejected.\n* However, the server-side big-upload processing has already occurred before that authentication rejection.\n\nIn my isolated harness:\n\n* `chunks=1` resulted in one cleanup removal attempt.\n* `chunks=50` resulted in 50 cleanup removal attempts.\n\nThis demonstrates that the attacker-controlled chunk count directly influences server-side cleanup work.\n\n## Security Impact\n\nThe vulnerability allows an unauthenticated remote attacker to cause server-side storage and filesystem operations that should only be reachable by authorized import users.\n\nPossible consequences include:\n\n* Consumption of upload and temporary storage.\n* Creation of server-side upload state by unauthenticated users.\n* Repeated filesystem I/O.\n* Cleanup amplification based on attacker-controlled chunk counts.\n* Potential service degradation or denial of service when the attack is repeated or sufficiently amplified.\n\n## Root Cause\n\nAuthentication is enforced in the downstream import handler rather than before the chunked-upload middleware.\n\nThe middleware itself already supports an `authorize` callback specifically for preventing unauthorized use of the big-upload functionality.\n\n## Suggested Remediation\n\nRequire authentication before any `aposBigUpload` operation is processed.\n\nFor example:\n\n* Pass an appropriate `authorize` callback to `bigUploadMiddleware()` on all import routes.\n* Reject unauthenticated users before `start`, `chunk`, or `end`.\n* Enforce reasonable limits on declared chunk counts.\n* Validate declared size against actual uploaded data.\n* Introduce per-user and global storage/rate limits.\n* Ensure temporary files are removed when downstream processing fails.\n* Add regression tests confirming that anonymous `start`, `chunk`, and `end` requests are rejected before upload state or files are created.\n\nRelevant reviewed commit:\n\n`d3ff8c9bb001be1acf7fdc3f035190250ac64b45`\n\n## Researcher Credit\n\n**Kai Zhi**\n\nGitHub:\n\n**https://github.com/kaizhi888**","affected":[{"package":{"name":"apostrophe","ecosystem":"npm","purl":"pkg:npm/apostrophe"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"4.33.0"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-86wm-68pq-5jwq/GHSA-86wm-68pq-5jwq.json"}},{"package":{"name":"@apostrophecms/import-export","ecosystem":"npm","purl":"pkg:npm/%40apostrophecms/import-export"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"3.7.0"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-86wm-68pq-5jwq/GHSA-86wm-68pq-5jwq.json"}}],"references":[{"type":"WEB","url":"https://github.com/apostrophecms/apostrophe/security/advisories/GHSA-86wm-68pq-5jwq"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-113711"},{"type":"WEB","url":"https://github.com/apostrophecms/apostrophe/commit/9500b8b0e1d630d5e07fbb5fd2c25ed0943845ce"},{"type":"WEB","url":"https://github.com/apostrophecms/apostrophe/commit/f84fd41cbf6c22eb8d0008fc9c25df1f7130b350"},{"type":"PACKAGE","url":"https://github.com/apostrophecms/apostrophe"},{"type":"WEB","url":"https://github.com/apostrophecms/apostrophe/releases/tag/apostrophe@4.33.0"}],"database_specific":{"cwe_ids":["CWE-400","CWE-770"],"github_reviewed":true,"github_reviewed_at":"2026-10-21T13:51:21Z","nvd_published_at":"2026-10-20T18:17:21Z","severity":"HIGH"},"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"}]}