component manifest paths can escape the toolchain install prefix
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 1.1k
- Avg merge
- 22h 40m
- Merged PRs (30d)
- 46
Description
manifest.in component paths appear to be trusted after decoding. ComponentPart::decode() converts the path string directly into a PathBuf, and transaction operations only guard with relpath.is_relative(). However, paths containing parent components like ../outside are still relative.
Those paths are later joined with the install prefix via InstallPrefix::abs_path(), so a component manifest entry such as:
file:../outside-file
can target a path outside the toolchain directory during install. Those paths are persisted into component manifests and can later be used during uninstall; rollback also uses the recorded transaction paths.
Ideally, component manifest paths should be confined to the toolchain install prefix. Absolute paths, prefix paths, empty paths, and paths containing .. should be rejected as corrupt component manifests.
It may also be worth validating that the package source path stays under the extracted package root.
Ref:
- #4179 normalized component path separators, but does not appear to reject parent-directory components or enforce prefix containment.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with ComponentPart::decode() in src/dist/component/components.rs and the guards in src/dist/component/transaction.rs, then trace InstallPrefix::abs_path() and the recorded paths used by install, uninstall, and rollback. Add coverage for corrupt manifest paths and verify that absolute, empty, prefix, and parent-containing paths cannot escape the install prefix; also inspect package-source containment under the extracted root.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- security, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100