smartcontractkit / smartcontractkit/chainlink

[BUG] Validate extraction paths in downloadProgramArtifacts to prevent path traversal

Open
#21,003 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.