coder / coder/envbuilder

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

Open
#506 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
300
Forks
64
Avg merge
20m
Merged PRs (30d)
1

Description

`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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.