fix: export file deletion path validation#41008
Conversation
|
Hi @SamJUK. Thank you for your contribution!
Allowed build names are:
You can find more information about the builds here For more details, review the Code Contributions documentation. |
|
The security team has been informed about this pull request due to the presence of risky security keywords. For security vulnerability reports, please visit Adobe's vulnerability disclosure program on HackerOne or email psirt@adobe.com. |
|
@magento run all tests |
|
@magento run Static Tests |
|
@magento run all tests |
3f48ff2 to
e510b7d
Compare
|
@magento run all tests |
Summary
Restrict the Import/Export export-file deletion action to completed export files within
var/export.This brings the delete action in line with the sibling export-file download action, which already canonicalizes the requested filename and permits only valid export files beneath
var/exportThe action now follows the same validation pattern as the sibling download endpoint:
var/export.Scope
This is intentionally a narrow Import/Export filesystem-boundary hardening change.
The existing filesystem directory abstraction already prevents paths from escaping Magento’s
var/directory. Before this change, a relative filename could still resolve outside the intendedvar/exportdirectory and target another file withinvar/.After this change, the delete action is limited to valid completed export artifacts in
var/export. It does not change access control, affect paths outside this Import/Export workflow, or alter normal export-file deletion behaviour.Test coverage
Adds an integration test confirming that a traversal-style filename cannot delete a CSV located outside
var/export.Contribution checklist (*)