Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-91160 Overview
OpenWA, a free self-hosted WhatsApp API gateway, contains a missing authorization flaw [CWE-862] in its /events WebSocket gateway. Versions prior to 0.23.5 deliver the session.qr event to VIEWER API keys that subscribe by event name or through wildcard subscription forms. The equivalent REST endpoint GET /api/sessions/{sessionId}/qr correctly requires the OPERATOR role, creating an authorization inconsistency between transport layers. An attacker holding a VIEWER key can capture the QR code during pairing and link an external device to the underlying WhatsApp account. The linked device then reads and sends messages outside OpenWA and bypasses its audit trail.
Critical Impact
A low-privileged VIEWER API key can hijack any allowed WhatsApp session by capturing pairing QR codes through the WebSocket channel, enabling out-of-band message access and impersonation.
Affected Products
- OpenWA self-hosted WhatsApp API gateway versions prior to 0.23.5
- Deployments issuing VIEWER-tier API keys without allowedSessions restrictions
- OpenWA instances exposing the /events WebSocket gateway to API consumers
Discovery Timeline
- 2026-09-24 - CVE-2026-91160 published to NVD
- 2026-09-30 - Last updated in NVD database
Technical Details for CVE-2026-91160
Vulnerability Analysis
The flaw stems from inconsistent authorization enforcement between OpenWA's REST and WebSocket interfaces. The REST route GET /api/sessions/{sessionId}/qr gates QR disclosure behind the OPERATOR role. The WebSocket gateway at /events applies no equivalent role check when a client subscribes to the session.qr event. A VIEWER key, intended for read-only observation, receives sensitive pairing material it was never authorized to see.
Subscription patterns broaden the exposure. Clients can subscribe directly by event name, through a prefix wildcard, or through a global wildcard subscription form. All three paths deliver the session.qr payload to any key that holds visibility into the target session. Keys constrained with allowedSessions remain scoped to those sessions, and deployments that issue only OPERATOR or ADMIN keys are unaffected.
Root Cause
The root cause is a missing authorization check in the WebSocket event dispatcher. Role evaluation exists for HTTP routes but was never ported to the event subscription layer. The dispatcher relies on authentication alone and treats any authenticated subscriber as entitled to receive matching events.
Attack Vector
An attacker with a valid VIEWER API key connects to the /events WebSocket and subscribes to session.qr or a wildcard matching that event. When an operator initiates pairing for an allowed session, the gateway emits the QR payload to the attacker. The attacker scans the QR with WhatsApp's linked-device flow and gains independent access to the account outside OpenWA's audit boundary. Refer to the GitHub Security Advisory GHSA-m427-j4h4-9qwj for additional detail.
Detect Identity Attacks the Moment Authentication Fails
Singularity™ Identity surfaces credential misuse, lateral movement, and privilege escalation in real time, so you can contain the breach before it spreads.
Stop Identity AttacksDetection Methods for CVE-2026-91160
Indicators of Compromise
- Unexpected linked device added events on WhatsApp accounts managed by OpenWA, especially during or shortly after a pairing operation.
- WebSocket subscriptions to session.qr, *, or session.* originating from API keys tagged with the VIEWER role.
- Outbound WhatsApp messages that have no corresponding entry in the OpenWA audit log.
Detection Strategies
- Audit application logs for /events subscriptions filtering on event name session.qr and correlate the subscribing key's assigned role.
- Correlate the timing of session.qr emissions with WhatsApp linked-device additions reported through the account owner's device list.
- Compare message send volume on the WhatsApp account against OpenWA's outbound message log to surface out-of-band activity.
Monitoring Recommendations
- Enable verbose WebSocket subscription logging and ship events to a centralized SIEM or data lake for role-based review.
- Alert on any wildcard subscription (* or prefix wildcard) opened by a non-ADMIN key.
- Periodically enumerate WhatsApp linked devices for each managed session and alert on unexpected additions.
How to Mitigate CVE-2026-91160
Immediate Actions Required
- Upgrade OpenWA to version 0.23.5 or later, which enforces the OPERATOR role on session.qr delivery across the WebSocket gateway.
- Rotate all VIEWER API keys issued before the upgrade and audit which sessions they could observe.
- Review WhatsApp linked-device lists for every managed session and remove any device not provisioned by an authorized operator.
Patch Information
The fix ships in OpenWA v0.23.5 and is implemented through pull request #1602. The relevant commits are tracked at commit acc23c3 and commit b9d9ea1. The patch adds a role check at the event-dispatch layer so VIEWER keys no longer receive session.qr payloads.
Workarounds
- Restrict every VIEWER key with an explicit allowedSessions list so a compromised key cannot subscribe to arbitrary session events.
- Reissue API tokens as OPERATOR or ADMIN only where the elevated role is operationally required, and revoke VIEWER keys that are not strictly needed.
- Block external access to the /events WebSocket endpoint at the reverse proxy and permit it only from trusted internal networks until the upgrade is applied.
# Example reverse proxy restriction (nginx) limiting /events to an internal CIDR
location /events {
allow 10.0.0.0/8;
deny all;
proxy_pass http://openwa_backend;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

