GHSA-2jrp-qc93-h2j8 CVE-2026-113655
ApostropheCMS: Same-parent page reorder in @apostrophecms/page move() re-ranks a restricted parent's children without create authorization
- Severity
- 4.3 / 10
- Medium · CVSS 3.1
- Exploit chance (EPSS)
- 0.32%
- Chance of exploitation in the next 30 days. Higher than 25.37% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Fix
4.33.0- Upgrade apostrophe to this version or later
Description
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.
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.
- Configure a restricted page type
secret-pagewitheditRole: 'admin'andpublishRole: 'admin', and an ordinary typepublic-pagewith no role restriction. - As an admin, create a
secret-pagesection under home, then create twosecret-pagechildren beneath it (the pre-existing restricted siblings), and place one editor-editablepublic-pageas a further child of the secret section (the non-default nesting precondition). - As a non-admin editor, confirm the editor lacks
_create/_editon the secret section, then reposition the editablepublic-pageamong its siblings under the same secret parent.
// 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);
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
- 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).
Affected versions
npm
| Package | Vulnerable | Fixed in |
|---|---|---|
| apostrophe | < 4.33.0 |
4.33.0 |
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
apostrophe npm → 4.33.0
- npm
npm install apostrophe@4.33.0- yarn
yarn add apostrophe@4.33.0- pnpm
pnpm add apostrophe@4.33.0
Severity breakdown
CVSS 3.1 4.3
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- Low
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- None
- Integrity
- Low
- Availability
- None
Weakness
CWE-639: Authorization Bypass Through User-Controlled Key
The system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data.
How to prevent it
- Architecture and Design: For each and every data access, ensure that the user has sufficient privilege to access the record that is being requested.
- Architecture and Design, Implementation: Make sure that the key that is used in the lookup of a specific user's record is not controllable externally by the user or that any tampering can be detected.
- Architecture and Design: Use encryption in order to make it more difficult to guess other legitimate values of the key or associate a digital signature with the key so that the server can verify that there has been no tampering.
CWE-862: Missing Authorization
The product does not perform an authorization check when an actor attempts to access a resource or perform an action.
How to prevent it
- Architecture and Design: Divide the product into anonymous, normal, privileged, and administrative areas. Reduce the attack surface by carefully mapping roles with data and functionality. Use role-based access control (RBAC) [REF-229] to enforce the roles at the appropriate boundaries. Note that this approach may not protect against horizontal authorization, i.e., it will not protect a user from attacking others with the same role.
- Architecture and Design: Ensure that access control checks are performed related to the business logic. These checks may be different than the access control checks that are applied to more generic resources such as files, connections, processes, memory, and database records. For example, a database may restrict access for medical records to a specific database user, but each record might only be intended to be accessible to the patient and the patient's doctor [REF-7].
- Architecture and Design: Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. For example, consider using authorization frameworks such as the JAAS Authorization Framework [REF-233] and the OWASP ESAPI Access Control feature [REF-45].
- Architecture and Design: For web applications, make sure that the access control mechanism is enforced correctly at the server side on every page. Users should not be able to access any unauthorized functionality or information by simply requesting direct access to that page. One way to do this is to ensure that all pages containing sensitive information are not cached, and that all such pages restrict access to requests that are accompanied by an active and authenticated session token associated with a user who has the required permissions to access that page.
- System Configuration, Installation: Use the access control capabilities of your operating system and server environment and define your access control lists accordingly. Use a "default deny" policy when defining these ACLs.
References
Packages
Other links
- github.com/apostrophecms/apostrophe/security/advisories/GHSA-2jrp-qc93-h2j8
- github.com/apostrophecms/apostrophe/commit/9500b8b0e1d630d5e07fbb5fd2c25ed09438…
- github.com/apostrophecms/apostrophe/commit/f84fd41cbf6c22eb8d0008fc9c25df1f7130…
- github.com/apostrophecms/apostrophe/releases/tag/apostrophe@4.33.0
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-86wm-68pq-5jwq ApostropheCMS: Unauthenticated resource exhaustion via pre-auth aposBigUpload processing in @apostrophecms/import-export | High | Also affects apostrophe |
| GHSA-653j-g8j7-gh54 ApostropheCMS: No Attempt Throttling on Authenticated Password-Change Endpoint Enables Unlimited Current-Password Guessing | Medium | Also affects apostrophe |
| GHSA-vwwx-px9w-crrc ApostropheCMS: Missing Authorization on Notification PATCH/DELETE Endpoints | Low | Also affects apostrophe |
| GHSA-vmxh-77cw-65j7 ApostropheCMS: Authenticated Object-Level Authorization Bypass in exist-in-locale Reveals Restricted Localized Draft Identifiers | Medium | Also affects apostrophe |
| GHSA-m2m5-rw3w-cwmj ApostropheCMS: Client-side Prototype Pollution in apos.http.parseQuery leading to DOM-based XSS against authenticated users | Medium | Also affects apostrophe |
| GHSA-gqh3-7856-rjjg ApostropheCMS: :_id/locales REST route omits the public-API authorization gate its sibling read routes enforce (unauthenticated doc-existence + locale metadata disclosure) | Medium | Also affects apostrophe |
| GHSA-hhvr-8m24-qqr3 ApostropheCMS: Cross-domain session token in URL confers session takeover | Medium | Also affects apostrophe |
| GHSA-j5rq-xfvr-p969 ApostropheCMS: Authenticated projection-exclusion prototype-member deletion in @apostrophecms/db-connect causes process-wide denial of service | High | Also affects apostrophe |
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor