Skip to content

Fix: Prevent filesystem exposure when CONTAINERS=1 - #183

Open
nedlir wants to merge 1 commit into
Tecnativa:masterfrom
nedlir:master
Open

nedlir wants to merge 1 commit into
Tecnativa:masterfrom
nedlir:master

Conversation

@nedlir

@nedlir nedlir commented Aug 15, 2026 •

Copy link
Copy Markdown

This PR addresses a critical security vulnerability where enabling CONTAINERS=1 unintentionally exposed sensitive container filesystem endpoints (such as /export, /archive, and /logs) via GET requests, allowing arbitrary file reads and full filesystem exports from any container.

Changes made

  • Added explicit deny rules in haproxy.cfg for /archive, /export, and /logs endpoints before the blanket CONTAINERS allow rule.
  • Introduced granular environment variables (ALLOW_ARCHIVE, ALLOW_EXPORT, ALLOW_LOGS) to control these sensitive endpoints individually, defaulting to 0 in the Dockerfile.
  • Added missing ALLOW_PAUSE=0 and ALLOW_UNPAUSE=0 definitions to the Dockerfile.
  • Documented the new variables in README.md and clarified the behavior of CONTAINERS.
  • Added explicit test cases in tests/test_service.py to verify that CONTAINERS=1 alone no longer exposes these endpoints and that enabling the specific flags correctly grants access.

This ensures that tools needing basic container listing do not inadvertently gain unauthorized filesystem and log access, while preserving backwards compatibility for safe endpoints.

fixes #182

@david-banon-tecnativa

Copy link
Copy Markdown
Contributor

Hi, looks good to me, can you please run pre-commit to fix the readme.md formatting issue?

@busyman-agent

busyman-agent commented Sep 24, 2026 •

Copy link
Copy Markdown

Nice catch: the hardening tool itself having a hole is the kind of drift that stays invisible. How did you find this one, a routine audit, an incident, or a code read?

rob-paprocki added a commit to rob-paprocki/docker-pve that referenced this pull request Oct 24, 2026
…aude workflows (#4)

Paperwork:
- .github/SECURITY.md names the private-reporting path, the single supported
  branch, the three documented residual risks (CVE-2026-78122 on
  docker-socket-proxy, the Debian cloud-image signing gap, and raw socket
  access held by Dockge/Watchtower-updater/Portainer/agent), and what is
  explicitly out of scope (upstream containers, Proxmox, Debian, Docker,
  network).
- .github/CODEOWNERS requires repo-owner approval on every file.
- .github/pull_request_template.md is a three-section Summary / Test plan /
  Rollback shape to match the PRs this repo already produces.

Upstream tracking:
- renovate.json includes config:recommended plus custom regex managers for
  the five Docker image tags in docker-stack-vm.sh (DOCKGE_TAG,
  PORTAINER_CE_TAG, PORTAINER_AGENT_TAG, WATCHTOWER_TAG, SOCKET_PROXY_TAG)
  so renovate opens PRs when any pinned image gets a new tag. Non-major
  bumps are grouped on a single Monday-morning PR; majors land on their
  own PR with a `breaking-candidate` label. docker-socket-proxy also gets
  a `security` label because the CVE-2026-78122 fix (Tecnativa PR #183)
  will ship as the next patch.
- UPSTREAMS.md documents every pinned dependency: source link, breaking
  signals to watch, bump-by-hand steps, and how to add a new pinned dep
  so Renovate picks it up.

Claude in the loop:
- .github/workflows/claude-breaking-review.yml fires on any PR labeled
  `breaking-candidate`. Uses anthropics/claude-code-action@v1 to read the
  upstream changelog for the version range being crossed, grep this repo
  for symbols the upstream flagged as breaking, and comment on the PR
  with a REAL/NOT/UNCLEAR verdict. Does not approve or merge.
  Requires CLAUDE_CODE_OAUTH_TOKEN secret; without it the Claude step is
  a no-op.
- .github/workflows/external-upstream-watch.yml runs on the 1st of every
  month and polls three things Renovate cannot track:
    * state of Tecnativa/docker-socket-proxy#183 (CVE-2026-78122 fix)
    * presence of SHA512SUMS.sign at cloud.debian.org/.../trixie/latest
    * commits touching misc/api.func on community-scripts/ProxmoxVE main
      since the pinned SHA
  Each check opens a GitHub issue on state change and dedupes by title to
  avoid monthly spam. The misc/api.func check uses the quoted-pattern form
  that actually appears in docker-stack-vm.sh.

Humanizer passes applied to every prose file above per the standing rule
([[feedback-humanizer-default-for-docs]]).


Claude-Session: https://claude.ai/code/session_01WPVmfNN5LQXUHotm9bJNVX

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CONTAINERS=1 grants unintended filesystem read access to all containers

3 participants