GHSA-W4QX-QGQH-6QM5
Unauthenticated unhandled exception in query-builder handling allows log-flooding denial of service
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-W4QX-QGQH-6QM5 divulgada · CVSS 3.7 (GitHub) | |
| Remediación | Parche 4.34.1 | apostrophe · 0 d desde divulgación | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Unauthenticated unhandled exception in query-builder handling allows log-flooding denial of service
Product: `apostrophe` (npm) / `@apostrophecms/apostrophe`
Affected version: 4.34.0 (reproduced on `a01f9372fcd252ce577c0148cb0a802c41788f48`, 2026-10-20)
Severity: Medium — `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L` (5.3)
Authentication required: None for the primary sink
CWE-248 Uncaught Exception · CWE-400 Uncontrolled Resource Consumption
---
Summary
`applyBuildersSafely()` and the `choices` query-builder finalizer both use `_.has()` as an
existence guard and then immediately perform a literal property lookup with the same
string. `_.has()` interprets its second argument as a lodash dot-path, so any parameter of
the form `<builder>.<metadata>` passes the guard while the literal lookup returns `undefined`.
The next line dereferences that `undefined`, raising an uncaught `TypeError` on every request.
The result is an **unauthenticated HTTP 500 that appends ~1 KB of stack trace to the error log
per request**, with no rate limiting. 300 requests measured 476 ms and 321 KB of log growth.
This is reachable from the public REST API whenever a piece type is exposed with
`publicApi: true` (the standard configuration for running Apostrophe as a headless content
API), and from the public search page and piece index pages.
---
Affected code
Sink 1 — `applyBuildersSafely` (unauthenticated)
`packages/apostrophe/modules/@apostrophecms/doc-type/index.js:3391` and `:3394`
for (let [ name, value ] of Object.entries(params)) {
if (!_.has(query.builders, name)) {
continue;
}
if (!query.builders[name].launder) { // <-- TypeError: undefined.launder
continue;
}Reached from `req.query` at four call sites:
- `modules/@apostrophecms/piece-type/index.js:1139` — public piece REST API
- `modules/@apostrophecms/search/index.js:199` — public search page
- `modules/@apostrophecms/piece-page-type/index.js:52` — public piece index page
- `modules/@apostrophecms/page/index.js:2993` — page REST API
Sink 2 — `choices` finalizer (unauthenticated, separate code path)
`packages/apostrophe/modules/@apostrophecms/doc-type/index.js:2851` and `:2856`
for (const filter of filters) {
if (!_.has(query.builders, filter)) {
continue;
}
if (!query.builders[filter].launder) { // <-- TypeError: undefined.launder
continue;
}This fires during query finalization, not parameter ingestion, so it is not addressed by
guarding the ingestion loop alone.
Sink 3 — `apiKeys` middleware (authenticated variant)
`packages/apostrophe/modules/@apostrophecms/express/index.js:350` and `:352`
if (_.has(self.options.apiKeys && self.options.apiKeys, key)) {
const info = self.options.apiKeys[key]; // undefined for a dot-path
if (info.role === 'admin') { // <-- TypeError: undefined.roleRequires `apiKeys` to be configured and knowledge of a valid key name, so this is the least
exposed of the three, but it is the same defect.
---
Root cause
Query-builder definitions are objects carrying nested metadata (`launder`, `def`, `after`,
`finalize`, `choices`). That makes `_.has(builders, 'sort.launder')` return `true`, while
`builders['sort.launder']` is `undefined`. The guard and the lookup disagree about whether the
string is a path or a key, and nothing between them validates it.
Enumerating the live `query.builders` object yields 68 parameters of this form, including
`sort.launder`, `criteria.def`, `title.launder`, `slug.launder`, `project.launder`,
`page.def`, `perPage.launder`, `limit.launder`, `search.launder`, `skip.launder`,
`visibility.launder`, `distinctCounts.def`, `viewContext.def`, `withPublished.after`.
The guard itself is long-standing (introduced 2025-12-01, commit `107bcd242`), so this is not a
regression from any recent advisory fix.
---
Reproduction
Precondition: a piece type with `publicApi: true` (or a search page / piece index page).
No credentials, no API key, no CSRF token.
GET /api/v1/thing/?sort=title -> 200 (valid builder, control)
GET /api/v1/thing/?bogusbuilder=x -> 200 (control)
GET /api/v1/thing/?sort.launder=x -> 500
GET /api/v1/thing/?criteria.def=x -> 500
GET /api/v1/thing/?title.launder=x -> 500
GET /api/v1/thing/?perPage.launder=x -> 500
GET /api/v1/thing/?choices=sort.launder -> 500 (sink 2)Server log:
TypeError: Cannot read properties of undefined (reading 'launder')
at Object.applyBuildersSafely (modules/@apostrophecms/doc-type/index.js:3394:39)
at Object.getRestQuery (modules/@apostrophecms/piece-type/index.js:1139:15)
TypeError: Cannot read properties of undefined (reading 'launder')
at Object.after (modules/@apostrophecms/doc-type/index.js:2856:43)Measured impact
300 anonymous requests to ?sort.launder=x
elapsed : 476 ms (~630 req/s from one client)
log growth : 321,300 bytes (1,071 bytes per request)
process : did not crash; subsequent normal requests returned 200Extrapolated: ~1 MB of log per 1,000 requests; ~8.8 GB/day at a sustained 100 req/s.
---
Impact
- Disk exhaustion. Every request appends ~1 KB of multi-line stack trace. Unauthenticated
- Log-ingestion cost amplification. Commercial pipelines (Datadog, Splunk, CloudWatch) bill
- Monitoring poisoning. Every request raises a high-severity error, drowning real incidents.
- CPU/IO amplification. Exception construction, stack capture and synchronous log writes per
- Legitimate breakage. Integrations that append parameters, or that name a top-level field
Not claimed: this does not crash the Node process (Express catches the throw) and is not an
authentication bypass, privilege escalation, or data exposure.
---
Suggested fix
Replace the dot-path guard with an own-property lookup and null-check before dereferencing:
// doc-type/index.js:3391 and :2851
if (!Object.hasOwn(query.builders, name)) {
continue;
}
const builder = query.builders[name];
if (!builder || !builder.launder) {
continue;
}
// express/index.js:350
if (Object.hasOwn(self.options.apiKeys || {}, key)) {
const info = self.options.apiKeys[key];
if (!info) {
return res.status(403).send({ error: 'invalid api key' });
}
...
}A sweep for every `_.has(` call whose second argument is not a constant is advisable. (I
reviewed all 29 occurrences in core; these three are the request-reachable ones.)
---
Notes on prior advisories
This defect is distinct from the following, which concern *bypass semantics* (lodash `_.has`
returning true for legitimate builder names) rather than a reachable `TypeError`:
- CVE-2026-112954 / GHSA-rqgm-cfrp-4hx8 — publicApiProjection bypass via `search`/`sort`
- CVE-2026-39857 / GHSA-c276-fj82-f2pq — `choices`/`counts` bypass
- CVE-2026-63668 / GHSA-xmpp-f9v3-r7qh — incomplete fix via relationship slug-builder aliases
- CVE-2026-33888 / GHSA-xhq9-58fw-859p — `project` builder bypass
None of them describe an unhandled exception or a denial-of-service condition. The guard line
predates all of them (2025-12-01).
---
Disclosure
Reproduced locally against a stock 4.34.0 instance with the SQLite adapter, Node v25.9.0.
Happy to provide the harness or re-test against a patched build. Reported privately; no public
disclosure made.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
npmapostrophe |
Corregida | 4.34.1 | 0 d | 4.34.1 no afectada |
4.34.1Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/apostrophecms/apostrophe/security/advisories/GHSA-w4qx-qgqh-6qm5Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
