CVE-2026-21883: Bokeh Bokeh Server Applications Have Incomplete Vulnerability

MODERATE
Advisory Identifier: GHSA-793v-589g-574v
CWE-1385
Published
Advisory Summary

CVE-2026-21883 is a MODERATE bokeh server applications have incomplete vulnerability (CWE-1385: Missing Origin Validation in WebSockets) affecting Bokeh libraries in the PyPI ecosystem. The issue involves bokeh server applications have incomplete origin validation in websockets. Remediation is available by upgrading affected packages to version 3.8.2.

CVE-2026-21883 at a Glance

CVE Identifier CVE-2026-21883
GHSA Identifier GHSA-793v-589g-574v
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-1385: Missing Origin Validation in WebSockets
Affected Product Bokeh
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix CVE-2026-21883

To remediate this vulnerability, upgrade all affected Bokeh dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

bokeh fixed: 3.8.2
pip install bokeh>=3.8.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show bokeh

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-21883, inspect your installed packages using pip:

pip show bokeh

Analyze the terminal output to locate any version of Bokeh in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.8.2), your application is affected.

Note: The pip show bokeh command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-1385: Missing Origin Validation in WebSockets, where the product uses a websocket, but it does not properly verify that the source of data or communication is valid. In Bokeh, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

This vulnerability allows for **Cross-Site WebSocket Hijacking (CSWSH)** of a deployed Bokeh server instance. ### Scope This vulnerability is only relevant to deployed Bokeh server instances. There is no impact on static HTML output, standalone embedded plots, or Jupyter notebook usage. This vulnerability does not prevent any requirements for up-front authentication on Bokeh servers that have authentication hooks in place, and cannot be used to make Bokeh servers deployed on private, internal networks accessible outside those networks. ### Impact If a Bokeh server is configured with an allowlist (e.g., `dashboard.corp`), an attacker can register a domain like `dashboard.corp.attacker.com` (or use a subdomain if applicable) and lure a victim to visit it. The malicious site can then initiate a WebSocket connection to the vulnerable Bokeh server. Since the Origin header (e.g., `http://dashboard.corp.attacker.com/`) matches the allowlist according to the flawed logic, the connection is accepted. Once connected, the attacker can interact with the Bokeh server on behalf of the victim, potentially accessing sensitive data, or modifying visualizations. ### Patches Patched in versions 3.8.2 and later. ### Workarounds None ### Technical description The `match_host` function in `src/bokeh/server/util.py` contains a flaw in how it compares hostnames against the allowlist patterns. The function uses Python's `zip()` function to iterate over the parts of the hostname and the pattern simultaneously. However, `zip()` stops iteration when the shortest iterable is exhausted. Because the code only checks if the *pattern* is longer than the *host* (lines 232-233), but fails to check if the *host* is longer than the *pattern*, a host that **starts** with the pattern (but has additional segments) will successfully match. For example, if the allowlist is configured to `['[example.com](http://example.com/)']`, the function will incorrectly validate `[example.com.bad.com](http://example.com.evil.com/)` as a match: 1. `host` parts: `['example', 'com', 'bad', 'com']` 2. `pattern` parts: `['example', 'com']` 3. `zip` compares `example==example` (OK) and `com==com` (OK). 4. Iteration stops, and the function returns `True`.

CVE-2026-21883 Affected Bokeh Versions

1 component(s)
Fixed Versions:
3.8.2
Product / Package Ecosystem Affected Versions Fixed Version
bokeh
PyPI
< 3.8.2
3.8.2

References

Frequently Asked Questions

What is CVE-2026-21883?
CVE-2026-21883 is a security vulnerability in Bokeh involving Bokeh server applications have Incomplete Origin Validation in WebSockets under CWE-1385: Missing Origin Validation in WebSockets.
Which Bokeh versions are affected?
Affected versions include releases prior to 3.8.2 across affected packages: bokeh.
What version fixes CVE-2026-21883?
Upgrading to 3.8.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is bokeh affected?
Yes, bokeh is affected in releases prior to 3.8.2. Upgrade your dependency to 3.8.2 or later.
What CWE is associated with CVE-2026-21883?
CVE-2026-21883 is classified under CWE-1385: Missing Origin Validation in WebSockets (The product uses a WebSocket, but it does not properly verify that the source of data or communication is valid.).
How can I check PyPI dependencies for CVE-2026-21883?
Run the dependency tree command: 'pip show bokeh'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-793v-589g-574v",
  "modified" : "2026-01-23T16:39:04Z",
  "published" : "2026-01-06T17:53:44Z",
  "aliases" : [ "CVE-2026-21883" ],
  "summary" : "Bokeh server applications have Incomplete Origin Validation in WebSockets",
  "details" : "This vulnerability allows for **Cross-Site WebSocket Hijacking (CSWSH)** of a deployed Bokeh server instance. \n\n### Scope\n\nThis vulnerability is only relevant to deployed Bokeh server instances. There is no impact on static HTML output, standalone embedded plots, or Jupyter notebook usage. \n\nThis vulnerability does not prevent any requirements for up-front authentication on Bokeh servers that have authentication hooks in place, and cannot be used to make Bokeh servers deployed on private, internal networks accessible outside those networks. \n\n### Impact\n\nIf a Bokeh server is configured with an allowlist (e.g., `dashboard.corp`), an attacker can register a domain like `dashboard.corp.attacker.com` (or use a subdomain if applicable) and lure a victim to visit it. The malicious site can then initiate a WebSocket connection to the vulnerable Bokeh server. Since the Origin header (e.g., `http://dashboard.corp.attacker.com/`) matches the allowlist according to the flawed logic, the connection is accepted.\n\nOnce connected, the attacker can interact with the Bokeh server on behalf of the victim, potentially accessing sensitive data, or modifying visualizations.\n\n### Patches\nPatched in versions 3.8.2 and later.\n\n### Workarounds\n\nNone\n\n### Technical description\n\nThe `match_host` function in `src/bokeh/server/util.py` contains a flaw in how it compares hostnames against the allowlist patterns. The function uses Python's `zip()` function to iterate over the parts of the hostname and the pattern simultaneously. However, `zip()` stops iteration when the shortest iterable is exhausted.\n\nBecause the code only checks if the *pattern* is longer than the *host* (lines 232-233), but fails to check if the *host* is longer than the *pattern*, a host that **starts** with the pattern (but has additional segments) will successfully match.\n\nFor example, if the allowlist is configured to `['[example.com](http://example.com/)']`, the function will incorrectly validate `[example.com.bad.com](http://example.com.evil.com/)` as a match:\n1. `host` parts: `['example', 'com', 'bad', 'com']`\n2. `pattern` parts: `['example', 'com']`\n3. `zip` compares `example==example` (OK) and `com==com` (OK).\n4. Iteration stops, and the function returns `True`.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N/E:U"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "bokeh"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.8.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/bokeh/bokeh/security/advisories/GHSA-793v-589g-574v"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-21883"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/bokeh/bokeh/commit/cedd113b0e271b439dce768671685cf5f861812e"
  }, {
    "type" : "WEB",
    "url" : "https://aydinnyunus.github.io/2026/01/24/bokeh-websocket-hijacking-cve-2026-21883"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/bokeh/bokeh"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1385" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-01-06T17:53:44Z",
    "nvd_published_at" : "2026-01-08T02:15:53Z"
  }
}