---
id: "CVE-2026-113655"
kind: "vulnerability"
aliases: ["CVE-2026-113655", "GHSA-2jrp-qc93-h2j8"]
title: "ApostropheCMS: Same-parent page reorder in @apostrophecms/page move() re-ranks a restricted parent's children without create authorization"
severity: "medium"
cvss: 4.300000190734863
epss: 0.003229999914765358
exploited: false
status: "open"
category: "package"
products: [{"name": "apostrophe", "fixed": ["4.33.0"], "affected": "< 4.33.0", "ecosystem": "npm"}]
ecosystems: ["npm"]
tags: ["apostrophe", "cwe-639", "cwe-862", "node.js", "package", "self-hosted"]
not_affected_if: ["default-config", "no-restricted-editrole-page-types"]
published_at: "2026-10-20T17:17:36+00:00"
first_seen_at: "2026-10-23T19:11:32+00:00"
updated_at: "2026-10-23T21:57:20+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-2jrp-qc93-h2j8", "first_seen_at": "2026-10-23T19:11:32+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-113655", "first_seen_at": "2026-10-23T21:57:20+00:00"}]
---

# ApostropheCMS: Same-parent page reorder in @apostrophecms/page move() re-ranks a restricted parent's children without create authorization

ApostropheCMS's page move() skips its destination create-permission check when a page is reordered among siblings under the same parent, so an authenticated editor can re-rank the sibling pages of a restricted parent. The attacker gains integrity over sibling ordering (rank) of pages they cannot edit, not disclosure of their contents.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- npm:apostrophe affected < 4.33.0 fixed 4.33.0

## How to check

Check the installed version: npm ls apostrophe
Affected if the version is below 4.33.0 (per sources: affected < 4.33.0).
The exposure also requires an editor-editable page nested under a page type with a restricting editRole, which the sources describe as a non-default tree state.

## Fix

Upgrade apostrophe to 4.33.0 or later (the sources list 4.33.0 as the fixed version).
Note: the description says no release addresses the same-parent path as of 4.32.2, which conflicts with the fixed-version field; verify before relying on the upgrade.

## Timeline

- 2026-10-23T19:11:32+00:00 ghsa https://github.com/advisories/GHSA-2jrp-qc93-h2j8
- 2026-10-23T21:57:20+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-113655

## From the sources

## Summary

ApostropheCMS enforces per-type authorization on pages: a page type may declare `editRole` / `publishRole` (the core `@apostrophecms/archive-page` does), so a project can define restricted subtrees that only higher-privileged roles may create or edit within. The `move()` operation in the `@apostrophecms/page` module is supposed to enforce that a page may only be moved into a parent the actor has `create` rights over, the same boundary the page-insert route enforces. The destination-parent authorization check in `move()` is gated on the move being a cross-parent move (`oldParent._id !== parent._id`). A same-parent reorder (repositioning a page among its existing siblings under the same parent) short-circuits that check entirely, so an authenticated low-privileged editor who holds edit rights on one ordinary page nested under a restricted parent can reposition it and, in doing so, trigger an unguarded bulk database write that re-ranks the restricted parent's other children, documents the editor has no authorization to modify.

## Root Cause

The security invariant is that mutating the sibling ordering of a restricted parent's children requires `create` authority on that parent, which is exactly what the page-insert path enforces (`insert()` throws `forbidden` when `!parent._create` before it nudges peers). The destination authorization guard in `move()` restores this boundary only for cross-parent moves: its leading conjunct is `(oldParent._id !== parent._id)`. For a same-parent reorder both `oldParent` and `parent` are the identical restricted parent, so the conjunct is `false`, the whole conditional short-circuits, and the `parent._create` requirement is never evaluated. The only surviving gate on the path is `moved._edit`, which the editor legitimately holds for the ordinary page being moved. The subsequent sibling re-rank is issued as a raw MongoDB `updateMany` that never passes through the per-document `beforeUpdate` edit check, so the restricted siblings are modified with no authorization at all.

```text
Affected function: @apostrophecms/page move() (inner body)
  packages/apostrophe/modules/@apostrophecms/page/index.js:1684-1691
    if (
      (oldParent._id !== parent._id) &&               // false for a same-parent reorder -> whole check skipped
      (parent.type !== '@apostrophecms/archive-page') &&
      (!parent._create) &&
      !(oldParent.type === '@apostrophecms/archive-page' && parent._edit)
    ) {
      throw self.apos.error('forbidden');
    }

Unguarded sink: nudgeNewPeers()
  packages/apostrophe/modules/@apostrophecms/page/index.js:1781-1803
    await self.apos.doc.db.updateMany(
      { path: matchDescendants(parent), level: parent.level + 1,
        aposLocale: { $in: [ draft, published ] }, rank: { $gte: rank } },
      { $inc: { rank: 1 } });   // no permission clause; bypasses beforeUpdate

Contrasting correct boundary: insert()
  packages/apostrophe/modules/@apostrophecms/page/index.js:1436-1439
    if (!parent._create) { throw self.apos.error('forbidden'); }  // enforced for every position
```

