Skip to content

admin: authorize remote requests matching any permission entry - #8317

Merged
steadytao merged 3 commits into
caddyserver:masterfrom
BenMacha:fix-admin-access-multiple-permissions
Nov 3, 2026
Merged

steadytao merged 3 commits into
caddyserver:masterfrom
BenMacha:fix-admin-access-multiple-permissions

Conversation

@BenMacha

@BenMacha BenMacha commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

enforceAccessControls rejected a request as soon as one permission entry
did not match its method or path, so only the first entry was usable.
Allow the request if any entry permits both, and deny only after all fail.

Assistance Disclosure

The bug was found during a code review done with Claude Code (Anthropic), which also drafted the fix and the test. I reviewed the change, can explain every line, and ran go test -race -short on the affected package before opening this PR.

enforceAccessControls rejected a request as soon as one permission entry
did not match its method or path, so only the first entry was usable.
Allow the request if any entry permits both, and deny only after all fail.
Comment thread admin.go Resolved
A key listed in several access control entries was only checked
against the first one; deny only after all of them are tried.
@caddy-cla

caddy-cla Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

✅ Contributor License Agreement

All identified contributors have signed the CLA. Thank you!

@steadytao
steadytao enabled auto-merge (squash) November 3, 2026 06:57
@steadytao steadytao added the bug 🐞 Something isn't working label Nov 3, 2026
@steadytao steadytao added this to the v2.12.0 milestone Nov 3, 2026
@steadytao
steadytao merged commit c168dbc into caddyserver:master Nov 3, 2026
27 checks passed
This was referenced Nov 3, 2026
NickCao pushed a commit to NickCao/caddy that referenced this pull request Nov 4, 2026
…server#8317)

* admin: authorize remote requests matching any permission entry

enforceAccessControls rejected a request as soon as one permission entry
did not match its method or path, so only the first entry was usable.
Allow the request if any entry permits both, and deny only after all fail.

* admin: check every access entry that holds the client key

A key listed in several access control entries was only checked
against the first one; deny only after all of them are tried.

(cherry picked from commit c168dbc)
@francislavoie francislavoie modified the milestones: v2.12.0, v2.11.8 Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug 🐞 Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants