CVE-2026-49854: Tornado Tornado Has Out-of-bounds Memory Access Vulnerability

LOW
Advisory Identifier: GHSA-cx3h-4qpv-8hc9
CVSS 3.7
CWE-126
Published
Advisory Summary

CVE-2026-49854 is a LOW (CVSS 3.7) tornado has out-of-bounds memory access vulnerability (CWE-126: Buffer Over-read) affecting Tornado libraries in the PyPI ecosystem. The issue involves tornado has out-of-bounds memory access via c extension. Remediation is available by upgrading affected packages to version 6.5.6.

CVE-2026-49854 at a Glance

CVE Identifier CVE-2026-49854
GHSA Identifier GHSA-cx3h-4qpv-8hc9
Severity LOW
CVSS v3.1 Base Score 3.7
CWE Classification CWE-126: Buffer Over-read
Affected Product Tornado
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 3.7

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2026-49854

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

tornado fixed: 6.5.6
pip install tornado>=6.5.6
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 tornado

How to Check if You Are Affected

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

pip show tornado

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-126: Buffer Over-read, where the product reads from a buffer using buffer access mechanisms such as indexes or pointers that reference memory locations after the targeted buffer. In Tornado, 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

### Summary Tornado's optional native extension `tornado.speedups` implements `websocket_mask` without validating that the `mask` argument is exactly four bytes long. The C function reads four bytes from `mask` unconditionally, even when Python passes a shorter byte string. This can read beyond the provided buffer, exposing up to 3 bytes of uninitialized memory. The behavior is reachable from Tornado's XSRF token decoder when `xsrf_cookies=True` and the native extension is active. ### Mitigations This bug is fixed in Tornado 6.5.6. Prior to upgrading to this version, setting the environment variable TORNADO_EXTENSION=0 will disable the vulnerable code (at the expense of reducing websocket performance).

CVE-2026-49854 Affected Tornado Versions

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

References

Frequently Asked Questions

What is CVE-2026-49854?
CVE-2026-49854 is a security vulnerability in Tornado involving Tornado has out-of-bounds memory access via C extension under CWE-126: Buffer Over-read.
Which Tornado versions are affected?
Affected versions include releases prior to 6.5.6 across affected packages: tornado.
What version fixes CVE-2026-49854?
Upgrading to 6.5.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is tornado affected?
Yes, tornado is affected in releases prior to 6.5.6. Upgrade your dependency to 6.5.6 or later.
What is the CVSS score of CVE-2026-49854?
CVE-2026-49854 has a CVSS v3.1 base score of 3.7 (LOW) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2026-49854?
CVE-2026-49854 is classified under CWE-126: Buffer Over-read (The product reads from a buffer using buffer access mechanisms such as indexes or pointers that reference memory locations after the targeted buffer.).
How can I check PyPI dependencies for CVE-2026-49854?
Run the dependency tree command: 'pip show tornado'. 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-cx3h-4qpv-8hc9",
  "modified" : "2026-06-12T18:30:19Z",
  "published" : "2026-06-12T18:30:19Z",
  "aliases" : [ "CVE-2026-49854" ],
  "summary" : "Tornado has out-of-bounds memory access via C extension",
  "details" : "### Summary\n\nTornado's optional native extension `tornado.speedups` implements `websocket_mask` without validating that the `mask` argument is exactly four bytes long. The C function reads four bytes from `mask` unconditionally, even when Python passes a shorter byte string. This can read beyond the provided buffer, exposing up to 3 bytes of uninitialized memory.\n\nThe behavior is reachable from Tornado's XSRF token decoder when `xsrf_cookies=True` and the native extension is active. \n\n### Mitigations\n\nThis bug is fixed in Tornado 6.5.6. Prior to upgrading to this version, setting the environment variable TORNADO_EXTENSION=0 will disable the vulnerable code (at the expense of reducing websocket performance).",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "tornado"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.5.6"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/tornadoweb/tornado/security/advisories/GHSA-cx3h-4qpv-8hc9"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/tornadoweb/tornado"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/tornadoweb/tornado/releases/tag/v6.5.6"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-126" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-12T18:30:19Z",
    "nvd_published_at" : null
  }
}