## Impact

The attacker is an authenticated low-privileged user, an editor (or a contributor operating in draft mode), who holds edit rights on at least one ordinary page that is nested as a direct child of a restricted-type parent. No admin rights and no special tokens are required. Authorization in this CMS is resolved per page type, not per subtree: a page's editability is judged by its own type's `editRole`, so an ordinary `public-page` child can be editable by an editor even though its restricted `secret-page`-type parent (declaring `editRole: admin`) is not. Exploiting the gap, the editor can persistently alter the `rank` (sibling ordering, which drives navigation and menu order) of the restricted parent's other children, documents on which the editor holds no edit, create, publish, or delete authority. Repeating the reposition monotonically inflates those siblings' ranks. This is an integrity and authorization-boundary violation (CWE-862 / CWE-639) confined to sibling ordering; it does not disclose restricted field contents (confidentiality is unaffected) and it does not affect availability. The precondition (an editor-editable page already nested under a restricted parent) is a non-default tree state that an administrator establishes, or that arises from configuration drift when a page type gains a restricting `editRole` after editable children were already placed beneath it.

## Proof of Concept

`Dependencies: Node.js and a local MongoDB instance. The reproduction uses ApostropheCMS's own test harness to drive the real apos.page.move() code path with a non-admin editor request. No fresh end-to-end run was performed in the review environment (no MongoDB available); the chain was verified against source, and the sink behavior is independently corroborated by the CVE-2026-63669 advisory's own description and its cross-parent-only regression test.`

1. Configure a restricted page type `secret-page` with `editRole: 'admin'` and `publishRole: 'admin'`, and an ordinary type `public-page` with no role restriction.
2. As an admin, create a `secret-page` section under home, then create two `secret-page` children beneath it (the pre-existing restricted siblings), and place one editor-editable `public-page` as a further child of the secret section (the non-default nesting precondition).
3. As a non-admin editor, confirm the editor lacks `_create`/`_edit` on the secret section, then reposition the editable `public-page` among its siblings under the same secret parent.

```javascript
// Same-parent reorder under a restricted parent, driven as a non-admin editor.
// The move must be forbidden but is not; the restricted siblings are re-ranked.
const editorReq = apos.task.getReq({
  role: 'editor',
  user: { _id: 'editor-user', title: 'Editor', role: 'editor' }
});

// `mine` is an editor-editable public-page already nested under the admin-only `secret` section.
// `secretChild` is a pre-existing admin-only sibling under the same `secret` parent.
const before = await apos.page.find(adminReq, { _id: secretChild._id }).toObject();

// Reposition `mine` to firstChild of its OWN current parent (secret) -> same-parent reorder.
await apos.page.move(editorReq, mine._id, secret._id, 'firstChild');

const after = await apos.page.find(adminReq, { _id: secretChild._id }).toObject();
console.log('secret child rank before:', before.rank, 'after:', after.rank);
```

```text
Expected (secure) behavior: apos.page.move() throws "forbidden" for the editor.
Observed behavior (source-derived): move() succeeds; nudgeNewPeers() issues
updateMany({ ... rank: { $gte: 0 } }, { $inc: { rank: 1 } }) over the secret
section's children, so the admin-only sibling's rank changes (e.g. 0 -> 1)
even though the editor holds no edit/create rights on it.
```

Over HTTP the identical effect is reachable by a logged-in non-admin via `PATCH /api/v1/@apostrophecms/page/<myPageId>:en:draft` with body `{ "_targetId": "<sameParentId>:en:draft", "_position": "firstChild" }` (also `before`/`after` a sibling), since the route reaches `move()` after only the `page._edit` gate on the moved page.

## Attack Chain

1. **Exposure:** An authenticated editor sends `PATCH` (or `PUT`) `/api/v1/@apostrophecms/page/<C>` where `C` is an ordinary page the editor may edit, with body `{ _targetId: <P>, _position: 'firstChild' }` and `P` is `C`'s own current restricted parent. The route enforces only `page._edit` on the moved page `C` (index.js:1245 for `patch`, 619 for `put`).
2. **Control:** The attacker controls `_targetId` and `_position`. `C`'s editability is resolved from `C`'s own type via `checkRoleConfig` (permission/index.js:99-102, 114-122); an ordinary `public-page` passes for an editor regardless of the parent's type.
3. **Path:** `move()` resolves the target with `getTarget()` using `.permission(false)` (index.js:1873-1899), so no authorization is applied to the restricte

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
