Vulnerabilities in pkg:npm/@apostrophecms/import-export

PACKAGE
Advisory Identifier: GHSA-79qf-vqgc-7xx3
Advisory Summary

CVE-2026-63667 is a MODERATE (CVSS 6.5) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting ApostropheCMS libraries in the npm ecosystem. The issue involves arbitrary file read via import-export attachment-name path traversal. Remediation is available by upgrading affected packages to version 3.6.2.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/@apostrophecms/import-export

2 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/@apostrophecms/import-export. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-79qf-vqgc-7xx3 CVE-2026-63667 MODERATE ApostropheCMS: Arbitrary file read via import-export attachment-name path traversal
GHSA-mwxc-m426-3f78 CVE-2026-32731 CRITICAL ApostropheCMS has Arbitrary File Write (Zip Slip / Path Traversal) in Import-Export Gzip Extraction

CVE-2026-63667 at a Glance

CVE Identifier CVE-2026-63667
GHSA Identifier GHSA-79qf-vqgc-7xx3
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product ApostropheCMS
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 6.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2026-63667

To remediate this vulnerability, upgrade all affected ApostropheCMS dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@apostrophecms/import-export fixed: 3.6.2
npm install @apostrophecms/import-export@3.6.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @apostrophecms/import-export

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-63667, inspect your project dependencies using npm:

npm ls @apostrophecms/import-export

Analyze the terminal output to locate any version of ApostropheCMS in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.6.2), your application is affected.

