-
Notifications
You must be signed in to change notification settings - Fork 19.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
BlackDuck reports arbitrary file write vulnerability in "get_file" function #20980
Comments
While true that "thou shalt not" use untrusted upstream data sources, without some more digging I'm not sure why the call to Might be useful to add the See https://docs.python.org/3/library/tarfile.html#tarfile-extraction-filter, using the Sample in reference:
Without more information or proof of exploit it's hard to say if this was a false positive or just someone trolling for extractall references. I'm not a maintainer, but I am also dealing with my SCA tool throwing an alert that needed review. So call me an interested party :) |
@hertschuh you were already looking at this right? |
Took a look, I agree this looks like it may not be an issue? Or at least a naive exploit will not work. Made a tarfile with some https://colab.research.google.com/gist/mattdangerw/6b86708329245670de5bfbcfd5bd52f8/unsafe-tar.ipynb If there is some other way to craft a tarfile that exploits our extraction code we'd need some form of reproduction to fix it (and much appreciated if so). Thanks @zdfowler very much for the help! |
@grimsi take a look at the colab link above, if there's another form of exploit let us know, but this looks to be a false positive to me. |
I also tried this on python 3.9 without triggering an exploit, but it's possible I am not constructing the malicious tarfile correctly. |
Thanks for the investigation @mattdangerw ! You can mark it as false positive in this case. |
I also tried creating tarfiles with absolute references, tested An attacker could get malicious files propagated to disk using this function, but those files all get pushed to local working folder and not to arbitrary places on the system. I think the warning in code in keras/keras/src/utils/file_utils.py Line 201 in 8f5592b
FWIW - I was not able to see the warnings or errors when attempting to re-run the notebook with a new reference to Thanks all! |
Duplicate of #20795 but the original issue has already been closed without resolution.
The issue is still present in our most recent BlackDuck scans.
According to the GitHub security advisory the issue does not originate from Palo Alto Firewalls, but from the "get_file" functionality in Keras. Here is the vulnerable code (according to GH):
keras/keras/src/utils/file_utils.py
Line 115 in 8f5592b
Here is the CVE: https://www.cve.org/CVERecord?id=CVE-2024-55459
It's hard to verify the vulnerability since the original write-up is not accessible any more.
If you require further information I will give my best to provide it.
Any feedback would be appreciated (acknowledgement of the issue or confirmation of a false positive).
Thank you very much in advance!
The text was updated successfully, but these errors were encountered: