mediumCVSS 6.5Vulnerability

CVE-2026-77281

# Caddy v2.11.3 — Three vulnerabilities in handler/placeholder layer **Tested against:** `caddy:2.11.3` (official Docker image, SHA verified at runtime) **Reproduction environment:** Docker Desktop 4.73.1 / Engine 29.4.3 on Windows 10 host, isolated containers, no network egress required for any of the exploits This advisory bundles three independent issues discovered together during a source review of the placeholder/replacer layer. Each issue has been reproduced end-to-end against the unmodified `caddy:2.11.3` image with the minimal Caddyfile that the documentation suggests for the affected feature. --- ## Issue 1: Rewrite handler — placeholder double-expansion enables env var / file disclosure **File:** `modules/caddyhttp/rewrite/rewrite.go:215-249` and `buildQueryString` at `327` **Class:** CWE-94 (Code Injection), same bug class as CVE-2026-30852 (`vars_regexp`) **Severity:** Low (requires operator config with trailing `?` in rewrite URI) ### Root cause When the operator's `rewrite` URI template: 1. Contains a placeholder that resolves to request data (e.g. `{http.request.header.X-Foo}`), AND 2. Ends with a literal `?` (with empty query side) …then the bytes produced by the **first** Replacer pass (which include attacker-controlled header values) are fed through `buildQueryString`, which runs a **second** Replacer pass and resolves any placeholders the attacker injected. ```go // rewrite.go (abridged) newPath = repl.ReplaceAll(path, "") // pass 1 — header expanded if before, after, found := strings.Cut(newPath, "?"); found { var injectedQuery string newPath, injectedQuery = before, after if query == "" { // trailing-? branch query = injectedQuery // attacker bytes flow into 'query' } } if query != "" { newQuery = buildQueryString(query, repl) // pass 2 — RE-EXPANDS attacker input } ``` This is the same gadget that was patched in `vars_regexp` (CVE-2026-30852). The f

Properties

ghsa_id
GHSA-j8px-rmrx-76h9
severity
medium
summary
Caddy: rewrite placeholder re-expansion, unbounded body buffer DoS, and fileHidden case-sensitivity bypass
cvss_score
6.5
cve_id
CVE-2026-77281
cvss_vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L
signal_observed_at
2026-09-18T13:45:58+00:00
is_ghsa_only
false
ghsa_published
2026-09-18T13:09:27Z
source_url
https://github.com/advisories/GHSA-j8px-rmrx-76h9
ghsa_updated
2026-09-18T13:09:29Z

Related Entities (6)

VULNERABLE_TO (1)

[Software]go/github.com/caddyserver/caddy/v2

AFFECTS (1)

[Software]go/github.com/caddyserver/caddy/v2

HAS_WEAKNESS (3)

[Weakness]Improper Handling of Case Sensitivity
[Weakness]Improper Control of Generation of Code ('Code Injection')
[Weakness]Allocation of Resources Without Limits or Throttling

REPORTED_BY (1)

[Source]GitHub Advisory Database

Explore deeper with Ninja Signal's threat intelligence graph

CVE-2026-77281 (CVSS 6.5) — Ninja Signal Threat Intelligence | Ninja Signal