Inadequate Cookie Attribute Validation in Tornado Package
Summary
GHSA-78cv-mqj4-43f7: Tornado has incomplete validation of cookie attributes. Affects tornado versions < 6.5.5. Fixed in 6.5.5. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Tornado is a scalable, non-blocking web server and web application framework for Python. It is designed to handle thousands of simultaneous connections, making it ideal for real-time web services. Tornado's RequestHandler class provides methods for handling HTTP requests, including the ability to set cookies. However, prior to version 6.5.5, Tornado had a vulnerability that allowed incomplete validation of cookie attributes, potentially leading to security issues.
Vulnerability Detail
The vulnerability arises from Tornado's insufficient validation of the 'domain', 'path', and 'samesite' arguments in the RequestHandler.set_cookie method. Attackers could exploit this flaw by injecting semicolons into these arguments, which could lead to the injection of malicious values for other cookie attributes. This could compromise the integrity of the cookies and allow attackers to manipulate session data or perform cross-site scripting attacks.
How To Fix
Latest published version: 6.6.0 as of 23 Oct 2026
pip install --upgrade "tornado==6.6.0"
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
6.5.5
This is the first release that contains the fix.
pip install --upgrade "tornado==6.5.5"
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, you can manually validate the cookie attributes before passing them to the set_cookie method. Ensure that the values for 'domain', 'path', and 'samesite' do not contain semicolons or any other potentially harmful characters.
Conclusion
The incomplete validation of cookie attributes in Tornado prior to version 6.5.5 poses a significant security risk. It is crucial for developers using this package to update to the latest version to mitigate potential vulnerabilities. Additionally, implementing manual validation of cookie attributes can serve as a temporary measure until the update is applied.
See every vulnerability recorded for tornado →
FAQ
Versions of Tornado prior to 6.5.5 are affected by this vulnerability.
The risks include the possibility of cookie manipulation, session hijacking, and cross-site scripting attacks.
You can use Vulert's playground at Vulert Scanner to check if your application is affected without needing to sign up.
Yes, Vulert can monitor and alert you in real-time for open-source vulnerabilities in your software using just the Pipfile.lock.
The CVSS score of this vulnerability is 5.4, indicating a moderate severity level.
References
Related vulnerabilities
Recent vulnerabilities recorded for tornado.