CVE-2026-113662: ApostropheCMS import-export SQL Injection Vulnerability

MODERATE
Advisory Identifier: GHSA-jqw5-w6h3-44g6
CVSS 5.4
CWE-284 CWE-943
Published
Advisory Summary

CVE-2026-113662 is a MODERATE (CVSS 5.4) sql injection vulnerability (CWE-284: Improper Access Control) affecting ApostropheCMS import-export libraries in the npm ecosystem. The issue involves nosql injection via update-key value lets a crafted import match and overwrite an unidentified document. Remediation is available by upgrading affected packages to version 3.7.0.

CVE-2026-113662 at a Glance

CVE Identifier CVE-2026-113662
GHSA Identifier GHSA-jqw5-w6h3-44g6
Severity MODERATE
CVSS v3.1 Base Score 5.4
CWE Classification CWE-284: Improper Access Control
Affected Product ApostropheCMS import-export
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 5.4

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:N/I:L/A:L).

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 None (C:N)
Integrity Low (I:L)
Availability Low (A:L)

How to Fix CVE-2026-113662

To remediate this vulnerability, upgrade all affected ApostropheCMS import-export 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.7.0
npm install @apostrophecms/import-export@3.7.0
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-113662, inspect your project dependencies using npm:

npm ls @apostrophecms/import-export

Analyze the terminal output to locate any version of ApostropheCMS import-export in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.7.0), 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-284: Improper Access Control, where the product does not restrict or incorrectly restricts access to a resource from an unauthorized actor. In ApostropheCMS import-export, 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 `@apostrophecms/import-export`'s update-by-key feature lets an imported document carry a `<field>:key` property (for example `slug:key`) whose value is used to find an existing document to update instead of inserting a new one. `getUpdateKey()`/`insertOrUpdateDocWithKey()` (`lib/methods/import.js`) use that value directly as a MongoDB query value with no laundering: ```js const matchingDraftPromise = manager.findForEditing( req.clone({ mode: 'draft' }), { aposMode: 'draft', [updateField]: doc[updateKey] }).toObject(); ``` Archive documents are parsed with EJSON (see `lib/formats/gzip.js`), which revives objects such as `{ $ne: null }` as live values, the same untrusted data source and revival mechanism already fixed once in this module for `findSingletonAposDocId`/`findParkedAposDocId` in GHSA-79qf-vqgc-7xx3. That fix did not touch `insertOrUpdateDocWithKey`, so the identical class of bug survives here: a crafted `"slug:key": { "$ne": null }` entry in an archive's `aposDocs.json` makes the import match (and then update) an existing document the archive's author never actually identified, instead of failing to find a match. ## Impact Reaching this requires only an authenticated session with import access to the target type (the built-in contributor role holds this, matching the precondition of GHSA-79qf-vqgc-7xx3), and no admin interaction. Because the match uses a MongoDB operator instead of an exact value, it is not limited to a document the importer already knows the identifying field of: any existing document the importer has generic edit rights on and that satisfies the operator (which `{ $ne: null }` trivially does for any doc with a non-null value in that field) is a candidate, and Apostrophe's `findForEditing` permission filter, not the update-key logic, is the only thing narrowing which document actually gets matched and overwritten. Live-verified: a contributor-role request importing a document containing `"slug:key": { "$ne": null }` had its content applied to an existing, unrelated draft article, overwriting its title, while the importer never specified that article's real slug. ## Affected versions Confirmed on `main` branch HEAD as of 2026-09-04, `packages/import-export/lib/methods/import.js`. ## Suggested fix Launder `doc[updateKey]` to a plain string (mirroring the fix already applied to `type`/`aposLocale`/`parkedId` in GHSA-79qf-vqgc-7xx3) before using it as a query value, and fall back to the insert path when it is not a usable string.

CVE-2026-113662 Affected ApostropheCMS import-export Versions

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

References

Frequently Asked Questions

