llamaCVEVulnerability Intelligence
/
Advisory · GitHub · npm · apostrophe

GHSA-W4QX-QGQH-6QM5

Unauthenticated unhandled exception in query-builder handling allows log-flooding denial of service

Parche disponible
Descargar PNG JSON
CVSS 3.1
3.7
Baja
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L Fuente: GitHub
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche1 versiónPrimer parche el mismo día de la divulgación
Exposición9 dDesde la divulgación, 11 nov 2026, 3:28 p. m.
Detección6 dDesde la divulgación hasta su ingreso al índice
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Parche 4.34.1
Monitoreo
Detectada +1
11 nov 26
18 nov 26
20 nov 26
11 nov 26
14 nov 26
16 nov 26
18 nov 26
20 nov 26
FechaFaseEventoDetalle
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
Resumen
Descripción del advisory
Texto original · GitHub · en inglés

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.role

Requires `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 200

Extrapolated: ~1 MB of log per 1,000 requests; ~8.8 GB/day at a sustained 100 req/s.

---

Impact

  1. Disk exhaustion. Every request appends ~1 KB of multi-line stack trace. Unauthenticated
  2. Log-ingestion cost amplification. Commercial pipelines (Datadog, Splunk, CloudWatch) bill
  3. Monitoring poisoning. Every request raises a high-severity error, drowning real incidents.
  4. CPU/IO amplification. Exception construction, stack capture and synchronous log writes per
  5. 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.

Vector CVSS 3.1

Desglose de métricas

Opción resaltada = valor del vector · izquierda = peor caso · GitHub
Vector de ataqueAV:N
RedAdyacenteLocalFísica
ComplejidadAC:H
BajaAlta
PrivilegiosPR:N
NingunoBajosAltos
InteracciónUI:N
NingunaRequerida
AlcanceS:U
CambiadoSin cambio
ConfidencialidadC:N
AltoBajoNinguno
IntegridadI:N
AltoBajoNinguno
DisponibilidadA:L
AltoBajoNinguno
Versiones

Rangos afectados

Afectada Corregida Última
apostrophe< 4.34.1
4.34.1
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
npmapostrophe
Corregida 4.34.1 0 d 4.34.1 no afectada
Versiones corregidas4.34.1
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Advisoryhttps://github.com/apostrophecms/apostrophe/security/advisories/GHSA-w4qx-qgqh-6qm5

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.