fat-catTW commented on PR #71832: URL: https://github.com/apache/airflow/pull/71832#issuecomment-5343104765
Thanks for the fix! Could we use `Path.resolve()` for the containment check here, matching the existing GCS/S3 `sync_to_local_dir` guards? `abspath()` catches `..` traversal, but it does not resolve symlinks. For example, if `results_folder/link` is a symlink to a directory outside `results_folder`, a `display_name` like `link/evil` would still pass the `commonpath()` check while writing outside the intended folder. Using `Path(results_folder).resolve()` and checking the resolved target path is relative to that resolved base would make the containment guarantee stronger and align this with the existing guards. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
