potiuk opened a new pull request, #67857:
URL: https://github.com/apache/airflow/pull/67857

   GCS object names are read from the source bucket and may contain `..` path 
segments. `GCSToSambaOperator._resolve_destination_path` joined the object name 
onto the configured `destination_path` without normalisation, so a crafted 
object name (e.g. `../../elsewhere/file`) could resolve an SMB write target 
outside the intended directory.
   
   This normalises the resolved path and raises `AirflowException` when it 
would fall outside `destination_path`, so transfers always write within the 
configured destination.
   
   ### Tests
   - [x] `test_resolve_destination_path_rejects_traversal` — `..` object names 
raise
   - [x] `test_resolve_destination_path_allows_contained_object` — normal 
objects still resolve under `destination_path`
   - [x] existing operator tests unchanged (25 passed)
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Opus 4.8 (1M context)
   
   Generated-by: Claude Opus 4.8 (1M context) following the guidelines at
   
https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions
   


-- 
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]

Reply via email to