Harden S3 sync target paths#67847
Conversation
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
|
8a12b7c to
04d72c6
Compare
shahar1
left a comment
There was a problem hiding this comment.
Please fix the PR's description, including adding declaration for using AI according to the guidelines.
4370590 to
2c4e1f0
Compare
|
Thanks for the review. I updated the PR description to include the required Gen-AI disclosure and refreshed the validation notes. I also rebased the branch onto current main and force-pushed clean history, so the PR now contains only the two intended noreply-authored commits. Local validation after the rebase:
|
|
Hi @shahar1, I updated the PR description with the Gen-AI disclosure and validation notes, then rebased/pushed the clean branch. The visible checks are green now. Could you take another look when you have a chance? |
|
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
S3Hook.sync_to_local_dir() derives local target paths from object keys after removing the configured prefix. Current upstream already contains the analogous GCS guard; this PR applies the same containment check to S3 sync targets.
The change resolves each candidate S3 download target and rejects keys that would land outside the requested local directory before creating parent directories or downloading content.
Regression coverage adds a traversal-shaped S3 object key under the requested prefix.
Validation performed locally:
The focused pytest command could not run in this local checkout because the Airflow pytest plugin dependency time_machine is not installed in the current environment.
Gen-AI disclosure:
Important
🛠️ Maintainer triage note for @dfgvaetyj3456356-hash · by
@potiuk· 2026-06-12 11:23 UTCSome review feedback from
@shahar1is waiting on you:@shahar1requested changes, but the review hasn't been followed up.The ball is in your court — you've been assigned to this PR. Address the outstanding comments (reply or push a fix), then ping the reviewer for a re-review.
Automated triage — may be imperfect; a maintainer takes the next look.