/

CVE-2026-32253

Severity:

CRITICAL RISK

(9.8)

Authentication Bypass in Sunshine Game Stream Host

CVE-2026-32253

Analyzed

Vulnerability type

Category:

Authentication Bypass

CWE:

CWE-287, CWE-295

Impact:

Authentication Bypass leading to Unauthorized Access

Severity:

CRITICAL RISK

(9.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Sunshine's mutual TLS (mTLS) client-certificate authentication incorrectly treats certain certificate verification errors as success, allowing untrusted or invalid client certificates to be accepted.

Under these conditions, an attacker presenting a locally untrusted, not-yet-valid, or expired certificate may bypass client authentication and gain access to protected HTTPS endpoints.

Affected context

This vulnerability affects Sunshine deployments configured to use client-certificate (mTLS) authentication to protect HTTPS endpoints.

The issue is present where the application relies on OpenSSL's verification callbacks but overrides the default behavior with a custom verify function.

Specifically, environments where the trust store is incomplete, out of date, or where clients may legitimately present not-yet-valid or borderline certificates are more exposed, because the callback treats key verification failures as success.

Exploit preconditions

  • Attack surface: Sunshine HTTPS endpoints protected by client-certificate authentication (mTLS).
  • Required access: Network-level ability to connect to the Sunshine service (e.g., same LAN, VPN, or exposed endpoint).
  • Trigger point: Presentation of a TLS client certificate during the handshake that triggers errors such as:
  • X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY
  • X509_V_ERR_CERT_NOT_YET_VALID
  • X509_V_ERR_CERT_HAS_EXPIRED
  • Why exploitation is possible: The custom OpenSSL verification callback in src/crypto.cpp interprets these error codes as success and returns a positive verification result, causing the TLS layer and application to treat the client as authenticated even when the certificate is untrusted or invalid.

Why this happens

The underlying bug is a logic flaw in the authentication flow, specifically in how certificate verification results from OpenSSL are interpreted.

Instead of failing the connection when certain verification errors occur, the custom callback explicitly treats error codes such as "unable to get issuer certificate locally," "certificate not yet valid," and "certificate has expired" as success conditions.

This maps to CWE-287: Improper Authentication, because the system incorrectly concludes that a client has been authenticated, and to CWE-295: Improper Certificate Validation, because the certificate chain and validity window are not properly enforced.

At an abstract level, the pattern is: security decisions (granting authenticated access) are made while ignoring or downgrading critical verification errors in cryptographic credential validation.

Potential impact

  • Unauthenticated clients can be treated as authenticated and access mTLS-protected HTTPS endpoints.
  • Attackers may connect to and control game streaming sessions without possessing a properly trusted client certificate.
  • Sensitive configuration, control APIs, or user-specific data exposed via HTTPS endpoints can be accessed by unauthorized parties.
  • Attackers may leverage unauthorized control to pivot within the local network environment (for example, exploiting trust in the Sunshine host).

General mitigation guidance

Effective mitigation focuses on making certificate validation strict and fail-closed, and on ensuring that authentication decisions never override critical verification errors.

Common defensive patterns include:

  • Using OpenSSL (or equivalent) verification functions without custom callbacks unless there is a compelling and well-reviewed need.
  • When custom callbacks are necessary, treating all certificate verification errors as failures by default, only allowing narrow, explicitly justified exceptions.
  • Enforcing complete and up-to-date trust stores, including all relevant CA and intermediate certificates, so that legitimate clients can be validated without relaxing checks.
  • Implementing strict validation for certificate validity periods, rejecting not-yet-valid and expired certificates.
  • Designing authentication flows so that any ambiguity in certificate status results in denial of access (fail-safe defaults).

How teams detect issues like this

Detection can focus on both code-level review and runtime behavior:

  • Static analysis and code review:
  • Search for custom OpenSSL/X.509 verification callbacks and inspect how error codes (e.g., X509_V_ERR_*) are handled.
  • Flag patterns where non-zero verification error codes are mapped to success or where return values from verification functions are forced to "pass".
  • Review authentication logic paths where certificate validation results are transformed, ignored, or overridden.
  • Policy and configuration checks:
  • Enforce secure coding guidelines requiring fail-closed certificate validation and forbidding the suppression of verification errors without justification.
  • Incorporate security-focused code review on cryptographic and authentication modules.
  • Runtime and operational monitoring:
  • Enable detailed TLS logging (where feasible) to detect connections that succeed with certificates that are not in the trusted CA list or that are expired.
  • Use penetration testing or automated security tests to attempt connections with invalid, expired, or untrusted certificates and verify they are rejected.

Sources

SourceLink
github.comgithub.com/LizardByte/Sunshine/releases/tag/v2026.516.143833
github.comgithub.com/LizardByte/Sunshine/security/advisories/GHSA-ph75-mgxh-mv57

Frequently asked

questions

If an attacker can reach the Sunshine HTTPS interface, exploitation can be straightforward: they only need to present a certificate that triggers one of the treated-as-success error conditions. This allows them to bypass client-certificate authentication and gain access to endpoints that were assumed to be restricted.

No. The core issue is that certain invalid or untrusted certificates are accepted as if they were valid. The attacker does not need a properly signed certificate from a trusted CA; they only need a certificate that results in one of the mishandled verification error codes.

The safest pattern is to ensure that all certificate verification failures cause the authentication process to fail. Custom verification callbacks should default to rejecting any certificate that does not fully validate, only allowing carefully audited exceptions when absolutely necessary. Additionally, keep trust stores and time synchronization correct so that valid clients can be accepted without weakening checks.

Prevention strategies include: limiting or avoiding custom cryptographic and authentication logic, adopting well-tested library defaults, enforcing strict code review for any changes to TLS or certificate handling, and adding automated tests that attempt connections with invalid, expired, or untrusted certificates to confirm they are rejected. Consistent security guidelines and automated static analysis rules around authentication flows can further reduce the risk of reintroducing similar flaws.

Find out what's already
exploitable in your codebase.