What is CVE-2026-113662?
CVE-2026-113662 is a security vulnerability in ApostropheCMS import-export involving NoSQL injection via update-key value lets a crafted import match and overwrite an unidentified document under CWE-284: Improper Access Control.
Which ApostropheCMS import-export versions are affected?
Affected versions include releases prior to 3.7.0 across affected packages: @apostrophecms/import-export.
What version fixes CVE-2026-113662?
Upgrading to 3.7.0 (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.7.0. Upgrade your dependency to 3.7.0 or later.
What is the CVSS score of CVE-2026-113662?
CVE-2026-113662 has a CVSS v3.1 base score of 5.4 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L.
What CWE is associated with CVE-2026-113662?
CVE-2026-113662 is classified under CWE-284: Improper Access Control (The product does not restrict or incorrectly restricts access to a resource from an unauthorized actor.).
How can I check npm dependencies for CVE-2026-113662?
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-jqw5-w6h3-44g6",
  "modified" : "2026-10-20T18:19:19Z",
  "published" : "2026-10-20T18:19:19Z",
  "aliases" : [ "CVE-2026-113662" ],
  "summary" : "ApostropheCMS import-export: NoSQL injection via update-key value lets a crafted import match and overwrite an unidentified document",
  "details" : "## Summary\n\n`@apostrophecms/import-export`'s update-by-key feature lets an imported\ndocument carry a `<field>:key` property (for example `slug:key`) whose\nvalue is used to find an existing document to update instead of inserting\na new one. `getUpdateKey()`/`insertOrUpdateDocWithKey()`\n(`lib/methods/import.js`) use that value directly as a MongoDB query value\nwith no laundering:\n\n```js\nconst matchingDraftPromise = manager.findForEditing(\n  req.clone({ mode: 'draft' }),\n  {\n    aposMode: 'draft',\n    [updateField]: doc[updateKey]\n  }).toObject();\n```\n\nArchive documents are parsed with EJSON (see `lib/formats/gzip.js`), which\nrevives objects such as `{ $ne: null }` as live values, the same untrusted\ndata source and revival mechanism already fixed once in this module for\n`findSingletonAposDocId`/`findParkedAposDocId` in GHSA-79qf-vqgc-7xx3. That\nfix did not touch `insertOrUpdateDocWithKey`, so the identical class of bug\nsurvives here: a crafted `\"slug:key\": { \"$ne\": null }` entry in an\narchive's `aposDocs.json` makes the import match (and then update) an\nexisting document the archive's author never actually identified, instead\nof failing to find a match.\n\n## Impact\n\nReaching this requires only an authenticated session with import access to\nthe target type (the built-in contributor role holds this, matching the\nprecondition of GHSA-79qf-vqgc-7xx3), and no admin interaction. Because the\nmatch uses a MongoDB operator instead of an exact value, it is not limited\nto a document the importer already knows the identifying field of: any\nexisting document the importer has generic edit rights on and that\nsatisfies the operator (which `{ $ne: null }` trivially does for any doc\nwith a non-null value in that field) is a candidate, and Apostrophe's\n`findForEditing` permission filter, not the update-key logic, is the only\nthing narrowing which document actually gets matched and overwritten.\n\nLive-verified: a contributor-role request importing a document containing\n`\"slug:key\": { \"$ne\": null }` had its content applied to an existing,\nunrelated draft article, overwriting its title, while the importer never\nspecified that article's real slug.\n\n## Affected versions\n\nConfirmed on `main` branch HEAD as of 2026-09-04,\n`packages/import-export/lib/methods/import.js`.\n\n## Suggested fix\n\nLaunder `doc[updateKey]` to a plain string (mirroring the fix already\napplied to `type`/`aposLocale`/`parkedId` in GHSA-79qf-vqgc-7xx3) before\nusing it as a query value, and fall back to the insert path when it is not\na usable string.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@apostrophecms/import-export"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.7.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/apostrophecms/apostrophe/security/advisories/GHSA-jqw5-w6h3-44g6"
  }, {
    "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/@apostrophecms/import-export@3.7.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-284", "CWE-943" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-10-20T18:19:19Z",
    "nvd_published_at" : null
  }
}