CWE-295AI-written & agentic codeSeverity · Medium

Certificate checks switched off

Code turns off TLS certificate checks to make a connection work. Anyone on the network path can then pose as the server and read or change the traffic.

At a glance

Controls
CWE-295 · A07:2021 Identification and Authentication Failures
Typical severityMedium
ReferenceCWE-295
OWASP Top 10A07:2021 Identification and Authentication Failures

What it is

When a connection fails with a certificate error, a quick fix is to turn the check off. Generated code often suggests this. The connection is still encrypted, but the client no longer knows who it is talking to.

An attacker on the network path presents their own certificate and the client accepts it. They can then read tokens and data or change responses. AI-assisted attackers can search public and leaked code for the common settings that switch checks off.

Where it hides

What a reviewer can look for in the code and in the behaviour, before anyone proves it.

  • HTTP clients created with verify=False, rejectUnauthorized: false or InsecureSkipVerify
  • Webhook senders and payment or partner integrations
  • Database and message queue connections with TLS set to skip verification
  • Environment flags such as NODE_TLS_REJECT_UNAUTHORIZED=0 in deployment configs

How MATT tests it

The proof runs against the deployed product, on every release, whoever wrote the code.

  1. 01Read the code and configuration for settings that disable certificate or hostname checks.
  2. 02Trace each finding to the outbound connection it affects and the data that connection carries.
  3. 03Where a test environment allows it, point that connection at a test endpoint with an untrusted certificate and record whether the client connects.
The rule, in plain English

Every outbound connection must verify the server’s certificate.

Executable check

scan code and config: no setting that disables certificate or hostname verification as the service: connect to a test host with a self-signed certificate expect: the connection fails with a certificate error expect: no request body is sent

Every rule MATT holds →

What the fix looks like

  1. 01

    Remove every setting that disables certificate or hostname checks.

  2. 02

    Add the correct internal certificate authority to the trust store for private services.

  3. 03

    Use certificate pinning for high‑value integrations where it is practical.

  4. 04

    Add a CI check that fails on known insecure TLS settings.

A check that was never written is found by proving the deployed behaviour, fixed with the engineer who shipped it, and kept fixed by running the control on every change. What is ExploitOps? →

ExploitOps discovery call

Understand where your security loop breaks.

A call with a MATT co-founder to understand your product and whether an ExploitOps Review is worth doing. If there is a real need, we scope one with the research team.

Let’s understand your priority

What brings you to MATT?

What would you like help with?
01 / 02