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

   `_is_escaping_current_directory` in the imap hook rejects a traversing 
attachment name with `f"..{os.sep}" in name`, which is tied to the host 
separator. On Windows `os.sep` is a backslash but a forward slash is also a 
valid path separator, so an attachment named `../../evil` slips past the check 
and, once joined onto the output directory in `_correct_path`, resolves outside 
it, letting whoever sent the mail write an arbitrary file. This normalises both 
separators and rejects any `..` path component instead.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [ ] Yes (please specify the tool below)
   
   ---
   
   * Read the **[Pull Request 
Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)**
 for more information.


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