Skip to content

prevent path traversal in ObjectStoragePath recursive copy to local#69850

Open
Samin061 wants to merge 1 commit into
apache:mainfrom
Samin061:objectstorage-copy-path-traversal
Open

prevent path traversal in ObjectStoragePath recursive copy to local#69850
Samin061 wants to merge 1 commit into
apache:mainfrom
Samin061:objectstorage-copy-path-traversal

Conversation

@Samin061

Copy link
Copy Markdown
Contributor

ObjectStoragePath.copy() delegates a recursive remote-to-local transfer straight to fsspec's fs.get, so object keys containing .. segments (which anyone able to write to the source prefix controls) are followed verbatim and land outside the destination directory. Add a containment check on the recursive remote-to-local branch that expands the source keys and refuses any whose resolved local path escapes the destination, matching the guards already in the S3 and GCS sync_to_local_dir helpers. Non-recursive and same-store copies are untouched, so valid transfers behave exactly as before.


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant