llamaCVEVulnerability Intelligence
/
Advisory · GitHub · npm · signalk-server

GHSA-QF2W-MM2P-JMG9

Signal K Server: unauthenticated ReDoS via chained wildcards in WebSocket subscription context/path matching

Texto original en inglés · Ver en español

Parche disponible
Descargar PNG JSON
CVSS 3.1
7.5
Alta
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H Fuente: GitHub
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche1 versiónPrimer parche a -14 d de la divulgación
Exposición14 dDesde la divulgación, 7 nov 2026, 2:15 a. m.
Detección13 dDesde la divulgación hasta su ingreso al índice
Decisión estimadaSeguir
Remediar en la ventana regular de mantenimiento
Estimación de Llama con el árbol SSVC de CISA a partir de vector CVSS 3.1 y la evidencia de explotación (sin evaluación oficial): sin explotación conocida, automatizable e impacto técnico parcial. Hay versiones corregidas disponibles.
Agéndala y deja de pensar en ella.Que no se te pase entre tantos tickets.
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Parche 2.35.0
Monitoreo
Detectada +1
24 oct 26
7 nov 26
20 nov 26
21 nov 26
24 oct 26
31 oct 26
7 nov 26
14 nov 26
21 nov 26
FechaFaseEventoDetalle
Remediación Parche 2.35.0 signalk-server · -14 d desde divulgación
Divulgación Publicada GHSA-QF2W-MM2P-JMG9 divulgada · CVSS 7.5 (GitHub)
Monitoreo Detectada Ingresó al índice
Monitoreo Verificada Última verificación contra las fuentes
Resumen
Descripción del advisory
Texto original · GitHub · en inglés

Summary

Signal K Server compiles the user-supplied `context` and `path` fields of a WebSocket stream subscription into a regular expression without limiting the complexity introduced by its own wildcard-to-regex conversion. In `src/subscriptionmanager.ts`, the `contextMatcher()` and `pathMatcher()` functions convert every `*` in the client input into `.*`. A subscription value containing many wildcards separated by a literal character (for example `*a*a*a...`) becomes a regular expression of the form `^.*a.*a.*a...$`, a classic catastrophic-backtracking pattern. An unauthenticated client can register such a subscription over the default `/signalk/v1/stream` endpoint and then send one delta whose `context` is crafted to force the engine to fail the match, blocking the single Node.js event loop for seconds to minutes and denying service to all other clients and APIs.

Root Cause

The CVE-2026-39320 fix added metacharacter escaping to both matcher functions so that injected regex operators such as `+`, `(`, `)`, `?`, `[`, and `]` are treated literally. That escaping does not and cannot escape `*`, because `*` is the intended wildcard token that the function deliberately rewrites into `.*`. No limit is placed on how many wildcards a single input may contain, so the attacker controls how many `.*` groups appear in the compiled pattern. Multiple adjacent `.*` groups anchored at both ends produce exponential backtracking in V8's backtracking regex engine when the subject string does not match. Because the attacker also controls the subject (the `context` of a delta they inject), they can guarantee a non-matching, worst-case input.

// src/subscriptionmanager.ts (contextMatcher, lines 619-623; pathMatcher, lines 534-537)
const pattern = subscribeCommand.context
  .replace(/[\\^$+?()[\]{}|]/g, '\\$&') // escapes metacharacters, but not '*'
  .replace(/\./g, '\\.')
  .replace(/\*/g, '.*')                 // every '*' becomes an unbounded '.*' group
const matcher = new RegExp('^' + pattern + '$')

Impact

A single unauthenticated WebSocket connection can permanently stall the server. Signal K Server runs on a single-threaded Node.js event loop, so once `matcher.test()` enters catastrophic backtracking, the REST API, all other WebSocket clients, delta ingestion, plugin operations, and sensor aggregation stop responding until the match completes. Measured on a developer workstation (Node.js v24), a pattern of 30 chained wildcards against a crafted 40-character subject blocked the event loop for roughly 196 seconds; backtracking time grows exponentially with the number of wildcards, so a slightly longer input blocks the process effectively indefinitely. On the documented Raspberry Pi deployment target the same inputs block for substantially longer. In the default configuration the dummy security strategy authorizes both the subscription and the triggering delta write without credentials, so no authentication is required. In token-secured deployments any client with read access can compile the pattern, and any client with write access can supply the trigger.

Proof of Concept

Dependencies: Node.js and the `ws` package (npm install ws).
Target: a default Signal K Server instance reachable at ws://HOST:3000.
  1. Open a WebSocket to `ws://HOST:3000/signalk/v1/stream?subscribe=none`.
  2. Send a subscription whose `context` chains many wildcards around a literal character.
  3. Send a delta whose `context` is a long run of that literal character ending in a non-matching character, forcing the compiled regex to backtrack.
  4. Observe that further HTTP and WebSocket requests to the server time out while the event loop is blocked.
const WebSocket = require('ws')
const ws = new WebSocket('ws://localhost:3000/signalk/v1/stream?subscribe=none')

