CVE-2026-52846

Caddy: stripHTML template function bypass

Published Jun 23, 2026 CVSS 3.1 · 4.2 Medium EPSS < 1% KEV · Not listed
Description
Caddy is an extensible server platform that uses TLS by default. Prior to 2.11.4, 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. This vulnerability is fixed in 2.11.4.

Analysis

AI-generated

Technical impact

Prior to 2.11.4, Caddy’s stripHTML template function fails to reliably remove all HTML tags from input strings. Malformed HTML, such as <<>img src=x onerror=alert()>, can bypass the stripping logic, potentially leaving dangerous content in the output if it is later rendered as HTML. This allows client‑side XSS when untrusted strings are rendered unsafely. The vulnerability is fixed in 2.11.4, and the platform uses TLS by default, but the flaw remains until the update. The flaw is an instance of improper string sanitization (CWE‑116) and cross‑site scripting (CWE‑79).

Affected Systems

Affected systems are all installations of Caddy running before the patch release 2.11.4. The vulnerability affects the core server engine supplied by the caddyserver:Caddy CNA, and any instance that uses the stripHTML template helper within its page rendering logic. Version information is limited to the release line; earlier versions (e.g., 2.11.3 and under) are considered vulnerable, while 2.11.4 and later include the fix.

Risk and Exploitability

The CVSS score of 4.2 indicates a low impact. EPSS data is < 1%, and the vulnerability is not listed in the CISA KEV yet. The likely attack vector is an attacker inserting crafted content into a template variable that is rendered, requiring the ability to influence template input; if the application uses templating to display untrusted data without proper escaping, the vulnerability can be leveraged to execute malicious scripts in users’ browsers.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Caddy to version 2.11.4 or later to apply the official fix.
  • Disable the stripHTML template helper if it is not required by the application.
  • Validate and sanitize any user‑supplied content prior to rendering it as HTML, using a trusted HTML sanitizer or strict escaping mechanisms.

Generated by OpenCVE AI on July 31, 2026 at 17:01 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Debian DLA Debian DLA DLA-4857-1 caddy security update
Debian DSA Debian DSA DSA-6429-1 caddy security update
Github GHSA Github GHSA GHSA-vcc4-2c75-vc9v Caddy: stripHTML template function bypass
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Caddyserver
Caddyserver caddy
Vendors & Products Caddyserver
Caddyserver caddy
Type Values Removed Values Added
Description Caddy is an extensible server platform that uses TLS by default. Prior to 2.11.4, 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. This vulnerability is fixed in 2.11.4.
Title Caddy: stripHTML template function bypass
Weaknesses CWE-116
References
Metrics cvssV3_1

{'score': 4.2, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:N'}

Weaknesses
  • CWE-116

    Improper Encoding or Escaping of Output

  • CWE-79

    Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Jun 25, 2026, 12:42 PM
Reserved
Jun 8, 2026, 6:41 PM
Status
Analyzed
Published
Jun 23, 2026, 6:18 PM
Modified
Jun 29, 2026, 7:08 PM
Severity
Moderate
Public date
Jun 23, 2026, 5:47 PM