Details
Attack Chain
- Exposure: An authenticated editor sends
PATCH(orPUT)/api/v1/@apostrophecms/page/<C>whereCis an ordinary page the editor may edit, with body{ _targetId: <P>, _position: 'firstChild' }andPisC's own current restricted parent. The route enforces onlypage._editon the moved pageC(index.js:1245 forpatch, 619 forput). - Control: The attacker controls
_targetIdand_position.C's editability is resolved fromC's own type viacheckRoleConfig(permission/index.js:99-102, 114-122); an ordinarypublic-pagepasses for an editor regardless of the parent's type. - Path:
move()resolves the target withgetTarget()using.permission(false)(index.js:1873-1899), so no authorization is applied to the restricted parentP.determineRankAndNewParent()setsparent = target = PandgetMoved()setsoldParent = P, sooldParent._id === parent._id. - Guard: The destination
createguard (index.js:1684-1691) leads with(oldParent._id !== parent._id), which isfalsefor the same-parent reorder, so the entire conditional short-circuits andparent._createis never checked. The moved-edit gate (index.js:1661) passes because the editor may editC. - Primitive:
nudgeNewPeers()(index.js:1781-1803) issues a rawself.apos.doc.db.updateManythat increments therankof every direct child ofP, including the restricted siblings, bypassing the per-documentbeforeUpdateedit check (doc-type/index.js:297-304). - Result: The editor persistently modifies the sibling ordering of documents under a restricted parent on which they hold no edit, create, publish, or delete authority, and can inflate those ranks arbitrarily by repeating the operation.
Bypass Evidence
This is an incomplete-fix follow-up to CVE-2026-63669 (GHSA-wr5r-wqp2-x4fh, published), whose fix restored the destination create guard in the same move() function. The prior fix and its regression test address only cross-parent moves; the same-parent reorder path was never covered.
- The guard condition at index.js:1684-1691 leads with
(oldParent._id !== parent._id). For a same-parent reorder both identifiers are the same restricted parent, so the conjunct evaluates tofalseand the short-circuit skips theparent._createrequirement. The guard's own inline comment scopes it to cross-parent moves. This holds both before and after the prior fix commit, which changed only the trailing archive-exception clause and left the leading cross-parent conjunct intact. - The sink
nudgeNewPeers()filters itsupdateManyonly bypath,level,aposLocale, andrank(index.js:1783-1792); there is no permission predicate, and because it calls the MongoDB driver directly it never triggers the@apostrophecms/doc-type:beforeUpdateper-document edit check (doc-type/index.js:297-304). - The strongest refutation considered was that "reordering pages within a sibling group an administrator placed you in is intended behavior." It was rejected because the project's own model treats re-ranking a parent's children as a
create-gated operation:insert()requiresparent._createfor every position (index.js:1436-1439) before its own peer nudge. The same-parentmove()path is the sole route that performs the equivalent write without that check, and the modified siblings are outside the actor's authority. - A second refutation, that a low-privileged editor could never legitimately hold an editable page under a restricted parent, was disproved: authorization is per type, not per subtree (
checkRoleConfigreads only the doc's own type manager), so an editablepublic-pagecan exist as a child of a restrictedsecret-pageparent. Post-fix an editor cannot create that nesting themselves (cross-parentmove()andinsert()both requireparent._create), which confirms the precondition is administrator-established or the result of configuration drift, narrowing but not eliminating reachability.
Affected Versions
Ecosystem: npmPackage: apostropheConfirmed affected range: <= 4.32.2Latest release checked: 4.32.2 (npm registry; npm view apostrophe version)Fix status: not fixed (no release addresses the same-parent reorder path)
The current published latest on npm is 4.32.2, and the same-parent reorder path is unguarded at that version (HEAD commit 46141d3, which stamps packages/apostrophe/package.json version 4.32.2). The prior fix for CVE-2026-63669 landed in the 4.32.0 line but only closed the cross-parent route, so the same-parent gap persists in the fixed line (an incomplete-fix window across 4.32.0 through 4.32.2) and, because the leading cross-parent conjunct predates that fix, in earlier releases as well. The introduction (lower) boundary was not pinned by inspecting each earlier released artifact; the decision-relevant, defensible statement is that the current 4.32.2 release is affected and no release fixes the same-parent path. Do not treat <= 4.32.2 as a proven lower-bounded range without inspecting earlier published artifacts.
Suggested Fix
Enforce destination authorization for the same-parent reorder path as well as for cross-parent moves. The invariant to restore is that re-ranking the children of a parent requires create (or, equivalently, the per-document authority the project uses for that boundary) on that parent, mirroring what insert() already enforces for every position. Concretely, evaluate the parent._create requirement independently of the (oldParent._id !== parent._id) condition, so that a same-parent reorder under a restricted parent is rejected when the actor lacks create on it; or gate nudgeNewPeers() itself on the actor's authority over the affected siblings rather than only on the cross-parent branch. Retaining the existing archive-restore exception is compatible with this change. Add a regression test that asserts a non-admin cannot reorder pages under a parent whose type carries a higher editRole/publishRole, complementing the existing cross-parent test. As an interim mitigation, operators can avoid nesting editor-editable pages beneath restricted-type parents and review such placements after any change that adds an editRole/publishRole to an existing page type.
Reported by zx (GitHub: @manus-pi).