-
-
Notifications
You must be signed in to change notification settings - Fork 194
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
safety problem #257
Comments
Watching this as well, it's not really an issue with flask-caching directly but rather it's use of Pickle for serialization (it's the usage of Pickle that creates the vulnerability) - the CVE is https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-33026 and for whatever its worth, there are many (many!) other libraries that share the same "vulnerability" and many have disputed that, Flask-Caching has not. |
@tbarrettwilsdon is there a opportunity to change default serialization format to xml/json(using ujson/orjson), but saving an option to keep current pickle serialization? |
@tbarrettwilsdon |
There is an open merge request for this issue: #209 Thanks to this MR, we would be able to choose which serializer we want to use with Flask-Caching. |
Is this likely to be fixed or the MR above merged soon? This is causing me problems with an upstream component requiring Flask-Caching as a dependency. |
IMHO the CVE is bogus. If someone has write access to your cache's storage, you are most likely already compromised. So it's perfectly fine and safe to use this extension (or a component using it) as long as your environment is properly configured and secured (ie don't expose your redis/memcached to untrusted users or the internet, and don't let untrusted users write arbitrary files on your server if you use file-based storage) |
I agree mostly, but there is the odd chance that an attacker can somehow manipulate cached values without having already enough privileges to execute arbitrary Python code (as the flask app user). Essentially this turns any cache poisoning attack into an arbitrary code execution attack. |
AFAIK cache poisoning usually means caching user-controlled data through some vulnerability (e.g. in order to serve bad data to other users), but not being able to write raw data to the cache backend through other means.. |
Ok, I might have used the word “cache poisoning“ wrongly. The thought still applies. Write access to the cache backend doesn’t imply the ability to execute arbitrary code (or even access as a local user). So this could be used for privilege escalation. |
Means of avoiding pickle by using custom serialization strategies have being added to |
docker image:
python:3.9.5-slim
apache-airflow==2.1.0
The text was updated successfully, but these errors were encountered: