PYSEC-2026-1223

Vulnerability from pysec - Published: 2026-07-07 16:03 - Updated: 2026-07-07 17:23
VLAI
Details

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.

Impacted products
Name purl
bokeh pkg:pypi/bokeh

{
  "affected": [
    {
      "package": {
        "ecosystem": "PyPI",
        "name": "bokeh",
        "purl": "pkg:pypi/bokeh"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "3.8.2"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ],
      "versions": [
        "0.10.0",
        "0.11.0",
        "0.11.1",
        "0.12.0",
        "0.12.1",
        "0.12.10",
        "0.12.11",
        "0.12.13",
        "0.12.14",
        "0.12.15",
        "0.12.16",
        "0.12.2",
        "0.12.3",
        "0.12.4",
        "0.12.5",
        "0.12.6",
        "0.12.7",
        "0.12.9",
        "0.13.0",
        "0.2",
        "0.3",
        "0.4",
        "0.4.1",
        "0.4.4",
        "0.5.0",
        "0.5.1",
        "0.5.2",
        "0.6.0",
        "0.6.1",
        "0.7.0",
        "0.7.1",
        "0.8.0",
        "0.8.1",
        "0.8.2",
        "0.9.0",
        "0.9.1",
        "0.9.2",
        "0.9.3",
        "1.0.0",
        "1.0.1",
        "1.0.2",
        "1.0.3",
        "1.0.4",
        "1.1.0",
        "1.2.0",
        "1.3.0",
        "1.3.1",
        "1.3.2",
        "1.3.4",
        "1.4.0",
        "2.0.0",
        "2.0.0rc1",
        "2.0.0rc2",
        "2.0.1",
        "2.0.2",
        "2.1.0",
        "2.1.0rc1",
        "2.1.0rc2",
        "2.1.0rc3",
        "2.1.1",
        "2.2.0",
        "2.2.0.dev4",
        "2.2.0.dev6",
        "2.2.0.dev7",
        "2.2.0.dev8",
        "2.2.0rc1",
        "2.2.0rc2",
        "2.2.0rc3",
        "2.2.1",
        "2.2.2",
        "2.2.3",
        "2.3.0",
        "2.3.0.dev1",
        "2.3.0.dev10",
        "2.3.0.dev11",
        "2.3.0.dev12",
        "2.3.0.dev13",
        "2.3.0.dev14",
        "2.3.0.dev2",
        "2.3.0.dev3",
        "2.3.0.dev5",
        "2.3.0.dev7",
        "2.3.0.dev8",
        "2.3.0.dev9",
        "2.3.0rc2",
        "2.3.0rc3",
        "2.3.0rc4",
        "2.3.1",
        "2.3.1.dev1",
        "2.3.1rc1",
        "2.3.1rc2",
        "2.3.2",
        "2.3.2rc1",
        "2.3.3",
        "2.3.3rc1",
        "2.4.0",
        "2.4.0.dev1",
        "2.4.0.dev2",
        "2.4.0.dev4",
        "2.4.0.dev5",
        "2.4.0.dev6",
        "2.4.0.dev7",
        "2.4.0.dev8",
        "2.4.0rc1",
        "2.4.0rc2",
        "2.4.0rc3",
        "2.4.1",
        "2.4.1rc1",
        "2.4.2",
        "2.4.2.dev1",
        "2.4.2rc1",
        "2.4.3",
        "2.4.3.dev1",
        "2.4.3.dev3",
        "2.4.3.dev4",
        "2.4.3rc1",
        "3.0.0",
        "3.0.0.dev1",
        "3.0.0.dev10",
        "3.0.0.dev11",
        "3.0.0.dev13",
        "3.0.0.dev14",
        "3.0.0.dev15",
        "3.0.0.dev16",
        "3.0.0.dev17",
        "3.0.0.dev18",
        "3.0.0.dev19",
        "3.0.0.dev2",
        "3.0.0.dev20",
        "3.0.0.dev3",
        "3.0.0.dev4",
        "3.0.0.dev5",
        "3.0.0.dev6",
        "3.0.0.dev7",
        "3.0.0.dev8",
        "3.0.0.dev9",
        "3.0.0rc1",
        "3.0.0rc2",
        "3.0.0rc3",
        "3.0.0rc4",
        "3.0.0rc5",
        "3.0.0rc6",
        "3.0.1",
        "3.0.1rc1",
        "3.0.2",
        "3.0.2rc1",
        "3.0.3",
        "3.0.3rc1",
        "3.1.0",
        "3.1.0.dev1",
        "3.1.0.dev2",
        "3.1.0.dev3",
        "3.1.0.dev4",
        "3.1.0.dev5",
        "3.1.0rc1",
        "3.1.0rc2",
        "3.1.0rc3",
        "3.1.1",
        "3.1.1rc1",
        "3.2.0",
        "3.2.0.dev1",
        "3.2.0.dev2",
        "3.2.0.dev3",
        "3.2.0.dev4",
        "3.2.0rc1",
        "3.2.0rc2",
        "3.2.0rc3",
        "3.2.1",
        "3.2.2",
        "3.2.2rc1",
        "3.3.0",
        "3.3.0.dev1",
        "3.3.0.dev2",
        "3.3.0.dev3",
        "3.3.0rc1",
        "3.3.0rc2",
        "3.3.0rc3",
        "3.3.1",
        "3.3.1.dev1",
        "3.3.1rc1",
        "3.3.2",
        "3.3.3",
        "3.3.4",
        "3.3.4rc1",
        "3.4.0",
        "3.4.0.dev1",
        "3.4.0.dev2",
        "3.4.0.dev3",
        "3.4.0.dev4",
        "3.4.0.dev5",
        "3.4.0.dev6",
        "3.4.0.dev7",
        "3.4.0.dev8",
        "3.4.0rc1",
        "3.4.0rc2",
        "3.4.1",
        "3.4.2",
        "3.4.3",
        "3.5.0",
        "3.5.0.dev1",
        "3.5.0.dev3",
        "3.5.0.dev4",
        "3.5.0.dev5",
        "3.5.0.dev6",
        "3.5.0.dev7",
        "3.5.0.dev8",
        "3.5.0rc1",
        "3.5.0rc2",
        "3.5.1",
        "3.5.2",
        "3.6.0",
        "3.6.0.dev1",
        "3.6.0rc1",
        "3.6.0rc2",
        "3.6.1",
        "3.6.2",
        "3.6.3",
        "3.6.3rc1",
        "3.6.3rc2",
        "3.7.0",
        "3.7.0.dev1",
        "3.7.0.dev2",
        "3.7.0.dev3",
        "3.7.0.dev4",
        "3.7.0.dev5",
        "3.7.0.dev6",
        "3.7.0.dev7",
        "3.7.0.dev8",
        "3.7.0.dev9",
        "3.7.0rc1",
        "3.7.0rc2",
        "3.7.1",
        "3.7.2",
        "3.7.3",
        "3.7.3rc1",
        "3.7.3rc2",
        "3.8.0",
        "3.8.0.dev1",
        "3.8.0.dev2",
        "3.8.0.dev3",
        "3.8.0.dev4",
        "3.8.0rc1",
        "3.8.0rc2",
        "3.8.1"
      ]
    }
  ],
  "aliases": [
    "CVE-2026-21883",
    "GHSA-793v-589g-574v"
  ],
  "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\u0027s `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 `[\u0027[example.com](http://example.com/)\u0027]`, the function will incorrectly validate `[example.com.bad.com](http://example.com.evil.com/)` as a match:\n1. `host` parts: `[\u0027example\u0027, \u0027com\u0027, \u0027bad\u0027, \u0027com\u0027]`\n2. `pattern` parts: `[\u0027example\u0027, \u0027com\u0027]`\n3. `zip` compares `example==example` (OK) and `com==com` (OK).\n4. Iteration stops, and the function returns `True`.",
  "id": "PYSEC-2026-1223",
  "modified": "2026-07-07T17:23:51.738286Z",
  "published": "2026-07-07T16:03:16.722803Z",
  "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"
    },
    {
      "type": "PACKAGE",
      "url": "https://pypi.org/project/bokeh"
    },
    {
      "type": "ADVISORY",
      "url": "https://github.com/advisories/GHSA-793v-589g-574v"
    }
  ],
  "severity": [
    {
      "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",
      "type": "CVSS_V4"
    }
  ],
  "summary": "Bokeh server applications have Incomplete Origin Validation in WebSockets"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline

Sightings and recorded dates, grouped by day · UTC

JSON
How durations are calculated

Following the VTEM framework (Black Hat USA 2015), time to patch starts when the vendor or a coordinator was informed, total time to patch at discovery, and disclosure to patch at public disclosure; vendor response time runs from the report to its acknowledgement. Time to exploit and time unpatched start at the earliest discovery or report, falling back to public disclosure. Unpatched time ends at the first recorded patch, or the calculation time when no patch is recorded. Exploitation to patch shows the interval between those two events; a published proof of concept is a public exploit, not exploitation. The method is described in a publication.

Each result shows its source dates. A negative interval means the end event came first; when date-only inputs leave the order open, the result says so. Date-only inputs are approximate. The earliest evidence wins: KEV report dates and sightings are labelled as such. Records describing another vulnerability are listed but never calculated from, and a PoC alone does not establish exploitation. Missing patch evidence does not prove that no patch exists. Filters below change the event list only.

Events included in the timeline

Loading timeline…


    Loading…

    Loading…

    Loading…

    Related by attack behaviour

    Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.