CVE-2026-49854: Tornado: Out-of-bounds memory access in C extension

Published Jun 12, 2026
·
Updated

Summary

Tornado's optional native extension tornado.speedups implements websocketmask 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 xsrfcookies=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 TORNADOEXTENSION=0 will disable the vulnerable code (at the expense of reducing websocket performance).

Other sources

Tornado is a Python web framework and asynchronous networking library. Prior to 6.5.6, the optional native extension tornado.speedups implemented websocketmask 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.

MITRE

Affected Software

2 affected componentsFixes available
pip/tornado<6.5.6
6.5.6
IBM Netezza Software<=11.3.0.3-IF2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/tornado to a version that resolves this vulnerability.

    Fixed in 6.5.6
  2. Upgrade

    Upgrade tornado to a version that resolves this vulnerability.

    Fixed in 6.5.6
  3. Configuration

    Set environment variable TORNADO_EXTENSION=0 to disable the vulnerable native extension code prior to upgrading (xsrf_cookies=True will then avoid the native extension path, at the expense of reducing websocket performance).

    Tornado native extension tornado.speedups TORNADO_EXTENSION = 0

Event History

Jun 12, 2026
Advisory Published
via GitHub·06:30 PM
Data Sourced
via GitHub·06:30 PM
DescriptionSeverityWeaknessAffected Software
Jul 14, 2026
CVE Published
via MITRE·08:43 PM
Data Sourced
via MITRE·08:43 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·09:17 PM
DescriptionSeverityWeakness
Aug 20, 2026
Data Sourced
via IBM·12:00 AM
DescriptionAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Frequently Asked Questions

1

What is the severity of CVE-2026-49854?

The severity of CVE-2026-49854 is low with a score of 3.7.

2

How do I fix CVE-2026-49854?

To fix CVE-2026-49854, update to the latest version of Tornado that addresses the vulnerability.

3

What risks does CVE-2026-49854 pose?

CVE-2026-49854 poses a risk of potential memory corruption due to improper handling of the mask argument in the WebSocket implementation.

4

Which versions of Tornado are affected by CVE-2026-49854?

CVE-2026-49854 affects versions prior to the fix included in Tornado version 6.5.6.

5

Is user interaction required to exploit CVE-2026-49854?

No, user interaction is not required to exploit CVE-2026-49854.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203