ws.on('open', () => {
  // Register a subscription whose context compiles to ^.*a.*a...$
  ws.send(JSON.stringify({
    context: '*a'.repeat(30),
    subscribe: [{ path: '*' }]
  }))
  // Trigger the match with an attacker-chosen, non-matching delta context
  ws.send(JSON.stringify({
    context: 'a'.repeat(40) + '!',
    updates: [{ values: [{ path: 'navigation.speedOverGround', value: 0 }] }]
  }))
})
# Isolated reproduction of the compiled pattern's backtracking (Node.js v24):
# pattern built exactly as src/subscriptionmanager.ts builds it from the input above
wildcard reps  subject                 matcher.test() time
30             'a'*40 + '!'            ~196000 ms (event loop blocked)
# Growth is exponential (~3x per 5 additional wildcard repetitions).

Attack Chain

  1. Exposure: The built-in WebSocket interface is registered in `src/interfaces/index.ts` and started unconditionally during boot (`src/interfaces/ws.ts:449-459`), listening on `/signalk/v1/stream`. In the default configuration `canAuthorizeWS()` returns false (`src/dummysecurity.ts`), so an unauthenticated client may connect.
  2. Control: The client sends a JSON message that is parsed without schema or length validation (`src/interfaces/ws.ts:588-591`). The attacker fully controls the `context` and `path` subscription fields and later the `context` of an injected delta.
  3. Path: A `subscribe` message routes through `processSubscribe()` (`src/interfaces/ws.ts:607-608,1093-1134`), which gates only `log` subscriptions behind an admin check; ordinary subscriptions reach `app.subscriptionmanager.subscribe()` and then `contextMatcher()` (`src/subscriptionmanager.ts:122,610`).
  4. Guard: The metacharacter-escaping guard at `src/subscriptionmanager.ts:620` does not restrict the `*` wildcard it rewrites into `.*`, and no complexity or length limit is applied before `new RegExp()` at line 623. The guard is therefore absent for this input shape.
  5. Primitive: The crafted subscription compiles into `^.*a.*a...$`. A subsequent `updates` message passes the default write check `shouldAllowWrite()` (`src/interfaces/ws.ts:952`, `src/dummysecurity.ts:70-72`), is ingested via `app.handleMessage()` (line 960), and is tested against the pattern at `src/subscriptionmanager.ts:625`.
  6. Result: `matcher.test()` enters catastrophic backtracking and blocks the single Node.js event loop, denying service to every other client, the REST API, and all delta processing until the match completes.

Bypass Evidence

The relevant protection is the CVE-2026-39320 metacharacter-escaping fix (commit `215d81eb`, released in v2.25.0), which is present in the examined v2.34.0 source at `src/subscriptionmanager.ts:620` and `:535`. The strongest challenge was to confirm whether that escaping neutralizes this input: applying the exact first replacement to `*a*a*a` leaves it unchanged, because neither `*` nor `a` is in the escaped class `[\\^$+?()[\]{}|]`. The `*` is then converted to `.*` at line 622, producing the backtracking pattern. The prior fix addresses only metacharacter injection (the seed's `([a-z0-9:-]+)+!` vector) and leaves wildcard-driven complexity unguarded, so this input is not blocked. Attempts to defeat the finding (searching for a length cap, schema validation, or rate limit on the subscription `context`, and testing whether organic sensor deltas could avoid the issue) all failed to prevent the attack: no such limits exist, and the attacker-controlled trigger delta reliably produces the non-matching worst case.

Affected Versions

  • Ecosystem: `npm`
  • Package: `signalk-server`
  • Confirmed affected range: `<= 2.34.0`
  • Latest release checked: `2.34.0` (npm registry https://www.npmjs.com/package/signalk-server/v/2.34.0)
  • Fix status: not fixed

The wildcard-to-regex conversion and the absence of any complexity limit are present in the latest published release (v2.34.0). The CVE-2026-39320 fix in v2.25.0 did not address this input shape, and no later release limits wildcard-generated regex complexity, so all currently published versions are affected.

Suggested Fix

Enforce a bound on the complexity the user-supplied wildcard input may introduce before compiling a regular expression. Rather than converting each `*` into an unbounded `.*`, reject or cap inputs containing an excessive number of wildcards, or translate the glob into an equivalent linear-time matcher (for example a non-backtracking matcher or a character-walk) that cannot backtrack exponentially. Apply the same limit to both `contextMatcher()` and `pathMatcher()`, and cover both the subscription value and any field that is compiled into a `RegExp`. As an interim mitigation, operators can place the server behind authentication so that only trusted clients can open subscriptions, though this does not protect against an authenticated client and does not remove the underlying complexity flaw.

---

Reported by zx.

Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.

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:L
BajaAlta
PrivilegiosPR:N
NingunoBajosAltos
InteracciónUI:N
NingunaRequerida
AlcanceS:U
CambiadoSin cambio
ConfidencialidadC:N
AltoBajoNinguno
IntegridadI:N
AltoBajoNinguno
DisponibilidadA:H
AltoBajoNinguno
Score de explotaciónQué tan fácil y probable es que la exploten
10.0/ 10Muy alto
Vector 10.0 (muy fácil) · sin evidencia de explotación.
Versiones

Rangos afectados

Afectada Corregida Última
signalk-server≤ 2.34.0
2.34.0
2.37.0
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
npmsignalk-server
Corregida 2.35.0 -14 d 2.37.0 no afectada
Versiones corregidas2.35.0
Explotación

Arsenal público

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

Referencias
Advisoryhttps://github.com/SignalK/signalk-server/security/advisories/GHSA-qf2w-mm2p-jmg9

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