CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-27586

Caddy Shack: How a Missing File Turns mTLS into an Open Door

Amit Schendel
Amit Schendel
Senior Security Researcher

Feb 24, 2026·6 min read·117 visits

Executive Summary (TL;DR)

If Caddy can't find your private CA file, it doesn't crash—it just lets anyone with a valid public certificate (like Let's Encrypt) log in. This high-severity bug turns a missing file into a full authentication bypass.

A critical logic error in Caddy Server's TLS module causes mutual TLS (mTLS) authentication to fail open if the configured Certificate Authority (CA) file is missing or unreadable. Instead of halting the server, Caddy swallows the error and initializes the TLS configuration with a nil CA pool, defaulting to the system's public trust store.

The Hook: The Polite Bouncer Problem

Mutual TLS (mTLS) is the gold standard for service-to-service authentication. It’s the digital equivalent of a bouncer at a speakeasy who demands a very specific membership card signed by the owner before letting you in. In a properly secured environment, if the bouncer loses the guest list, the club stays closed. Nobody gets in. That is 'failing secure'.

Caddy, the modern, automatic-HTTPS web server we all know and love, decided to take a different approach in versions prior to 2.11.1. In a twist of irony suitable for a dark comedy, if Caddy cannot find the 'guest list' (your private CA certificate), it doesn't shut down. It doesn't panic. It doesn't even throw a loud error.

Instead, it shrugs, opens the door, and decides to trust anyone with a valid ID card from anywhere. Did you lose the file containing your internal Microservices Root CA? No problem. Caddy will now happily accept a client certificate signed by DigiCert, Let's Encrypt, or any other public CA in your server's system trust store. This is the definition of 'failing open,' and for a security gateway, it is catastrophic.

The Flaw: Swallowing the Evidence

The root cause of CVE-2026-27586 isn't a buffer overflow or a complex cryptographic oracle attack. It is the bane of every senior engineer's existence: Error Swallowing.

The vulnerability resides in the ClientAuthentication.provision() method within modules/caddytls/connpolicy.go. When Caddy starts up or reloads its configuration, it attempts to load the PEM files specified in your trusted_ca_cert_file directive. These files contain the cryptographic roots of trust that define who is allowed to connect.

In the vulnerable code, the logic iterates through the file paths, attempts to convert them to DER format, and appends them to the pool. However, look at the error handling logic. If convertPEMFilesToDER returns an error (e.g., file not found, permission denied, or bad format), the function returns nil.

> [!NOTE] > In Go, returning nil as an error usually means "Success".

By returning nil when an error actually occurred, the function lies to the caller. It reports that provisioning was successful, even though the specific CA file was never loaded. The variable clientauth.ca remains uninitialized (nil), but the server startup sequence continues as if everything is fine.

The Deep Dive: Why Nil Means 'Welcome Everyone'

So, we have a nil CA pool. Why does that lead to an auth bypass instead of a handshake failure? This brings us to the behavior of Go's crypto/tls standard library, which Caddy relies on.

When Caddy configures the TLS listener, it sets ClientAuth to RequireAndVerifyClientCert. This tells the Go TLS stack: "Do not establish a connection unless the client presents a valid certificate."

However, it also sets ClientCAs to the pool we just failed to load—which is now nil. You might expect nil to mean "trust nobody." But in Go's crypto/tls implementation, if ClientCAs is nil, the library defaults to using the host system's root CA set to verify client certificates.

This means the trust boundary shifts from "Only certs signed by MySecretOrg" to "Any cert signed by a Public CA trusted by Debian/Ubuntu/Alpine." If an attacker presents a certificate for evil-hacker.com signed by Let's Encrypt, Caddy verifies the chain against the system roots, sees it's valid, and allows the connection.

The Code: The One-Line Fix

The fix is embarrassingly simple, which highlights just how dangerous silent failures are. The developers simply needed to propagate the error up the stack so the server would refuse to start.

Here is the diff from commit d42d39b4bc237c628f9a95363b28044cb7a7fe72:

// modules/caddytls/connpolicy.go
 
for _, fpath := range clientauth.TrustedCACertPEMFiles {
    ders, err := convertPEMFilesToDER(fpath)
    if err != nil {
-       return nil // The Logic Bomb
+       return err // The Fix
    }
    clientauth.TrustedCACerts = append(clientauth.TrustedCACerts, ders...)
}

They also fixed a second instance of the same bug just a few lines down where caPool.Provision(ctx) was called. If the pool provisioning failed, it previously returned nil; now it correctly returns err.

This change ensures that if your security configuration is broken (missing files), the server refuses to operate. This is the correct behavior: Fail Closed.

The Exploit: Walking Through the Open Door

Exploiting this requires no memory corruption wizardry. It purely relies on configuration drift or operator error. Here is the scenario:

  1. The Setup: A sysadmin deploys Caddy to protect an internal API. They reference /etc/caddy/private_ca.pem in the config.
  2. The Trigger: The file /etc/caddy/private_ca.pem is deleted, renamed, or has its permissions changed so the Caddy user can't read it. Maybe an automated Ansible script failed halfway through a rotation.
  3. The Reload: Caddy restarts or reloads. Due to the bug, it swallows the "File Not Found" error and starts listening.
  4. The Attack: The attacker notices the mTLS port is open.

To bypass authentication, the attacker simply needs a client certificate that validates against the server's system roots. They can generate one using any public CA (if they have a domain) or potentially use a self-signed cert if the server's system trust store is incredibly lax (unlikely, but possible in containerized dev environments).

# Attacker generates a legit cert for their own domain
# (e.g. using certbot/LetsEncrypt)
certbot certonly --standalone -d attacker-box.com
 
# Attacker connects to the victim Caddy server
curl -v --cert /etc/letsencrypt/live/attacker-box.com/cert.pem \n        --key /etc/letsencrypt/live/attacker-box.com/privkey.pem \n        https://victim-caddy-server:8443

Result: HTTP/2 200 OK. Access granted.

Mitigation: Stop the Bleeding

The remediation is straightforward. If you are running Caddy, check your version immediately.

1. Patch: Update to Caddy v2.11.1 or later. This version correctly crashes/halts if your CA files are missing.

2. Audit Your Config: Even after patching, verify that your CA files actually exist. If you update and Caddy suddenly refuses to start, congratulations—you were likely vulnerable and running in a fail-open state without realizing it.

3. Log Monitoring: In the fixed version, look for fatal errors during startup. In the vulnerable version, you won't see the error, so you must rely on auditing the filesystem to ensure the trusted_ca_cert_file paths are valid.

> [!WARNING] > Do not rely on "it works" as a sign of security. In this specific case, "it works" was the symptom of the vulnerability.

Official Patches

Caddy ServerFix commit implementing error propagation

Fix Analysis (1)

Technical Appendix

CVSS Score
8.8/ 10
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N/E:P

Affected Systems

Caddy Server (Go implementation)

Affected Versions Detail

Product
Affected Versions
Fixed Version
Caddy
caddyserver
< 2.11.12.11.1
AttributeDetail
CWE IDCWE-755
Attack VectorNetwork
CVSS v4.08.8 (High)
ImpactAuthentication Bypass
Root CauseImproper Error Handling (Swallowed Error)
Exploit StatusPoC Available

MITRE ATT&CK Mapping

T1553Subvert Trust Controls
Defense Evasion
T1078Valid Accounts
Initial Access
CWE-755
Improper Handling of Exceptional Conditions

Improper Handling of Exceptional Conditions

Known Exploits & Detection

GitHub GistProof of Concept Go test case demonstrating the fail-open behavior

Vulnerability Timeline

PoC Discovered by researcher moscowchill
2026-02-09
Vendor patched (Commit d42d39b)
2026-02-12
CVE-2026-27586 Published
2026-02-24

References & Sources

  • [1]GHSA-hffm-g8v7-wrv7
  • [2]NVD - CVE-2026-27586

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•2 days ago•CVE-2026-58254
6.5

CVE-2026-58254: Authorization Bypass in NATS Server Message Tracing for Leaf Node Connections

NATS Server prior to versions 2.12.8 and 2.14.3 contains an incorrect authorization vulnerability (CWE-863) in its message tracing subsystem. When evaluating whether a connection is permitted to publish trace events to a destination subject specified in the Nats-Trace-Dest header, the server only checks standard client permissions and omits permission checks for leaf node connections. This allows a connected leaf node operator with restricted publishing privileges to emit internal trace events to unauthorized subjects and suppress standard message delivery using the Nats-Trace-Only header.

Alon Barad
Alon Barad
10 views•10 min read
•2 days ago•CVE-2026-63341
7.5

CVE-2026-63341: Unauthenticated Denial of Service via Unbounded Topic Depth in Aedes MQTT Broker

CVE-2026-63341 is a high-severity Denial of Service (DoS) vulnerability in the Aedes MQTT broker for Node.js affecting all versions prior to 1.1.1. The flaw stems from missing input validation on the hierarchical depth of incoming MQTT topic strings before they are passed to the underlying topic-matching engine, qlobber. Because qlobber enforces a hardcoded limit of 100 topic levels and throws a synchronous exception when this threshold is exceeded, an attacker can send a single MQTT packet containing 101 or more forward-slash-separated levels to trigger an uncaught exception that immediately terminates the Node.js broker process.

Alon Barad
Alon Barad
14 views•12 min read
•2 days ago•CVE-2026-61725
6.1

CVE-2026-61725: Path Traversal and Arbitrary File Overwrite in sevenz-rust2

CVE-2026-61725 is a path traversal vulnerability (CWE-22) in the sevenz-rust2 Cargo package prior to version 0.21.1. The vulnerability occurs because the decompression utility fails to validate or sanitize archive entry filenames before joining them with the destination directory path via std::path::Path::join. An attacker who supplies a crafted 7z archive containing parent directory traversal sequences or absolute paths can write or overwrite arbitrary files on the host filesystem with the privileges of the extracting process.

Alon Barad
Alon Barad
6 views•12 min read
•2 days ago•CVE-2026-77309
8.8

CVE-2026-77309: Unauthenticated Remote Code Execution in NASA-AMMOS AIT-GUI via Incomplete File Cleanup and Path Traversal

CVE-2026-77309 (GHSA-jrjx-9jjw-747m) is a high-severity unauthenticated remote code execution vulnerability affecting NASA-AMMOS AIT-GUI versions 1.0.0 through 2.5.0. The flaw results from chaining an incomplete file cleanup error in the telemetry query endpoint (/tlm/query) with a directory traversal flaw in the script execution endpoint (/script/run). An attacker on an adjacent network can stage arbitrary Python statements into a static file on disk and execute that file under the privileges of the AIT-GUI web server process.

Amit Schendel
Amit Schendel
15 views•10 min read
•2 days ago•CVE-2026-77332
2.3

CVE-2026-77332: Surfaced-Memory Envelope Injection and Stored Prompt Injection in memtomem-stm

A vulnerability classified under CWE-116 (Improper Encoding or Escaping of Output) exists in memtomem-stm versions 0.1.0 through 0.1.33. The software acts as a Model Context Protocol (MCP) short-term memory proxy gateway for AI agent architectures. When surfacing retrieved memories and scratchpad items into downstream Large Language Model (LLM) context envelopes, the SurfacingFormatter component fails to properly sanitize untrusted memory attributes. An attacker with the ability to plant untrusted content into the agent's long-term or working memory store can inject arbitrary structural delimiters, close the <surfaced-memories> XML boundary prematurely, visually obscure instructions using Unicode bidirectional overrides, and execute stored prompt injection attacks against downstream LLM agents.

Alon Barad
Alon Barad
18 views•10 min read
•2 days ago•CVE-2026-77331
2.0

CVE-2026-77331: Race Condition and Session State Corruption in memtomem-stm

CVE-2026-77331 (GHSA-72jh-722p-rqr3) is a concurrency and session-state synchronization vulnerability in memtomem-stm, a short-term memory proxy gateway for AI agents. In versions 0.1.2 prior to 0.1.34, concurrent Model Context Protocol (MCP) Remote Procedure Call (RPC) failures or mid-flight task cancellations can initiate duplicate reconnect loops and permit dirty or cancelled transport sessions to be reused. This deficiency results in session-state integrity loss and local service degradation.

Amit Schendel
Amit Schendel
8 views•9 min read