/

CVE-2026-105218

Severity:

HIGH RISK

(7.4)

Improper Certificate Validation (CWE-295) in gopay

CVE-2026-105218

Deferred

Vulnerability type

Category:

Improper Certificate Validation

CWE:

CWE-295

Impact:

Man-in-the-Middle Attack and Sensitive Data Exposure

Severity:

HIGH RISK

(7.4)

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

A TLS certificate validation flaw in gopay causes its default HTTP client to accept untrusted certificates when communicating with payment provider APIs. An attacker positioned to intercept network traffic may impersonate those APIs, exposing sensitive merchant and transaction information or altering payment-related responses.

Affected context

The vulnerability occurs in gopay deployments that use the affected default client configuration for outbound payment-provider API requests. It becomes risky when network traffic can be intercepted or redirected, such as on an untrusted network, through a compromised proxy, or in an environment with manipulated routing or trust controls.

Exploit preconditions

  • Attack surface: Outbound HTTPS connections from the gopay client to payment provider APIs
  • Required access: A network position or infrastructure control capable of intercepting or redirecting client traffic
  • Trigger point: TLS establishment performed by the default HTTP client
  • Why exploitation is possible: Certificate verification is disabled, allowing an impersonating endpoint to establish a connection without proving control of the legitimate provider certificate

Why this happens

The underlying bug is a failure to enforce peer certificate validation during TLS communication. By disabling certificate verification in the default HTTP client, the application treats any presented certificate as acceptable rather than validating it against trusted authorities and the intended service identity. This behavior maps to CWE-295, Improper Certificate Validation.

Potential impact

  • Attackers may read merchant credentials, request signatures, and transaction data
  • Payment, refund, or order-query responses could be modified in transit
  • An attacker could impersonate a payment provider API
  • Transaction processing may be disrupted or redirected
  • Exposed credentials or signing material could enable further account abuse

General mitigation guidance

Mitigation generally focuses on restoring secure-by-default TLS verification

and reducing trust in network-provided connection properties.

Common defensive patterns include:

  • Enable certificate-chain and hostname verification for every outbound HTTPS request
  • Use the platform or language runtime trust store rather than accepting arbitrary certificates
  • Avoid global or default-client settings that disable TLS verification
  • Keep payment-provider endpoints and trust configuration explicit and centrally managed
  • Protect credentials and signatures with least privilege and minimize their exposure
  • Use network segmentation, authenticated proxies, and encrypted service-to-service paths where appropriate
  • Treat certificate-validation bypasses as prohibited by application security policy

How teams detect issues like this

Organizations can identify this class of issue through:

  • Static analysis for disabled TLS verification, insecure transport settings, and permissive certificate callbacks
  • Code review checks covering HTTP client defaults and custom TLS configuration
  • Dependency and configuration scans for insecure transport behavior
  • Integration tests that reject expired, mismatched, self-signed, or otherwise untrusted certificates
  • Runtime monitoring for unexpected payment-provider destinations, certificate changes, or proxy interception
  • Policy enforcement requiring verified TLS for payment and other sensitive outbound integrations

Automated code review and security scanning tools may help flag these patterns during development.

Sources

SourceLink
github.comgithub.com/go-pay/gopay
github.comgithub.com/go-pay/gopay/blob/v1.5.118/pkg/xhttp/client.go#L15-L37
github.comgithub.com/go-pay/gopay/commit/f6df04fd4f64a2ad2c303ba063b6502bfdd259fd
github.comgithub.com/go-pay/gopay/issues/540
vulncheck.comvulncheck.com/advisories/gopay-before-1.5.119-disabled-tls-certificate-verification-in-xhttp-client

Frequently asked

questions

It can be exploited remotely when an attacker can intercept or redirect the client's outbound network traffic. The attacker does not necessarily need direct access to the gopay process.

The key requirement is a network position or infrastructure control that permits traffic interception, such as a compromised proxy, hostile network, or manipulated routing environment.

Ensure that all outbound HTTPS clients perform normal certificate-chain and hostname verification using a trusted certificate store, and prevent callers from disabling those checks.

Enforce secure transport policies in code review and CI, test failure cases involving invalid certificates, restrict outbound destinations, and monitor certificate and endpoint changes for sensitive integrations.

Find out what's already
exploitable in your codebase.