← Back to issue list

Improve detection/setting of the PATH environment variable

View original Github issue

Metadata

Project
rockcraft
Number
#729
Type
issue
State
open
Author
tigarmo
Labels
good first issue
Created
Updated
Closed

Current evaluation

Rockcraft issue to generalize empty-PATH detection beyond bare-based rocks; set_default_path still only handles bare. Labeled good first issue, last activity 381 days ago. A contributor claimed #725 fixed it, but code confirms it's unfixed.

Suggested action: keep open

Reason: The issue is triaged (labeled 'good first issue' by maintainer tigarmo) and still valid: rockcraft/oci.py set_default_path() still early-returns for any base != 'bare' (line ~410), so the requested generalization to detect an empty PATH on any base is unimplemented. The last comment (RafaelJohn9, 2025-05-19) claiming it is 'fixed in #725' is incorrect — #725 is the PR that introduced the bare-only behavior, not a fix for this generalization.

Impact: 45 Quick Win: 31.5 Staleness: 65 Complexity: 30 Confidence: 75 Support Request: 10

Issue body

### What needs to get done The [current code](https://github.com/canonical/rockcraft/blob/main/rockcraft/oci.py#L392) that prevents empty PATH vars only activates on bare-based rocks; as [Cris points out](https://github.com/canonical/rockcraft/pull/725#discussion_r1793270914) we could improve this to cover any case where the PATH is empty to protect ourselves in the case of future changes or new bases. ### Why it needs to get done The empty PATH is a security vulnerability; generalizing the detection and handling of this case improves the robustness of the code.

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 45
Quick Win: 31.5
Staleness: 65
Complexity: 30
Confidence: 75
Support Request: 10
keep open Rockcraft issue to generalize empty-PATH detection beyond bare-based rocks; set_default_path still only handles bare. Labeled good first issue, last activity 381 days ago. A contributor claimed #725 fixed it, but code confirms it's unfixed.
qwen/qwen3.6-35b-a3b
Staleness: 75
Complexity: 20
Confidence: 85
Support Request: 10
close stale Requests generalizing empty PATH detection for security. Labeled good first issue. Appears resolved by PR #725, but remains open due to lack of maintainer action. Last activity 340 days ago.
qwen3.6-35b-a3b-mtp-q6
Staleness: 10
Complexity: 15
Confidence: 90
Support Request: 0
close stale Issue requests generalizing PATH environment variable validation to cover all bases for security. Last comment indicates it appears resolved by PR #725.
qwen3.6-35b-a3b-mtp-q6
Staleness: 80
Complexity: 15
Confidence: 90
Support Request: 0
close stale Requests generalizing empty PATH detection for security. Marked as fixed in PR #725 by a contributor, currently inactive awaiting closure.
qwen3.6-35b-a3b-mtp-q6
Staleness: 75
Complexity: 20
Confidence: 90
Support Request: 10
close stale Generalize empty PATH environment variable detection and handling for improved security across all bases. Claimed by a contributor, but another user notes it appears already fixed in PR #725. Requires verification and closure.

Update history

No update history recorded yet.

Related work

  • Related To: canonical/rockcraft#725 (confidence 85%)

    PR 'fix: set PATH on bare-based rocks' introduced the current bare-only set_default_path behavior referenced in the issue body; it is the source of the code to be generalized, not a fix for this issue.

Related issues

Issue Project State Summary Similarity
#711 Set PATH on the rock for bare bases rockcraft closed Closed without a repository fix. The request was tracked via internal Jira ticket CRAFT-3437, indicating the security improvement for bare base PATH configuration was moved to internal development rather than resolved here.
75%
#725 fix: set PATH on bare-based rocks rockcraft merged Merged fix that sets the default Ubuntu PATH on bare-based rocks images to mitigate security risks if the Pebble entrypoint is bypassed. Approved by three reviewers, passed CI, and resolves issue #711.
71%