bug: MkdirAll uses 0o644 for feature directories (missing execute bit)

Open Beginner friendly
#506 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
90/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
go
Domain
devops

Research direction

Open devcontainer/devcontainer.go and inspect the two fs.MkdirAll calls that create the feature extraction directories. Change both directory permission masks to 0o755, then run the existing tests that cover feature extraction; done means the directories are traversable by non-root users on a real filesystem.

Written by the indexing model from the issue text.

Description

bug

devcontainer/devcontainer.go calls fs.MkdirAll(featuresDir, 0o644) and fs.MkdirAll(featureDir, 0o644) when creating feature extraction directories. 0o644 is a file permission mask — directories need the execute bit (0o755) to be traversable by non-root users.

On the in-memory filesystem used in tests this is harmless, but on a real filesystem it could prevent non-root container users from accessing feature install scripts.

This pre-dates #500 (the feature ordering PR) — the same 0o644 was used in the original code.

Fix

Change both MkdirAll calls to use 0o755.

🤖 Written by a Coder Agent.

Dominant language
Go
Stars
300
Forks
64
Avg merge
20m
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

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.

More from coder/envbuilder

All issues in coder/envbuilder

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.