Details
This gadget is a well-documented, essentially universal client-side-PP > XSS escalation in Vue applications.
It is not claimed as a novel finding and is not ApostropheCMS's to fix, it cannot
be removed without changing Vue. Its relevance here is that it makes the (1) pollution
reliably exploitable in any ApostropheCMS admin session.
Proof of Concept
Prerequisite: a running ApostropheCMS instance and any authenticated session (a guest
account suffices). The tester/victim must be logged in.
A. Prototype pollution (console-verifiable):
- Log in as any user.
- Navigate to:
https://TARGET/?__proto__[prop]=polluted - In the browser console:
Object.prototype.prop> returns"polluted".
B. DOM-based XSS:
- Log in as any user.
- Navigate to:
https://TARGET/?__proto__[innerHTML]=%3Cimg/src/onerror%3dalert(1)%3E alert(1)executes in the victim's authenticated origin.
To capture the sink stack for evidence: DevTools > Sources > open the admin bundle >
pretty-print > search unsafeToTrustedHTML (or === "innerHTML") > line breakpoint in thepatchDOMProp innerHTML branch > reload the logged-in payload URL > inspect value and
walk the call stack up through hostPatchProp to mountElement's for…in.
Both A and B were reproduced against ApostropheCMS 4.32.2 (Vue 3.5.42) in Chrome, Firefox, and Edge browsers.
Impact
Any party who can coerce an authenticated ApostropheCMS user to open a crafted URL can
execute arbitrary JavaScript in that user's session. Because the escalation gadget is a
guaranteed-present Vue behavior, this is a reliable exploit, not a theoretical primitive.
Consequences scale with the victim's role:
- Any authenticated victim: actions and data reads available to that account; theft of the session cookie / CSRF token from the authenticated context.
- Editor/admin victim: the injected script can invoke the authenticated management REST APIs as the victim, creating or modifying documents and user accounts, changing configuration and possibly leading to account takeover and potential full compromise of the CMS instance.
Prototype pollution can additionally affect unrelated code paths that read inherited
properties, so other gadgets beyond the demonstrated Vue innerHTML sink may exist.
Remediation
The fix belongs in ApostropheCMS, at the source (1). The gadget (3) is framework behavior
and cannot be relied upon to change, so sanitizing parseQuery is the correct fix.
Primary fix: reject prototype-affecting keys in `parseQuery`/`patch()`:
apos.http.parseQuery = function(query) {
query = query.replace(/^\?/, '');
const data = {};
const DANGEROUS = new Set([ '__proto__', 'constructor', 'prototype' ]);
query.split('&').forEach(function(pair) {
// ... unchanged ...
});
return data.root || {};
function patch(key, value) {
let match;
let parentKey = 'root';
let context = data;
key = decodeURIComponent(key);
const path = key.split('[');
let dangerous = false;
path.forEach(function(subKey) {
const cleanKey = subKey.replace(']', '');
if (DANGEROUS.has(cleanKey)) { // refuse to traverse into prototype-affecting keys
dangerous = true;
return;
}
// ... existing subKey handling ...
});
if (dangerous) {
return; // discard this parameter entirely
}
// ... existing assignment ...
}
};
Defense in depth:
- Replace the truthy guard at (A) with an own-property check:
if (!Object.prototype.hasOwnProperty.call(context, parentKey)), so a key can never descend into an inherited prototype. - Build
dataand any created containers withObject.create(null)so intermediate objects have no prototype chain to reach.
Interim mitigation for operators: restrict who holds authenticated accounts, and be
aware that opening untrusted links while logged in can trigger this. There is no server-side
configuration toggle that disables the vulnerable client behavior.
References
- Source (ApostropheCMS):
apostrophe/modules/@apostrophecms/util/ui/src/http.js—parseQuery()/patch() - Trigger (ApostropheCMS):
apostrophe/modules/@apostrophecms/admin-bar/ui/apos/components/TheAposContextBar.vue—data()(~line 64),refresh()(~line 606) - Escalation gadget (Vue 3.5.42, framework behavior):
@vue/runtime-coremountElementprop enumeration (~line 5741);@vue/runtime-dompatchDOMPropinnerHTML branch (~line 583) - Related but distinct: CVE-2026-53609 / GHSA-6h5j-32cf-4253 (server-side prototype pollution via
apos.util.set()/$pullAll, fixed in 4.31.0) - CWE-1321; CWE-79
Credit
Github Account Username: Xx-LoGiCaL-xX
---