Caddy: stripHTML template function bypass
CVE-2026-52846GHSA-vcc4-2c75-vc9v
What to do
Partial vendor fix. Follow the primary source's mitigation guidance and check back for a fix.
This page has no inventory attached, so it cannot say whether you are affected. A vendor fix is not proof that your deployment is fixed.
Affected packages
Go github.com/caddyserver/caddy/v2
- Affected
- <= 2.11.3
- Fixed in
- 2.11.4
Go github.com/caddyserver/caddy
- Affected
- <= 1.0.5
- Fixed in
- no fixed version recorded
Sources
- GitHub Advisory Database and maintainer security advisories on GitHub
GitHub-reviewed advisory GHSA-vcc4-2c75-vc9v lists affected ranges: Go github.com/caddyserver/caddy/v2 >=0 =0 <=1.0.5
VerifiedObserved Structured GitHub Advisory Database record (type=reviewed) from the GitHub REST API.
Severity and exploitation
- Exploitation
- No confirmed exploitation recorded. Patch Next marks exploitation only from CISA KEV.
- CVSS
- 4.2 · CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:N
- EPSS
- CVE-2026-52846: 0.25% estimated exploitation activity in the next 30 days; percentile 16.20 (FIRST EPSS, 2026-11-03). This is a model estimate, not proof of exploitation or customer exposure.
Source description
As published by the source; long descriptions are shortened.
Summary Caddy’s stripHTML template function cannot reliably remove all HTML tags from input strings. Certain malformed HTML, such as <<img src=x onerror=alert(), can bypass the tag-stripping logic, potentially leaving dangerous content in the output if it is later rendered as HTML. This may allow client-side XSS in cases where untrusted strings are rendered unsafely. --- Details The vulnerability originates from funcStripHTML in: caddy/caddy/caddyhttp/templates/tplcontext.go POC Caddyfile setup Template file (index.html) The payload exploits the false start branch to smuggle a literal < back into the output, then uses the following to terminate the parser’s tag state, leaving a valid <img ... tag behind. Tested in v2.11.3 Impact Malformed HTML can bypass stripHTML, potentially allowing arbitrary HTML or JavaScript to be rendered if the output is used unsafely, leading to client-side XSS. AI Disclosure AI assisted in writing the report description; however, the discovery of the issue…
Dates and revisions
- Published by the source
- Last modified by the source
- Source last checked
- Revision 1 · created ·
Published from ghsa record GHSA-vcc4-2c75-vc9v
Agent brief
Preview the exact text before you copy it. Commands are read-only suggestions; review them before running anything.
# Patch Next advisory brief: CVE-2026-52846 Advisory: Caddy: stripHTML template function bypass IDs: CVE-2026-52846, GHSA-vcc4-2c75-vc9v Record: https://patchnext.com/advisories/cve-2026-52846 (revision 1, source checked 26 Oct 2026, 15:23 UTC) Inventory: none attached. This brief comes from a public page and does not say whether any deployment is affected. Severity: Medium (CVSS 4.2) Exploitation: no confirmed exploitation recorded. Patch Next confirms exploitation only from CISA KEV. Vendor response: Partial vendor fix; fixed versions by package: github.com/caddyserver/caddy/v2 2.11.4. A vendor fix does not mean a deployment is fixed. ## Affected components - Go github.com/caddyserver/caddy/v2: affected <= 2.11.3; fixed in 2.11.4 - Go github.com/caddyserver/caddy: affected <= 1.0.5 ## Suggested inspection (read-only) - Go github.com/caddyserver/caddy/v2: check the installed version with your package manager. - Go github.com/caddyserver/caddy: check the installed version with your package manager. ## Supported action No complete vendor fix is recorded. Follow the primary source's mitigation guidance and check this record again before closing anything. ## Required regression checks - Run the test suite and a production build. - Exercise the features that depend on github.com/caddyserver/caddy/v2, github.com/caddyserver/caddy. - Repeat the inspection and confirm that only fixed versions remain installed. ## Rollback considerations - Keep the previous lockfile and deployment artifact. Rolling back reinstates the vulnerable version, so apply any documented mitigation while you fix forward. ## Unresolved questions - Which deployments run an affected version? - Exploitation status can change. Check again before lowering the priority. - Mark the work resolved only after the fixed version is verified in production. ## Sources - Verified: https://github.com/advisories/GHSA-vcc4-2c75-vc9v (GitHub-reviewed advisory GHSA-vcc4-2c75-vc9v lists affected ranges: Go github.com/caddyserver/caddy/v2 >=0 =0 <=1.0.5) Commands are suggestions: review each one before running it.
Loading voting…