Root chown -R on the Caddy data tree follows a symlink planted by the caddy user

Open
#3,669 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go

Research direction

Read internal/hosting/caddy.go around line 368 and internal/server/core_services.go around line 568, then compare with the jump-account helper's chownTreeNoFollow. Update both chown sites consistently and add a test that plants a symlink under the tree and checks its target owner stays unchanged, skipping the root-only assertion when not running as root. Done when the test passes for both affected paths.

Written by the indexing model from the issue text.

Description

model:sonnet runtime:claude security size:S

Finding (from the #3633 scan, pinned to 715c41ce)

Two root-run recursive chowns act on a tree the unprivileged caddy service user writes:

  • internal/hosting/caddy.go:368 — chown -R caddy:caddy /var/lib/caddy
  • internal/server/core_services.go:568 — the same command

Reachable only after the Caddy service is compromised, so the severity is low, but a root chown -R without -h follows a symlink the service user can plant under that tree.

Acceptance criteria

  • The recursive chown does not follow symlinks: -h at minimum, or the same walk the jump-account helper uses (chownTreeNoFollow), if it can be shared without a new dependency.
  • Both sites change together, so one can't drift from the other.
  • Test: a symlink planted under the tree is not followed, and its target's owner is unchanged (root-only assertion, skipped otherwise).

Part of the #3342 security track. Follow-up to #3633.

Dominant language
Go
Stars
296
Forks
38
Avg merge
7h 34m
Merged PRs (30d)
648

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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 FootprintAI/Containarium

All issues in FootprintAI/Containarium

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.