{"id":"CVE-2026-49854","aliases":["CVE-2026-49854","GHSA-cx3h-4qpv-8hc9","PYSEC-2026-3388"],"related":[],"kind":"vulnerability","state":"published","title":"Tornado: Out-of-bounds memory access in C extension","summary":"Tornado is a Python web framework and asynchronous networking library. Prior to 6.5.6, the optional native extension tornado.speedups implemented websocket_mask without validating that the mask argument is exactly four bytes, allowing the C function to read up to three bytes beyond the provided buffer when reached through Tornado XSRF token decoding with the native extension active. This issue is fixed in version 6.5.6.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Tornado is a Python web framework and asynchronous networking library. Prior to 6.5.6, the optional native extension tornado.speedups implemented websocket_mask without validating that the mask argument is exactly four bytes, allowing the C function to read up to three bytes beyond the provided buffer when reached through Tornado XSRF token decoding with the native extension active. This issue is fixed in version 6.5.6.","source":"cvelist"},{"lang":"en","text":"### 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).","format":"markdown","source":"ghsa"},{"lang":"es","text":"Tornado es un framework web de Python y una biblioteca de red asíncrona. Antes de la 6.5.6, la extensión nativa opcional tornado.speedups implementaba websocket_mask sin validar que el argumento mask fuera exactamente de cuatro bytes, permitiendo que la función C leyera hasta tres bytes más allá del búfer proporcionado cuando se accedía a ella a través de la decodificación de tokens XSRF de Tornado con la extensión nativa activa. Este problema se solucionó en la versión 6.5.6.","source":"nvd"}],"published":"2026-06-12T18:30:19.000Z","modified":"2026-10-24T21:10:00.130Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","score":5.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","score":5.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N","score":3.7,"rating":"LOW"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N","score":3.7,"rating":"LOW"}],"cwes":["CWE-126"],"affected":[{"ranges":[{"version":"< 6.5.6","status":"affected"}],"vendor":"tornadoweb","product":"tornado","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"6.5.6"}],"ecosystem":"PyPI","package":"tornado","purl":"pkg:pypi/tornado","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"6.5.6"}],"ecosystem":"PyPI","package":"tornado","purl":"pkg:pypi/tornado","source":"pysec"}],"references":[{"url":"https://github.com/tornadoweb/tornado/security/advisories/GHSA-cx3h-4qpv-8hc9","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/tornadoweb/tornado/pull/3626","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/tornadoweb/tornado/commit/96dc88c2a05705287856b2cd6b4b4034f9a6aaac","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/tornadoweb/tornado/releases/tag/v6.5.6","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/tornadoweb/tornado","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/tornado","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-cx3h-4qpv-8hc9","tags":["advisory"],"sources":["pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-49854","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2026-07-15T13:23:13.452Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-49854","url":"https://www.cve.org/CVERecord?id=CVE-2026-49854","licence":"CVE Terms of Use","modified":"2026-07-15T13:26:39.749Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-cx3h-4qpv-8hc9","url":"https://github.com/advisories/GHSA-cx3h-4qpv-8hc9","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:49.232Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-49854","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-49854","licence":"Public domain","modified":"2026-10-24T21:10:00.130Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-3388","url":"https://osv.dev/vulnerability/PYSEC-2026-3388","licence":"CC-BY-4.0","modified":"2026-07-13T16:33:26.790Z"}],"updatedAt":"2026-11-25T22:59:28.231Z","epss":{"score":0.00338,"percentile":0.29163,"date":"2026-12-01T12:00:22.000Z"}}