The advisory for CVE-2026-32253 names three X509 verification errors that Sunshine's mTLS callback returns as success: X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY, X509_V_ERR_CERT_NOT_YET_VALID, and X509_V_ERR_CERT_HAS_EXPIRED. The patch in 2026.516.143833 deleted the first one. The patched binary in production today still returns 1 on the other two, under a comment defending the choice. The case the advisory's own PoC reached is the case the patch removed.
CVE-2026-32253: Sunshine's mTLS Whitelisted Three X509 Errors As Success. The Patch Removed One.
vendor
patterns
cve
The verify callback returned success on three failure modes
Sunshine is a self-hosted host for the Moonlight game-streaming protocol, maintained as an open-source project under the LizardByte organization on GitHub. A paired Moonlight client (typically a tablet, a phone, or a low-power streaming box) connects to Sunshine over HTTPS on port 47984, authenticates with a client certificate exchanged during pairing, and is handed a session token that Moonlight then uses to negotiate the actual video and input streams. Past the certificate check, the stream is the host's desktop and the inputs are the host's keyboard and mouse. The home user running Sunshine on a gaming desktop, the kiosk operator running it on a virtual machine, the lab admin running it on a shared workstation: in each role, a bypass at the verify callback is a bypass at the desktop.
The certificate check lives in a function called openssl_verify_cb in src/crypto.cpp. It is the OpenSSL verification callback wired into the mTLS handshake by cert_chain_t::verify. Through every Sunshine release up to and including 2026.516.143832, the callback read like this:
static int openssl_verify_cb(int ok, X509_STORE_CTX *ctx) {
int err_code = X509_STORE_CTX_get_error(ctx);
switch (err_code) {
// Expired or not-yet-valid certificates are fine. Sometimes Moonlight is running on embedded devices
// that don't have accurate clocks (or haven't yet synchronized by the time Moonlight first runs).
// This behavior also matches what GeForce Experience does.
// TODO: Checking for X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY is a temporary workaround to get moonlight-embedded to work on the raspberry pi
case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY:
case X509_V_ERR_CERT_NOT_YET_VALID:
case X509_V_ERR_CERT_HAS_EXPIRED:
return 1;
default:
return ok;
}
}Three case labels. Three OpenSSL error codes, each named by the standard for a distinct failure mode of X509_verify_cert(). One return 1 covering all of them. OpenSSL's contract for the verify callback's return value is that 1 instructs the chain verifier to accept the offending error and continue. Read line by line: a peer certificate whose issuer is not in the local trust store is accepted; a peer certificate whose notBefore date is in the future is accepted; a peer certificate whose notAfter date is in the past is accepted.
The endpoints gated by this callback are declared inline in src/nvhttp.cpp:
https_server.resource["^/serverinfo$"]["GET"] = serverinfo<SunshineHTTPS>;
https_server.resource["^/applist$"]["GET"] = applist;
https_server.resource["^/launch$"]["GET"] = [&host_audio](auto resp, auto req) {
launch(host_audio, resp, req);
};
https_server.resource["^/resume$"]["GET"] = [&host_audio](auto resp, auto req) {
resume(host_audio, resp, req);
};/launch is the consequential one. A caller who reaches /launch with the requested app ID receives a session token, which Moonlight then uses to open the RTP/RTSP streams carrying H.264 from the host's framebuffer and uinput-style key/mouse events back into the host's input subsystem. The verify callback is the only authentication gate between the network and that session token.
The advisory's PoC reached only one of the three errors
LizardByte filed CVE-2026-32253 on 2026-05-21 as GitHub Security Advisory GHSA-ph75-mgxh-mv57. The advisory description names all three case labels. The advisory's PoC section ships these commands, in this order:
openssl req -x509 -newkey rsa:2048 -nodes -keyout attacker-root.key \
-out attacker-root.crt -days 365 -subj "/CN=AttackerRoot"
openssl req -newkey rsa:2048 -nodes -keyout attacker-leaf.key \
-out attacker-leaf.csr -subj "/CN=AttackerLeaf"
openssl x509 -req -in attacker-leaf.csr -CA attacker-root.crt \
-CAkey attacker-root.key -CAcreateserial -out attacker-leaf.crt -days 365A self-signed CA. A leaf signed by it. Both with a 365-day validity window starting at the moment of generation. Neither expired. Neither not-yet-valid. The accompanying Python script then connects to https://localhost:47984/applist presenting attacker-leaf.crt and its corresponding key:
res = requests.get(
f'https://{HOST}:{PORT}/applist',
cert=CERT_FILES,
verify=False,
)When the leaf reaches Sunshine's verify path, the local trust store contains only certificates added by cert_chain.add() from previously paired Moonlight clients. None of them signed AttackerRoot. OpenSSL's chain validator walks the leaf back to its CN=AttackerRoot issuer, finds nothing in the store with that subject, and emits exactly one error code: X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY. The callback's switch matches the first case label, returns 1, and the handshake completes. /applist responds.
Three error codes named in the advisory description. One error code reached by the advisory's PoC. The PoC's certificate generation chooses 365-day validity for both certs, computed from now; running the PoC tomorrow, or next year, would still produce UNABLE_TO_GET_ISSUER_CERT_LOCALLY as the primary error. The PoC does not exercise CERT_NOT_YET_VALID or CERT_HAS_EXPIRED. Exercising either would require a certificate that also chains to a stored trust anchor, and the PoC's self-signed structure does not.
The patch removed the one the PoC reached
Commit 888a6bb0 landed on 2026-05-07 with the commit message "Merge commit from fork" (the GitHub conventional title for a merge from a private security-advisory fork) and this diff:
--- a/src/crypto.cpp
+++ b/src/crypto.cpp
@@ -35,8 +35,6 @@ namespace crypto {
// Expired or not-yet-valid certificates are fine. Sometimes Moonlight is running on embedded devices
// that don't have accurate clocks (or haven't yet synchronized by the time Moonlight first runs).
// This behavior also matches what GeForce Experience does.
- // TODO: Checking for X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY is a temporary workaround to get moonlight-embedded to work on the raspberry pi
- case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY:
case X509_V_ERR_CERT_NOT_YET_VALID:
case X509_V_ERR_CERT_HAS_EXPIRED:
return 1;Two lines deleted. The TODO comment that named one of the three cases as a temporary workaround. The case label it labeled. Nothing else.
The post-patch callback in 2026.516.143833 reads:
switch (err_code) {
// Expired or not-yet-valid certificates are fine. Sometimes Moonlight is running on embedded devices
// that don't have accurate clocks (or haven't yet synchronized by the time Moonlight first runs).
// This behavior also matches what GeForce Experience does.
case X509_V_ERR_CERT_NOT_YET_VALID:
case X509_V_ERR_CERT_HAS_EXPIRED:
return 1;
default:
return ok;
}Two case labels still return 1. The comment above them is unchanged. The advisory description names all three of the original case labels and closes with the sentence "This issue has been fixed in version 2026.516.143833." The binary that version produces returns 1 on X509_V_ERR_CERT_HAS_EXPIRED.
The TODO was marked temporary for 1768 days
The verify callback was authored on 2021-07-05 by Cameron Gutman in a commit titled "Allow expired or not-yet-valid client certificates". The original three-case layout came in with that commit:
switch (err_code) {
//FIXME: Checking for X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY is a temporary workaround to get mmonlight-embedded to work on the raspberry pi
case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY:
return 1;
// Expired or not-yet-valid certificates are fine. Sometimes Moonlight is running on embedded devices
// that don't have accurate clocks (or haven't yet synchronized by the time Moonlight first runs).
// This behavior also matches what GeForce Experience does.
case X509_V_ERR_CERT_NOT_YET_VALID:
case X509_V_ERR_CERT_HAS_EXPIRED:
return 1;The //FIXME comment names the UNABLE_TO_GET_ISSUER_CERT_LOCALLY case as a "temporary workaround" to support moonlight-embedded on a Raspberry Pi. Gutman understood at the time of authoring that accepting any cert whose issuer is not in the local store was operational debt. He shipped it anyway because a specific embedded client could not pair without it. On 2024-06-28, commit 1dd4b68e upgraded the //FIXME marker to // TODO, fixed the mmonlight misspelling in the comment, and left the case label in place.
From 2021-07-05 to the patch on 2026-05-07 is 1768 days. For 1768 days, the codebase carried its own annotation that one of the three case labels was scaffolding rather than policy. The 2026 patch is the day the codebase finally honored the annotation it had written about itself. This is todo-that-shipped in its variant where the patch eventually arrives, and arrives only on the line the comment had marked. Sibling exhibits of the pattern have the patch land alongside the comment and walk past it: Cockpit's CVE-2026-4802 shipped a sixty-one-month-old comment naming the sh -ec invocation as the wrong architecture, then patched the shell command and left the comment three lines above. Sunshine's variant moves the comment with the patch. The case label and the TODO above it die together.
The two case labels above the TODO were never marked. They have a comment, but the comment is not deferral. It is justification. "Expired or not-yet-valid certificates are fine." The verb is are, not should be. The comment does not promise a fix. It explains why the gate's behavior is intentionally narrower than the X509 standard's. The patch did not touch it.
The TODO was the codebase's testimony that one of the three cases was unintentional. The patch closed that one. The two cases that ship in the patched binary are the two that the codebase had documented as deliberate.
GeForce Experience is the other justification
The comment names two reasons for accepting expired and not-yet-valid certificates. The first is operational: Moonlight clients on embedded devices may have wrong clocks (no real-time clock chip, no NTP synchronization yet). The second is a binary-compatibility appeal: "This behavior also matches what GeForce Experience does." GeForce Experience is NVIDIA's proprietary streaming host, the closed-source application Moonlight was originally written to talk to. LizardByte built Sunshine as the free-software host that lets existing Moonlight clients run against non-NVIDIA hardware. If GeForce Experience accepts expired certificates, Sunshine accepts expired certificates, or pre-existing Moonlight pairings whose client certs have rolled past notAfter would work against GeForce Experience and break against Sunshine.
The patch did not touch that reasoning. The patch removed the one case label whose annotation had named it as deferred work. The two case labels under the embedded-clocks-and-GeForce-Experience comment ship in 2026.516.143833 with the comment unchanged.
This is also fail-open-intercept in its OpenSSL verify-callback dialect. Tomcat's EncryptInterceptor catches a GeneralSecurityException from the decrypt call and forwards the bytes downstream; DataEase's CommunityTokenFilter writes a 401 inside a catch and calls filterChain.doFilter() outside it; Xerte's connector.php emits a 302 without exit and proceeds to the handler. Sunshine's callback uses no try/catch at all. The switch statement enumerates the OpenSSL error codes the gate has decided to forgive, and each labeled case returns 1. No catch. No log. No rethrow. The gate receives a verification failure and reports it as a verification success.
The gate ran. The gate identified the failure. The gate reported success. In the patched binary, the gate still does that for two of the three errors the advisory said the patch closed.
The reader of the advisory believes the verify callback no longer returns 1 on X509_V_ERR_CERT_HAS_EXPIRED. The reader of the source sees that it does.