Vulnerabilities in pkg:pypi/bokeh
PACKAGECVE-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.
pkg:pypi/bokeh
Vulnerability advisories affecting package pkg:pypi/bokeh. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-793v-589g-574v | CVE-2026-21883 | MODERATE | Bokeh server applications have Incomplete Origin Validation in WebSockets |
CVE-2026-21883 at a Glance
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.
pip install bokeh>=3.8.2
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
CVE-2026-21883 Affected Bokeh Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
bokeh
|
PyPI |
< 3.8.2
|
3.8.2
|
References
Frequently Asked Questions
What is CVE-2026-21883?
Which Bokeh versions are affected?
What version fixes CVE-2026-21883?
Is bokeh affected?
What CWE is associated with CVE-2026-21883?
How can I check PyPI dependencies for CVE-2026-21883?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}