Skip to content

fix: reject unset env secret and world-readable mode bits#87

Open
Jaro-c wants to merge 1 commit into
developfrom
fix/secret-mode-validation
Open

fix: reject unset env secret and world-readable mode bits#87
Jaro-c wants to merge 1 commit into
developfrom
fix/secret-mode-validation

Conversation

@Jaro-c

@Jaro-c Jaro-c commented Jun 10, 2026

Copy link
Copy Markdown
Member

Summary

  • SEC-006: environment: secrets/configs now fail with an error when the referenced env var is not set, instead of silently writing a zero-byte file that would allow auth bypass
  • SEC-008: apply_mode rejects any mode with group-read (g+r) or world-read (o+r) bits — the whole point of a secret file is that only the owner can read it

Test plan

  • cargo test --lib passes (130 tests, 3 new)
  • environment: secret with unset var returns Err(...env var '...' which is not set)
  • Mode 0o777, 0o644, 0o640 are rejected; 0o400, 0o600 pass

Closes #76

SEC-006: environment: secrets and configs silently produced a zero-byte
file when the referenced env var was absent, enabling auth bypass.
Return Err instead so the process fails closed.

SEC-008: apply_mode accepted any mode including 0o777, downgrading a
secret file to world-readable. Reject any mode with group- or
world-read bits (mode & 0o044 != 0).

Closes #76

Signed-off-by: Jaro-c <75870284+Jaro-c@users.noreply.github.com>
@Jaro-c Jaro-c added type:security Security issue or hardening prio:P0 Critical — drop everything area:containers Podman/containers status:review Waiting for review effort:S A few hours labels Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:containers Podman/containers effort:S A few hours prio:P0 Critical — drop everything status:review Waiting for review type:security Security issue or hardening

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant