# CVE-2026-52846: Caddyserver Caddy XSS bypass in stripHTML template function

Source: https://junglewise.ai/threats/cve-2026-52846-caddyserver-caddy-xss-bypass-in-striphtml-template-function  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-06-23. Updated: 2026-06-23  
License: CC BY 4.0 with a link back

CVE-2026-52846 · Severity: medium · CVSS 4.2 · Published 2026-06-23

Caddy is a web server platform used to host websites and manage encrypted traffic. A flaw in its HTML-stripping feature allows specially crafted text to bypass security filters, potentially allowing malicious scripts to run in a user's browser. This could lead to unauthorized actions being performed on behalf of users or the theft of sensitive session information.

Technologies: [Caddyserver Caddy](https://junglewise.ai/threats/technologies/caddy), [github.com/caddyserver/caddy (Go)](https://junglewise.ai/threats/technologies/github-com-caddyserver-caddy), [github.com/caddyserver/caddy/v2 (Go)](https://junglewise.ai/threats/technologies/github-com-caddyserver-caddy-v2). Vendors: [Caddyserver](https://junglewise.ai/threats/vendors/caddyserver), [Go](https://junglewise.ai/threats/vendors/go).

## Quick answers

**Is CVE-2026-52846 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-52846 being exploited in the wild.

**How severe is CVE-2026-52846?** Medium severity, with a CVSS score of 4.2, published 23 June 2026.

**Which products and versions are affected?** Caddyserver Caddy <= 1.0.5, <= 2.11.3; github.com/caddyserver/caddy (Go) <= 1.0.5, SEMVER:introduced=0,last_affected=1.0.5; github.com/caddyserver/caddy/v2 (Go) <= 2.11.3, SEMVER:introduced=0,fixed=2.11.4.

**Is there a fix for CVE-2026-52846?** Yes. github.com/caddyserver/caddy/v2 (Go): upgrade to 2.11.4 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-52846 attacked?** It is attacked over the network, in a hosted service.

**Am I affected by CVE-2026-52846?** Check whether you run Caddyserver Caddy, github.com/caddyserver/caddy (Go) or github.com/caddyserver/caddy/v2 (Go) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- github.com/caddyserver/caddy/v2 (Go): upgrade to 2.11.4 or later

  ```sh
  go get github.com/caddyserver/caddy/v2@v2.11.4
  ```


## Technical details

A vulnerability exists in Caddy's 'stripHTML' template function due to improper handling of malformed HTML tags. The 'funcStripHTML' implementation in 'tplcontext.go' contains logic for handling 'false starts' (nested or unexpected '<' characters) that can be exploited to smuggle literal HTML tags into the output. Specifically, a payload like '<<>img src=x onerror=alert()>' triggers a branch that writes a literal '<' back to the buffer while prematurely terminating the parser's tag state. This allows an attacker to bypass the intended sanitization and execute arbitrary JavaScript (XSS) if the output is rendered in a browser. The issue is fixed in version 2.11.4.

## Affected products

- Caddyserver Caddy < 2.11.4

## Identifiers

- CVE-2026-52846
- GHSA-vcc4-2c75-vc9v
- GO-2026-5660

## Timeline

- 2026-06-08: advisory: GitHub Security Advisory published by maintainers
- 2026-06-23: disclosed: NVD publication date
- 2026-06-23: patched: Fix released in version 2.11.4

## References

- [https://github.com/caddyserver/caddy/security/advisories/GHSA-vcc4-2c75-vc9v](https://github.com/caddyserver/caddy/security/advisories/GHSA-vcc4-2c75-vc9v)

## Related threats

- [Caddy has an RFC 7230 §6.1 compliance issue / Hop-by-hop headers that leak through](https://junglewise.ai/threats/cve-2026-55458-caddy-has-an-rfc-7230-6-1-compliance-issue-hop-by-hop-headers)
- [Caddy placeholder re-expansion in URI rewrite](https://junglewise.ai/threats/cve-2026-77281-caddy-placeholder-re-expansion-in-uri-rewrite)
- [GO-2026-5408 - Caddy: Remote Admin Authorization Bypass on PKI Endpoints via Prefix-Based Path Matching in…](https://junglewise.ai/threats/go-2026-5408-caddy-remote-admin-authorization-bypass-on-pki-endpoints-4c5e1b8e)
- [GO-2026-5730 - Caddy Fix Bypass in github.com/caddyserver/caddy](https://junglewise.ai/threats/go-2026-5730-caddy-fix-bypass-in-github-com-caddyserver-caddy-baf17ba5)
- [Caddy authentication bypass via FastCGI header normalization collision](https://junglewise.ai/threats/cve-2026-52845-caddy-authentication-bypass-via-fastcgi-header-normalization)
