Tornado has out-of-bounds memory access via C extension
Description
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).
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
tornadoPyPI | < 6.5.6 | 6.5.6 |
Affected products
8- Range: < 6.5.6
- osv-coords7 versionspkg:apk/chainguard/airflow-3pkg:apk/chainguard/litellmpkg:apk/chainguard/tensorflow-cpu-jupyterpkg:apk/chainguard/tensorflow-gpu-jupyterpkg:apk/wolfi/airflow-3pkg:apk/wolfi/tensorflow-cpu-jupyterpkg:rpm/opensuse/python-tornado6&distro=openSUSE%20Tumbleweed
< 3.2.2-r4+ 6 more
- (no CPE)range: < 3.2.2-r4
- (no CPE)range: < 1.88.1-r2
- (no CPE)range: < 2.21.0-r5
- (no CPE)range: < 2.21.0-r5
- (no CPE)range: < 3.2.2-r4
- (no CPE)range: < 2.21.0-r5
- (no CPE)range: < 6.5.7-1.1
Patches
Vulnerability mechanics
References
3News mentions
0No linked articles in our index yet.