-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vulnerability CVE-2020-28476 detected by PyUp's Safety scan #2981
Comments
This CVE is mis-assigned - the relevant code is in the python standard library, not Tornado. I'd also argue that this kind of issue is fundamentally a problem of a cache that makes bad assumptions about how the backend handles requests (as in this post discussing the issue as a cache implementation flaw).
Which proxies behave like this in their default configuration? |
So it's clear, I was not involved in creating or assigning the CVE, I just noticed it and wanted to make sure you were aware it exists since I saw no other tickets here about it. According to the NIST CVE it's still under analysis - Snyk has a blog post concerning their methodology (I take it they concocted tests and started opening CVEs). |
The related blog post is a good read, but I think the only thing Tornado could do is to discourage use of methods that can lead to security issues (eg. use get_query_argument vs get_argument) and possibly limit access to request body on get requests (if I understand the article, that's already done, but not released yet). Quick test of the body override on get (sorry for the old coroutine based code):
|
ci: ignore tornado vulnerability There is currently no fix [#2981](tornadoweb/tornado#2981). ci: remove safety pre-commit I don't have time right now to check how to configure it to ignore some alerts
Ignore tornado/39462 as there is currently no fix (#178) See tornadoweb/tornado#2981
Note that there are two separate issues in the snyk blog post: semicolons as URI parameter delimiters and "fat GETs". Only the first one is covered by CVE-2020-28476. I'm not sure why; the "fat GET" issue is more properly considered misbehavior on the part of Tornado (it's misbehavior that was explicitly requested by multiple users, but I agree we need to get rid of it).
It's not done yet, but I will probably introduce a flag like the |
Hi guys, any update on this? |
The issue identified by CVE-2020-28476 is in the python standard library, not Tornado, so any updates will be in https://bugs.python.org/issue42967 and not here. I've never interacted with the CVE system so I don't know how to get this attributed properly (@AdamGold can you help with this?). There is a separate issue around "fat GETs" which doesn't appear to have a CVE but is discussed in the snyk blog post. There will be changes to address this in a future release of Tornado but there is no timeline for this (it does not, IMO, warrant an emergency security release). If you are affected by web cache poisoning issues you should address this primarily by looking at your cache - any caching proxy which forwards information to the backend which is not to be used in the construction of the response is inherently vulnerable to poisoning; this should be fixed in the cache to block the entire class of vulnerabilities rather than expecting absolute consistency of behavior across all possible backends. For example, proxies that receive fat GETs should either reject those requests or incorporate the body into their cache key. For the semicolon issue it may be a little more complicated but the general idea is that the cache should transform the request url to its cache-key form before forwarding it to the backend. |
Hey @bdarnell 😄 The CVE is not mis-assigned, we do think that Tornado should be using a different method for parsing the query args (see Werkzeug implementation for example). This is because once upstream Python is fixed, all implementations under Python 3.10 would still be vulnerable. |
Otherwise the update pipeline fails due to the tornadoweb issue [#2981](tornadoweb/tornado#2981)
Otherwise the update pipeline fails due to the tornadoweb issue [#2981](tornadoweb/tornado#2981)
Otherwise the update pipeline fails due to the tornadoweb issue [#2981](tornadoweb/tornado#2981)
Otherwise the update pipeline fails due to the tornadoweb issue [#2981](tornadoweb/tornado#2981)
tornadoweb/tornado#2981 It looks like this is an issue for upstream python but we'll watch this ticket and see what develops.
Conversely, when it is fixed in python 3.10, and the next security patch releases of 3.9.x, 3.8.x, etc, it will be fixed for everyone without any changes on the Tornado side. Are you implying that the python security team does not intend to patch this change into older branches? If they do not accept this issue as a security bug requiring a backported fix, why should Tornado decide differently? If tornado changes our code to not use There are two ways to solve the web cache poisoning problem: either every web server everywhere parses URLs in exactly the same way, or proxies code defensively and don't send backends information that is not a part of the cache key. Asking Tornado to reimplement URL parsing seems like a counterproductive effort towards the former goal. It may help push semicolon parsing out of existence faster, but in the long run it'd be another implementation that would have to be tested for conformance with the specs and consistency with the proxies. |
tornadoweb/tornado#2981 Appears to be an issue with upstream python. The developers do not intend to fix it.
That's a fair point.
I absolutely agree. Python manages their own advisories and CVEs, one will come when they fix it I assume.
I'm thinking about revoking the CVE as soon as Python publishes their own CVE. What do you think? |
Details: * This change ignores the recently created safety issue 39462, because according to discussion in tornadoweb/tornado#2981 the CVE against tornado that is behind this safety issue, will be closed once a similar CVE against Python has been created. Signed-off-by: Andreas Maier <[email protected]>
Details: * This change ignores the recently created safety issue 39462, because according to discussion in tornadoweb/tornado#2981 the CVE against tornado that is behind this safety issue, will be closed once a similar CVE against Python has been created. Signed-off-by: Andreas Maier <[email protected]>
Python CVE has been published: https://snyk.io/vuln/SNYK-UPSTREAM-PYTHONCPYTHON-1074933 |
Thanks, Adam. I'm going to leave this issue open for a little while in case people are still searching for it until the CVE is revoked. |
For the logs: i pinged pyup.io about this, got this answer:
:) |
pyup.io has revoked the vulnerability tornadoweb/tornado#2981
Safety (https://pyup.io/safety/) alerted us to the following vulnerability today:
No fixed version exists currently.
This tracks to https://nvd.nist.gov/vuln/detail/CVE-2020-28476 which leads us to https://snyk.io/vuln/SNYK-PYTHON-TORNADO-1017109 , which has a more detailed analysis, pasted below for convenience:
The text was updated successfully, but these errors were encountered: