smartcontractkit / smartcontractkit/chainlink
[BUG] Validate extraction paths in downloadProgramArtifacts to prevent path traversal
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 8.2k
- Forks
- 2k
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 202
Description
Description
The function downloadProgramArtifacts in deployment/utils/solutils/artifacts.go extracts files from archives without validating that the destination paths stay within the target directory. This makes the system vulnerable to Zip Slip (Path Traversal via archive extraction), where a malicious archive can overwrite arbitrary files on the system if they have names like ../../etc/passwd.
Impact
An attacker providing a malicious artifact URL could potentially achieve Remote Code Execution (RCE) or system compromise by overwriting critical system files or binaries.
Proposed Fix
Implement a prefix check using filepath.Clean to ensure all extracted file paths are children of the intended target directory.
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 in deployment/utils/solutils/artifacts.go at downloadProgramArtifacts and trace how archive entries become destination paths. Read the surrounding extraction logic, then run the relevant package tests while checking traversal-style archive names. Done means extracted paths remain within the intended target directory and existing artifact downloads continue to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100