← Back to issue list

fix(organize): reject sources outside install dir

View original Github issue

Metadata

Project
craft-parts
Number
#1562
Type
pull request
State
open
Author
gcomneno
Labels
Created
2026-04-25 07:49:12+00:00
Updated
2026-05-20 20:38:46+00:00
Closed

Current evaluation

No evaluation has been recorded for this issue yet.

Issue body

## Summary Reject `organize` source entries that resolve outside the part install directory. This fixes cases where `organize` could read from absolute paths or use directory traversal to escape the install directory. ## Testing - `ruff check craft_parts/executor/organize.py tests/unit/executor/test_organize.py tests/unit/features/partitions/executor/test_organize.py` - `pytest -q tests/unit/executor/test_organize.py -rs` - `pytest -q tests/unit/features/partitions/executor/test_organize.py -rs` ## Notes This keeps normalized in-tree paths working, such as `dir/../foo`, while rejecting absolute and escaping source paths.

Evaluation history

No evaluation history available.