Note: The npm ls @apostrophecms/import-export command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In ApostropheCMS, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary The `@apostrophecms/import-export` module reconstructs the on-disk source path of every imported attachment from JSON metadata contained in the uploaded archive. The archive carries an `aposAttachments.json` file whose `name` and `extension` fields are concatenated into a filesystem path with no traversal check. The zip-slip guard that the module applies during tar extraction validates tar entry names only and does not cover this second path, which is built after extraction. The file at the resulting path is read and copied into the public uploads directory, then served over HTTP without authentication. A `../` sequence in `name` makes the module read a file outside the extraction directory and publish it at an anonymous URL. Result: an authenticated contributor reads any file on the host whose name ends in an allowlisted extension (other users' uploaded documents, text or CSV dumps, PDFs) by importing a crafted archive and fetching the planted attachment anonymously. ## Affected apostrophecms/apostrophe with the `@apostrophecms/import-export` module installed and registered. Module version 3.6.1 (current latest), tested against Apostrophe 4.31.0 (monorepo HEAD 4d478d9). Requires an account with the contributor role or higher; guest and anonymous requests are rejected. The module is not part of the default starter kit, so sites that never installed it are not affected. Files whose real name lacks an accepted file-group extension are not reachable. ## Root cause The import parser builds each attachment's source path by concatenating attacker-controlled JSON fields: `lib/formats/gzip.js:46` sets `file.path = path.join(attachmentFilesPath, ${attachment._id}-${attachment.name}.${attachment.extension})` from the `aposAttachments.json` entries in the uploaded archive. That path flows unchanged through `lib/methods/import.js:832` (`insertAttachments`) into `lib/methods/import.js:1074` (`attachment.insert`), where uploadfs copies the referenced file into the public uploads directory served by `express.static`. The archive's only traversal guard, `lib/formats/gzip.js:143` (`if (name.includes('../'))`), validates tar entry names during extraction and never inspects the `name`/`extension` values used to construct the read path, so a `name` of `../../../../../../tmp/secret` escapes `attachmentFilesPath`. Reaching the sink requires only an authenticated session (`lib/methods/import.js:71`), view permission on the target type (`lib/methods/index.js:54`), and the `upload-attachment` permission enforced at `modules/@apostrophecms/attachment/index.js:442`, which the built-in contributor role holds. The trailing `.${extension}` is appended and checked against the file-group allowlist in `modules/@apostrophecms/attachment/index.js` (`getFileGroup`), so the target file's real name must end in an accepted extension (txt, csv, pdf, xls, doc, svg, and similar). ## Reproduction Apostrophe 4.31.0 starter-kit-essentials, MongoDB, default roles, `@apostrophecms/import-export` 3.6.1 installed, local uploadfs backend. 1. Place a secret file outside the upload tree with an allowlisted extension. ``` $ cat /tmp/apos_victim_secret.txt TOP-SECRET DB DUMP DB_PASSWORD=Pr0d-Secret-9981 API_KEY=sk_live_victim_abcdef ``` 2. Build a gzip archive whose `aposAttachments.json` points the attachment `name` at that file through traversal (`aposDocs.json` is `[]`). ``` [{"_id":"evilatt0001","name":"../../../../../../../../../../../../tmp/apos_victim_secret","extension":"txt","title":"loot","docIds":[],"crops":[]}] ``` 3. As a contributor, import the archive through the module's import action (`POST /api/v1/@apostrophecms/<type>/import-export-import`), then fetch the created attachment with no session. ``` $ curl -i http://localhost:3500/uploads/attachments/evilatt0001-apos-victim-secret.txt HTTP/1.1 200 OK Content-Type: text/plain; charset=UTF-8 TOP-SECRET DB DUMP DB_PASSWORD=Pr0d-Secret-9981 API_KEY=sk_live_victim_abcdef ``` Live-verified: a contributor-driven import reads `/tmp/apos_victim_secret.txt` (outside the extraction directory) and serves it at an anonymous URL; the same import run as a guest is rejected at the `upload-attachment` check (`modules/@apostrophecms/attachment/index.js:442`). ## Impact - Read of arbitrary host files whose real name ends in an allowlisted extension (txt, csv, pdf, xls, doc, svg, and similar). - Disclosure of other users' uploaded documents and any allowlisted-extension file readable by the Node process. - The exfiltration target is copied to a public, unauthenticated URL. - Triggered by the contributor role in a single import, no admin interaction. ## Credit Jan Kahmen, [turingpoint](https://www.turingpoint.de) (jan@turingpoint.de)

CVE-2026-63667 Affected ApostropheCMS Versions

1 component(s)
Fixed Versions:
3.6.2
Product / Package Ecosystem Affected Versions Fixed Version
@apostrophecms/import-export
npm
< 3.6.2
3.6.2

References

Frequently Asked Questions

What is CVE-2026-63667?
CVE-2026-63667 is a security vulnerability in ApostropheCMS involving Arbitrary file read via import-export attachment-name path traversal under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which ApostropheCMS versions are affected?
Affected versions include releases prior to 3.6.2 across affected packages: @apostrophecms/import-export.
What version fixes CVE-2026-63667?
Upgrading to 3.6.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @apostrophecms/import-export affected?
Yes, @apostrophecms/import-export is affected in releases prior to 3.6.2. Upgrade your dependency to 3.6.2 or later.
What is the CVSS score of CVE-2026-63667?
CVE-2026-63667 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2026-63667?
CVE-2026-63667 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check npm dependencies for CVE-2026-63667?
Run the dependency tree command: 'npm ls @apostrophecms/import-export'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-79qf-vqgc-7xx3",
  "modified" : "2026-09-02T14:55:47Z",
  "published" : "2026-09-02T14:55:47Z",
  "aliases" : [ "CVE-2026-63667" ],
  "summary" : "ApostropheCMS: Arbitrary file read via import-export attachment-name path traversal",
  "details" : "## Summary\n\nThe `@apostrophecms/import-export` module reconstructs the on-disk source path of every imported attachment from JSON metadata contained in the uploaded archive.\n\nThe archive carries an `aposAttachments.json` file whose `name` and `extension` fields are concatenated into a filesystem path with no traversal check. The zip-slip guard that the module applies during tar extraction validates tar entry names only and does not cover this second path, which is built after extraction.\n\nThe file at the resulting path is read and copied into the public uploads directory, then served over HTTP without authentication. A `../` sequence in `name` makes the module read a file outside the extraction directory and publish it at an anonymous URL.\n\nResult: an authenticated contributor reads any file on the host whose name ends in an allowlisted extension (other users' uploaded documents, text or CSV dumps, PDFs) by importing a crafted archive and fetching the planted attachment anonymously.\n\n## Affected\n\napostrophecms/apostrophe with the `@apostrophecms/import-export` module installed and registered. Module version 3.6.1 (current latest), tested against Apostrophe 4.31.0 (monorepo HEAD 4d478d9). Requires an account with the contributor role or higher; guest and anonymous requests are rejected. The module is not part of the default starter kit, so sites that never installed it are not affected. Files whose real name lacks an accepted file-group extension are not reachable.\n\n## Root cause\n\nThe import parser builds each attachment's source path by concatenating attacker-controlled JSON fields: `lib/formats/gzip.js:46` sets `file.path = path.join(attachmentFilesPath, ${attachment._id}-${attachment.name}.${attachment.extension})` from the `aposAttachments.json` entries in the uploaded archive. That path flows unchanged through `lib/methods/import.js:832` (`insertAttachments`) into `lib/methods/import.js:1074` (`attachment.insert`), where uploadfs copies the referenced file into the public uploads directory served by `express.static`. The archive's only traversal guard, `lib/formats/gzip.js:143` (`if (name.includes('../'))`), validates tar entry names during extraction and never inspects the `name`/`extension` values used to construct the read path, so a `name` of `../../../../../../tmp/secret` escapes `attachmentFilesPath`. Reaching the sink requires only an authenticated session (`lib/methods/import.js:71`), view permission on the target type (`lib/methods/index.js:54`), and the `upload-attachment` permission enforced at `modules/@apostrophecms/attachment/index.js:442`, which the built-in contributor role holds. The trailing `.${extension}` is appended and checked against the file-group allowlist in `modules/@apostrophecms/attachment/index.js` (`getFileGroup`), so the target file's real name must end in an accepted extension (txt, csv, pdf, xls, doc, svg, and similar).\n\n## Reproduction\n\nApostrophe 4.31.0 starter-kit-essentials, MongoDB, default roles, `@apostrophecms/import-export` 3.6.1 installed, local uploadfs backend.\n\n1. Place a secret file outside the upload tree with an allowlisted extension.\n\n```\n$ cat /tmp/apos_victim_secret.txt\nTOP-SECRET DB DUMP\nDB_PASSWORD=Pr0d-Secret-9981\nAPI_KEY=sk_live_victim_abcdef\n```\n\n2. Build a gzip archive whose `aposAttachments.json` points the attachment `name` at that file through traversal (`aposDocs.json` is `[]`).\n\n```\n[{\"_id\":\"evilatt0001\",\"name\":\"../../../../../../../../../../../../tmp/apos_victim_secret\",\"extension\":\"txt\",\"title\":\"loot\",\"docIds\":[],\"crops\":[]}]\n```\n\n3. As a contributor, import the archive through the module's import action (`POST /api/v1/@apostrophecms/<type>/import-export-import`), then fetch the created attachment with no session.\n\n```\n$ curl -i http://localhost:3500/uploads/attachments/evilatt0001-apos-victim-secret.txt\nHTTP/1.1 200 OK\nContent-Type: text/plain; charset=UTF-8\n\nTOP-SECRET DB DUMP\nDB_PASSWORD=Pr0d-Secret-9981\nAPI_KEY=sk_live_victim_abcdef\n```\n\nLive-verified: a contributor-driven import reads `/tmp/apos_victim_secret.txt` (outside the extraction directory) and serves it at an anonymous URL; the same import run as a guest is rejected at the `upload-attachment` check (`modules/@apostrophecms/attachment/index.js:442`).\n\n## Impact\n\n- Read of arbitrary host files whose real name ends in an allowlisted extension (txt, csv, pdf, xls, doc, svg, and similar).\n- Disclosure of other users' uploaded documents and any allowlisted-extension file readable by the Node process.\n- The exfiltration target is copied to a public, unauthenticated URL.\n- Triggered by the contributor role in a single import, no admin interaction.\n\n## Credit\n\nJan Kahmen, [turingpoint](https://www.turingpoint.de) (jan@turingpoint.de)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@apostrophecms/import-export"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.6.2"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 3.6.1"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/apostrophecms/apostrophe/security/advisories/GHSA-79qf-vqgc-7xx3"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-63667"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apostrophecms/apostrophe/commit/87cccf44a23d09420875ca8a3765eb3db843836a"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/apostrophecms/apostrophe"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-02T14:55:47Z",
    "nvd_published_at" : "2026-08-17T20:16:44Z"
  }
}