CVE-2026-49854
Python vulnerability analysis and mitigation

Overview

CVE-2026-49854 is a buffer over-read vulnerability in the optional native C extension (tornado.speedups) of the Tornado Python web framework. The websocket_mask function in the C extension fails to validate that the mask argument is exactly four bytes, allowing it to read up to three bytes beyond the provided buffer. This flaw is reachable through Tornado's XSRF token decoder when xsrf_cookies=True and the native extension is active. All versions of Tornado prior to 6.5.6 are affected. The vulnerability was discovered by Thai Son Dinh from VinSOC Labs (R&D), published on May 27, 2026, and assigned a CVSS v3.1 base score of 5.3 (Medium) by NVD, or 3.7 (Low) per the GitHub Advisory (Github Advisory, Tornado Advisory).

Technical details

The root cause is classified as CWE-126 (Buffer Over-read) and CWE-125 (Out-of-bounds Read). In tornado/speedups.c, the websocket_mask C function accepted the mask parameter via PyArg_ParseTuple without checking that mask_len == 4; it then unconditionally cast mask to a uint32_t* and dereferenced it, reading exactly four bytes regardless of the actual buffer length. When Python passes a byte string shorter than four bytes (as can occur during XSRF token decoding), the C function reads one to three bytes past the end of the allocated buffer, potentially exposing uninitialized heap memory. The fix, applied in commit 96dc88c, adds an explicit length check that raises a ValueError if mask_len != 4, and the same guard was added to the pure-Python fallback in util.py (Tornado Advisory, Fix Commit).

Impact

Successful exploitation can expose up to three bytes of uninitialized heap memory to a remote, unauthenticated attacker, resulting in a limited confidentiality impact. The leaked memory could theoretically contain sensitive data such as cryptographic material, session tokens, or other in-process secrets, though the practical exploitability of obtaining meaningful data is constrained by the small leak size and memory layout unpredictability. There is no integrity or availability impact; the vulnerability does not enable code execution or denial of service (Github Advisory, Tornado Advisory).

Exploitability

No public proof-of-concept exploit code or in-the-wild exploitation has been reported for this vulnerability. The NVD SSVC assessment classifies exploitation as "none" and the vulnerability as automatable. The EPSS score is approximately 0.034–0.338% (26th percentile), indicating a low probability of exploitation in the near term. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog (Github Advisory).

Mitigation and workarounds

The vulnerability is fixed in Tornado 6.5.6, released May 27, 2026. Users should upgrade immediately via pip install tornado>=6.5.6. As a temporary workaround prior to upgrading, setting the environment variable TORNADO_EXTENSION=0 disables the native C extension entirely, eliminating the vulnerable code path at the cost of reduced WebSocket performance. The vulnerability only affects deployments where both the native extension (tornado.speedups) is compiled and installed, and xsrf_cookies=True is configured (Github Advisory, Tornado Release). SUSE has also issued security updates for its python-tornado6 and python-tornado packages (SUSE Advisory).

Community reactions

The vulnerability was reported by Thai Son Dinh from VinSOC Labs (R&D) and acknowledged by Tornado maintainer bdarnell in the official security advisory. OpenSUSE and SUSE issued security announcements and package updates for their distributions. Security news outlet SecurityOnline.info covered the broader set of Tornado 6.5.6 security fixes. No significant social media controversy or widespread community debate has been observed, consistent with the moderate/low severity rating (Tornado Advisory, SUSE Advisory).

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

Debian

Affected

bookworm

python-tornado

Affected

sid

python-tornado

Affected

trixie

python-tornado

Affected

Ubuntu

Unknown

bionic (esm-apps)

python-tornado

Unknown

devel

python-tornado

Unknown

focal (esm-apps)

python-tornado

Unknown

jammy

python-tornado

Unknown

jammy (esm-apps)

python-tornado

Unknown

noble

python-tornado

Unknown

resolute

python-tornado

Unknown

xenial (esm-infra-legacy)

python-tornado

Unknown

RHEL / CentOS

Affected

OpenShift

python-tornado.src

Affected

RHEL 8

pcs.src

Affected

RHEL 9

python-tornado.src

Affected

RHEL 10

python-tornado.src

Affected

SourceThis report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-66455CRITICAL9.8
  • Python logoPython
  • lmdeploy
NoYesSep 18, 2026
CVE-2026-63374CRITICAL9.3
  • Python logoPython
  • airflow-3
NoYesSep 18, 2026
CVE-2026-59163CRITICAL9.1
  • Python logoPython
  • mnemosyne-memory
NoYesSep 18, 2026
CVE-2026-33625HIGH8.8
  • Python logoPython
  • lmdeploy
NoYesSep 18, 2026
CVE-2026-64847MEDIUM6.8
  • Python logoPython
  • py3-anyio
NoYesSep 18, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management