fix: sanitize GCS blob names to prevent path traversal in skill loading#5281
fix: sanitize GCS blob names to prevent path traversal in skill loading#5281BISHT-CX wants to merge 12 commits intogoogle:mainfrom
Conversation
Refactor blob path handling to prevent path traversal vulnerabilities.
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Added path traversal protection in _materialize_and_run function.
Added checks for absolute paths and updated path traversal detection.
Refactor _load_files_in_dir to use dict type hints and PurePosixPath for path validation.
|
"Updated PR #5281 — defense in depth implemented. Both ingestion-time (_utils.py via PurePosixPath) and execution-time (skill_toolset.py via realpath + commonpath) protections verified locally against original PoC. Malicious paths blocked at source before execution. Safe paths unaffected." |
|
Hi @BISHT-CX , Thank you for your contribution! We appreciate you taking the time to submit this pull request. Please fix formatting errors by running autoformat.sh |
|
sure , lemme start working on it , will update in few minutes / hours |
|
Done! Ran autoformat.sh pyink and isort fixes are pushed. Checks should be green now. |
Link to Issue:
Problem:
Solution:
Testing Plan — Manual E2E:
For the checkboxes — only check the ones that are true:
Tested the path traversal logic manually via standalone PoC script
replicating ADK's blob name handling. Full ADK runtime E2E test
not performed. PoC available in linked VRP report (Issue 499557362).