PYSEC-2026-3388
Tornado has out-of-bounds memory access via C extension
En bref
- Publiée
- Mise à jour
- CVE
- CVE-2026-49854
- Alias
- GHSA-cx3h-4qpv-8hc9
- CVSS_V3
- CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N
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).
Paquets affectés
| Paquet | Versions |
|---|---|
| PyPI · tornado | introduced 0, fixed 6.5.6 |
Références
- https://github.com/tornadoweb/tornado/security/advisories/GHSA-cx3h-4qpv-8hc9 WEB
- https://github.com/tornadoweb/tornado PACKAGE
- https://github.com/tornadoweb/tornado/releases/tag/v6.5.6 WEB
- https://pypi.org/project/tornado PACKAGE
- https://github.com/advisories/GHSA-cx3h-4qpv-8hc9 ADVISORY
- https://nvd.nist.gov/vuln/detail/CVE-2026-49854 ADVISORY
Sources
| Source | Licence |
|---|---|
| OSV.dev | CC-BY 4.0 — PyPA Advisory Database |