22 KiB
post_title, categories, tags, summary, post_date
| post_title | categories | tags | summary | post_date | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Current Spec: Caddy 2.11.1 Compatibility, Security, and UX Impact Plan |
|
|
Comprehensive, phased plan to evaluate and safely adopt Caddy v2.11.1 in Charon, covering plugin compatibility, CVE impact, xcaddy patch retirement decisions, UI/UX exposure opportunities, and PR slicing strategy with strict validation gates. | 2026-02-23 |
Active Plan: Caddy 2.11.1 Deep Compatibility and Security Rollout
Date: 2026-02-23 Status: Active and authoritative Scope Type: Architecture/security/dependency research and implementation planning Authority: This is the only active authoritative plan section in this file.
Introduction
Charon’s control plane and data plane rely on Caddy as a core runtime backbone.
Because Caddy is embedded and rebuilt via xcaddy, upgrading from
2.11.0-beta.2 to 2.11.1 is not a routine version bump: it impacts
runtime behavior, plugin compatibility, vulnerability posture, and potential UX
surface area.
This plan defines a low-risk, high-observability rollout strategy that answers:
- Which Caddy 2.11.x features should be exposed in Charon UI/API?
- Which existing Charon workarounds became redundant upstream?
- Which
xcaddydependency patches remain necessary vs removable? - Which known vulnerabilities are fixed now and which should remain on watch?
Research Findings
External release and security findings
- Official release statement confirms
v2.11.1has no runtime code delta fromv2.11.0except CI/release process correction. Practical implication: compatibility/security validation should target 2.11.x behavior, not 2.11.1-specific runtime changes. - Caddy release lists six security patches (mapped to GitHub advisories):
CVE-2026-27590→GHSA-5r3v-vc8m-m96g(FastCGI split_path confusion)CVE-2026-27589→GHSA-879p-475x-rqh2(admin API cross-origin no-cors)CVE-2026-27588→GHSA-x76f-jf84-rqj8(host matcher case bypass)CVE-2026-27587→GHSA-g7pc-pc7g-h8jh(path matcher escaped-case bypass)CVE-2026-27586→GHSA-hffm-g8v7-wrv7(mTLS client-auth fail-open)CVE-2026-27585→GHSA-4xrr-hq4w-6vf4(glob sanitization bypass)
- NVD/CVE.org entries are currently reserved/not fully enriched. GitHub advisories are the most actionable source right now.
Charon architecture and integration findings
- Charon compiles custom Caddy in
Dockerfileviaxcaddyand injects:github.com/greenpau/caddy-securitygithub.com/corazawaf/coraza-caddy/v2github.com/hslatman/caddy-crowdsec-bouncer@v0.10.0github.com/zhangjiayin/caddy-geoip2github.com/mholt/caddy-ratelimit
- Charon applies explicit post-generation
go getpatching inDockerfilefor:github.com/expr-lang/expr@v1.17.7github.com/hslatman/ipstore@v0.4.0github.com/slackhq/nebula@v1.9.7(with comment indicating temporary pin)
- Charon CI has explicit dependency inspection gate in
.github/workflows/docker-build.ymlto verify patchedexpr-lang/exprversions in built binaries.
Plugin compatibility findings (highest risk area)
Current plugin module declarations (upstream go.mod) target older Caddy cores:
greenpau/caddy-security:caddy/v2 v2.10.2hslatman/caddy-crowdsec-bouncer:caddy/v2 v2.10.2corazawaf/coraza-caddy/v2:caddy/v2 v2.9.1zhangjiayin/caddy-geoip2:caddy/v2 v2.10.0mholt/caddy-ratelimit:caddy/v2 v2.8.0
Implication: compile success against 2.11.1 is plausible but not guaranteed. The plan must include matrix build/provision tests before merge.
Charon UX and config-surface findings
Current Caddy-related UI/API exposure is narrow:
frontend/src/pages/SystemSettings.tsx- state:
caddyAdminAPI,sslProvider - saves keys:
caddy.admin_api,caddy.ssl_provider
- state:
frontend/src/pages/ImportCaddy.tsxand import components:- Caddyfile parsing/import workflow, not runtime feature toggles
frontend/src/api/import.ts,frontend/src/api/settings.ts- Backend routes and handlers:
backend/internal/api/routes/routes.gobackend/internal/api/handlers/settings_handler.gobackend/internal/api/handlers/import_handler.gobackend/internal/caddy/manager.gobackend/internal/caddy/config.gobackend/internal/caddy/types.go
No UI controls currently exist for new Caddy 2.11.x capabilities such as
keepalive_idle, keepalive_count, trusted_proxies_unix,
renewal_window_ratio, or 0-RTT behavior.
Requirements (EARS)
- WHEN evaluating Caddy
v2.11.1, THE SYSTEM SHALL validate compatibility against all currently enabledxcaddyplugins before changing production defaults. - WHEN security advisories in Caddy 2.11.x affect modules Charon may use, THE SYSTEM SHALL document exploitability for Charon’s deployment model and prioritize remediation accordingly.
- WHEN an
xcaddypatch/workaround no longer provides value, THE SYSTEM SHALL remove it only after reproducible build and runtime validation gates pass. - IF a Caddy 2.11.x feature maps to an existing Charon concept, THEN THE SYSTEM SHALL prefer extending existing UI/components over adding new parallel controls.
- WHEN no direct UX value exists, THE SYSTEM SHALL avoid adding UI for upstream options and keep behavior backend-managed.
- WHEN this rollout completes, THE SYSTEM SHALL provide explicit upstream watch criteria for unresolved/reserved CVEs and plugin dependency lag.
Technical Specifications
Compatibility scope map (code touch inventory)
Build/packaging
DockerfileARG CADDY_VERSIONARG XCADDY_VERSIONcaddy-builderstage (xcaddy build, plugin list,go getpatches)
.github/workflows/docker-build.yml- binary dependency checks (
go version -mextraction/gates)
- binary dependency checks (
.github/renovate.json- regex managers tracking
Dockerfilepatch dependencies
- regex managers tracking
Caddy runtime config generation
backend/internal/caddy/manager.goNewManager(...)ApplyConfig(ctx)
backend/internal/caddy/config.goGenerateConfig(...)
backend/internal/caddy/types.go- JSON struct model for Caddy config (
Server,TrustedProxies, etc.)
- JSON struct model for Caddy config (
Settings and admin surface
backend/internal/api/handlers/settings_handler.goUpdateSetting(...),PatchConfig(...)
backend/internal/api/routes/routes.go- Caddy manager wiring + settings routes
frontend/src/pages/SystemSettings.tsx- current Caddy-related controls
Caddyfile import behavior
backend/internal/api/handlers/import_handler.goRegisterRoutes(...),Upload(...),GetPreview(...)
backend/internal/caddy/importer.goNormalizeCaddyfile(...),ParseCaddyfile(...),ExtractHosts(...)
frontend/src/pages/ImportCaddy.tsx- import UX and warning handling
Feature impact assessment (2.11.x)
Candidate features for potential Charon exposure
- Keepalive server options (
keepalive_idle,keepalive_count)- Candidate mapping: advanced per-host connection tuning
- Likely files:
backend/internal/caddy/types.go,backend/internal/caddy/config.go, host settings API + UI
trusted_proxies_unix- Candidate mapping: trusted local socket proxy chains
- Current
TrustedProxiesstruct lacks explicit unix-socket trust fields
- Certificate lifecycle tunables (
renewal_window_ratio, maintenance interval)- Candidate mapping: advanced TLS policy controls
- Potentially belongs under system-level TLS settings, not per-host UI
Features likely backend-only / no new UI by default
- Reverse-proxy automatic
Hostrewrite for TLS upstreams - ECH key auto-rotation
SIGUSR1reload fallback behavior- Logging backend internals (
timberjack, ordering fixes)
Plan decision rule: expose only options that produce clear operator value and can be represented without adding UX complexity.
Security patch relevance matrix
Advisory exploitability rubric and ownership
Use the following deterministic rubric for each advisory before any promotion:
| Field | Required Values | Rule |
|---|---|---|
| Exploitability | Affected / Not affected / Mitigated |
Affected means a reachable vulnerable path exists in Charon runtime; Not affected means required feature/path is not present; Mitigated means vulnerable path exists upstream but Charon deployment/runtime controls prevent exploitation. |
| Evidence source | advisory + code/config/runtime proof | Must include at least one authoritative upstream source (GitHub advisory/Caddy release) and one Charon-local proof (config path, test, scan, or runtime verification). |
| Owner | named role | Security owner for final disposition (QA_Security lead or delegated maintainer). |
| Recheck cadence | weekly / release-candidate / on-upstream-change |
Minimum cadence: weekly until CVE enrichment is complete and disposition is stable for two consecutive checks. |
Promotion gate: every advisory must have all four fields populated and signed by owner in the PR evidence bundle.
High-priority for Charon context
GHSA-879p-475x-rqh2(admin API cross-origin no-cors)- Charon binds admin API internally but still uses
0.0.0.0:2019in generated config. Must verify actual network isolation and container exposure assumptions.
- Charon binds admin API internally but still uses
GHSA-hffm-g8v7-wrv7(mTLS fail-open)- Relevant if client-auth CA pools are configured anywhere in generated or imported config paths.
- matcher bypass advisories (
GHSA-x76f-jf84-rqj8,GHSA-g7pc-pc7g-h8jh)- Potentially relevant to host/path-based access control routing in Caddy.
Contextual/conditional relevance
GHSA-5r3v-vc8m-m96g(FastCGI split_path)- Relevant only if FastCGI transport is in active use.
GHSA-4xrr-hq4w-6vf4(file matcher glob sanitization)- Relevant when file matchers are used in route logic.
xcaddy patch retirement candidates
Candidate to re-evaluate for removal
go get github.com/slackhq/nebula@v1.9.7- Upstream Caddy has moved forward to
nebula v1.10.3and references security-related maintenance in the 2.11.x line. - Existing Charon pin comment may be stale after upstream smallstep updates.
- Upstream Caddy has moved forward to
Likely retain until proven redundant
go get github.com/expr-lang/expr@v1.17.7go get github.com/hslatman/ipstore@v0.4.0
Retention/removal decision must be made using reproducible build + binary inspection evidence, not assumption.
Hard retirement gates (mandatory before removing any pin)
Pin removal is blocked unless all gates pass:
- Binary module diff gate
- Produce before/after
go version -mmodule diff for Caddy binary. - No unexpected module major-version jumps outside approved advisory scope.
- Produce before/after
- Security regression gate
- No new HIGH/CRITICAL findings in CodeQL/Trivy/Grype compared to baseline.
- Reproducible build parity gate
- Two clean rebuilds produce equivalent module inventory and matching runtime smoke results.
- Rollback proof gate (mandatory, with explicit
nebulafocus)- Demonstrate one-command rollback to previous pin set, with successful compile + runtime smoke set after rollback.
Retirement decision for nebula cannot proceed without explicit rollback proof
artifact attached to PR evidence.
Feature-to-control mapping (exposure decision matrix)
| Feature | Control surface | Expose vs backend-only rationale | Persistence path |
|---|---|---|---|
keepalive_idle, keepalive_count |
Existing advanced system settings (if approved) | Expose only if operators need deterministic upstream connection control; otherwise keep backend defaults to avoid UX bloat. | frontend/src/pages/SystemSettings.tsx → frontend/src/api/settings.ts → backend/internal/api/handlers/settings_handler.go → DB settings → backend/internal/caddy/config.go (GenerateConfig) |
trusted_proxies_unix |
Backend-only default initially | Backend-only until proven demand for unix-socket trust tuning; avoid misconfiguration risk in general UI. | backend config model (backend/internal/caddy/types.go) + generated config path (backend/internal/caddy/config.go) |
renewal_window_ratio, cert maintenance interval |
Backend-only policy | Keep backend-only unless operations requires explicit lifecycle tuning controls. | settings store (if introduced) → settings_handler.go → GenerateConfig |
| Reverse-proxy Host rewrite / ECH rotation / reload fallback internals | Backend-only | Operational internals with low direct UI value; exposing would increase complexity without clear user benefit. | backend runtime defaults and generated Caddy config only |
Implementation Plan
Phase 1: Playwright and behavior baselining (mandatory first)
Objective: capture stable pre-upgrade behavior and ensure UI/UX parity checks.
- Run targeted E2E suites covering Caddy-critical flows:
tests/tasks/import-caddyfile.spec.tstests/security-enforcement/zzz-caddy-imports/*.spec.ts- system settings-related tests around Caddy admin API and SSL provider
- Capture baseline artifacts:
- Caddy import warning behavior
- security settings save/reload behavior
- admin API connectivity assumptions from test fixtures
- Produce a baseline report in
docs/reports/for diffing in later phases.
Phase 2: Backend and build compatibility research implementation
Objective: validate compile/runtime compatibility of Caddy 2.11.1 with current plugin set and patch set.
-
Bump candidate in
Dockerfile:ARG CADDY_VERSION=2.11.1
-
Execute matrix builds with toggles:
- Scenario A: current patch set unchanged
- Scenario B: remove
nebulapin only - Scenario C: remove
nebula+ retainexpr/ipstore
-
Execute explicit compatibility gate matrix (deterministic):
Dimension Values Plugin set caddy-security,coraza-caddy,caddy-crowdsec-bouncer,caddy-geoip2,caddy-ratelimitPatch scenario Acurrent pins,Bnonebulapin,Cnonebulapin + retainedexpr/ipstorepinsPlatform/arch linux/amd64,linux/arm64Runtime smoke set boot Caddy, apply generated config, admin API health, import preview, one secured proxy request path Deterministic pass/fail rule:
- Pass: all plugin modules compile/load for the matrix cell AND all smoke tests pass.
- Fail: any compile/load error, missing module, or smoke failure.
Promotion criteria:
- PR-1 promotion requires 100% pass for Scenario A on both architectures.
- Scenario B/C may progress only as candidate evidence; they cannot promote to default unless all hard retirement gates pass.
-
Validate generated binary dependencies from CI/local:
- verify
expr,ipstore,nebula,smallstep/certificatesversions
- verify
-
Validate runtime config application path:
backend/internal/caddy/manager.go→ApplyConfig(ctx)backend/internal/caddy/config.go→GenerateConfig(...)
-
Run Caddy package tests and relevant integration tests:
backend/internal/caddy/*- security middleware integration paths that rely on Caddy behavior
Phase 3: Security hardening and vulnerability posture updates
Objective: translate upstream advisories into Charon policy and tests.
- Add/adjust regression tests for advisory-sensitive behavior in
backend/internal/caddyand integration test suites, especially:- host matcher behavior with large host lists
- escaped path matcher handling
- admin API cross-origin assumptions
- Update security documentation and operational guidance:
- identify which advisories are mitigated by upgrade alone
- identify deployment assumptions (e.g., local admin API exposure)
- Introduce watchlist process for RESERVED CVEs pending NVD enrichment:
- monitor Caddy advisories and module-level disclosures weekly
Phase 4: Frontend and API exposure decisions (only if justified)
Objective: decide whether 2.11.x features merit UI controls.
- Evaluate additions to existing
SystemSettingsUX only (no new page):- optional advanced toggles for keepalive tuning and trusted proxy unix scope
- Add backend settings keys and mapping only where persisted behavior is
needed:
- settings handler support in
backend/internal/api/handlers/settings_handler.go - propagation to config generation in
GenerateConfig(...)
- settings handler support in
- If no high-value operator need is proven, keep features backend-default and document rationale.
Phase 5: Validation, docs, and release readiness
Objective: ensure secure, reversible, and auditable rollout.
- Re-run full DoD sequence (E2E, patch report, security scans, coverage).
- Update architectural docs if behavior/config model changes.
- Publish release decision memo:
- accepted changes
- rejected/deferred UX features
- retained/removed patches with evidence
PR Slicing Strategy
Decision
Use multiple PRs (PR-1/PR-2/PR-3).
Reasoning:
- Work spans infra/build security + backend runtime + potential frontend UX.
- Caddy is a blast-radius-critical dependency; rollback safety is mandatory.
- Review quality and CI signal are stronger with isolated, testable slices.
PR-1: Compatibility and evidence foundation
Scope:
DockerfileCaddy candidate bump (and temporary feature branch matrix toggles)- CI/workflow compatibility instrumentation if needed
- compatibility report artifacts and plan-linked documentation
Dependencies:
- None
Acceptance criteria:
- Caddy 2.11.1 compiles with existing plugin set under at least one stable patch scenario.
- Compatibility gate matrix (plugin × patch scenario × platform/arch × runtime smoke set) executed with deterministic pass/fail output and attached evidence.
- Binary module inventory report generated and attached.
- No production behavior changes merged beyond compatibility scaffolding.
Release guard (mandatory for PR-1):
- Candidate tag only (
*-rc/*-candidate) is allowed. - Release pipeline exclusion is required; PR-1 artifacts must not be eligible for production release jobs.
- Promotion to releasable tag is blocked until PR-2 security/retirement gates pass.
Rollback notes:
- Revert
Dockerfilearg changes and instrumentation only.
PR-2: Security patch posture + patch retirement decision
Scope:
- finalize retained/removed
go getpatch lines inDockerfile - update security tests/docs tied to six Caddy advisories
- tighten/confirm admin API exposure assumptions
Dependencies:
- PR-1 evidence
Acceptance criteria:
- Decision logged for each patch (
expr,ipstore,nebula) with rationale. - Advisory coverage matrix completed with Charon applicability labels.
- Security scans clean at required policy thresholds.
Rollback notes:
- Revert patch retirement lines and keep previous pinned patch model.
PR-3: Optional UX/API exposure and cleanup
Scope:
- only approved high-value settings exposed in existing settings surface
- backend mapping and frontend wiring using existing settings flows
- docs and translations updates if UI text changes
Dependencies:
- PR-2 must establish stable runtime baseline first
Acceptance criteria:
- No net-new page; updates land in existing
SystemSettingsdomain. - E2E and unit tests cover newly exposed controls and defaults.
- Deferred features explicitly documented with rationale.
Rollback notes:
- Revert UI/API additions while retaining already landed security/runtime upgrades.
Config File Review and Proposed Updates
Dockerfile (required updates)
- Update
ARG CADDY_VERSIONtarget to2.11.1after PR-1 gating. - Reassess and potentially remove stale
nebulapin in caddy-builder stage if matrix build proves compatibility and security posture improves. - Keep
expr/ipstorepatch enforcement until binary inspection proves upstream transitive versions are consistently non-vulnerable.
.gitignore (suggested updates)
No mandatory update for rollout, but recommended if new evidence artifacts are generated in temporary paths:
- ensure transient compatibility artifacts are ignored (for example,
test-results/caddy-compat/**if used).
.dockerignore (suggested updates)
No mandatory update; current file already excludes heavy test/docs/security artifacts and keeps build context lean. Revisit only if new compatibility fixture directories are introduced.
codecov.yml (suggested updates)
No mandatory change for version upgrade itself. If new compatibility harness tests are intentionally non-coverage-bearing, add explicit ignore patterns to avoid noise in project and patch coverage reports.
Risk Register and Mitigations
- Plugin/API incompatibility with Caddy 2.11.1
- Mitigation: matrix compile + targeted runtime tests before merge.
- False confidence from scanner-only dependency policies
- Mitigation: combine advisory-context review with binary-level inspection.
- Behavioral drift in reverse proxy/matcher semantics
- Mitigation: baseline E2E + focused security regression tests.
- UI sprawl from exposing too many Caddy internals
- Mitigation: only extend existing settings surface when operator value is clear and validated.
Acceptance Criteria
- Charon builds and runs with Caddy 2.11.1 and current plugin set under deterministic CI validation.
- A patch disposition table exists for
expr,ipstore, andnebula(retain/remove/replace + evidence). - Caddy advisory applicability matrix is documented, including exploitability notes for Charon deployment model.
- Any added settings are mapped end-to-end:
frontend state → API payload → persisted setting →
GenerateConfig(...). - E2E, security scans, and coverage gates pass without regression.
- PR-1/PR-2/PR-3 deliverables are independently reviewable and rollback-safe.
Handoff
After approval of this plan:
- Delegate PR-1 execution to implementation workflow.
- Require evidence artifacts before approving PR-2 scope reductions (especially patch removals).
- Treat PR-3 as optional and value-driven, not mandatory for the security update itself.