Skip to main content

SKY-D210 · Security in code

TLS certificate verification turned off

TLS (the "S" in HTTPS) checks the server's certificate so a client knows it is talking to the real server. SKY-D210 reports code that switches that check off, such as requests.get(url, verify=False), rejectUnauthorized: false or InsecureSkipVerify: true. It also covers selected certificate and hostname settings in Java, Dart and PHP.

Languages
Python, TypeScript/JavaScript, Go, Rust, Java, Dart, PHP
Quality gate
counted toward the gate limits (full and diff scans)
Finding type
review
Catalog name
TLS verification disabled
Go engine ID
SKY-G210, reported as SKY-D210
Wrong result? Report itA false positive, a missed case or a confusing message: it goes privately to the founder.

Why it matters

Anyone on the network path, such as a hostile Wi-Fi hotspot, a compromised router or a container sidecar, can then pose as the server, read the credentials and data the client sends and change the responses it gets.

What Skylos flags

app/inventory.py · PythonReported on line 7
import requests INVENTORY_URL = "https://inventory.internal.example.com/api/stock"  def fetch_stock(sku: str) -> dict:    response = requests.get(INVENTORY_URL, params={"sku": sku}, verify=False)    response.raise_for_status()    return response.json()

What Skylos leaves alone

tests/test_inventory.py · Python
import requests  def test_stock_endpoint_answers(local_server):    response = requests.get(f"{local_server}/api/stock?sku=A1", verify=False)    assert response.status_code == 200

Why Skylos leaves it alone

The call is in a test module, where turning verification off is the usual way to reach a local server with a self-signed certificate. Python files named test_*.py, *_test.py or conftest.py, or under a tests/ or test/ folder, are not checked by this rule.

More languages

TypeScript

Flagged

src/billing/client.ts · TypeScriptReported on line 3
import https from "node:https"; const agent = new https.Agent({ rejectUnauthorized: false }); export function getInvoices(done: (body: string) => void): void {  https.get("https://billing.internal.example.com/invoices", { agent }, (res) => {    let body = "";    res.on("data", (chunk) => (body += chunk));    res.on("end", () => done(body));  });}

Not flagged

src/billing/client.ts · TypeScript
import fs from "node:fs";import https from "node:https"; const agent = new https.Agent({  ca: fs.readFileSync("/etc/ssl/certs/internal-ca.pem"),  rejectUnauthorized: true,}); export function getInvoices(done: (body: string) => void): void {  https.get("https://billing.internal.example.com/invoices", { agent }, (res) => {    let body = "";    res.on("data", (chunk) => (body += chunk));    res.on("end", () => done(body));  });}

Why Skylos leaves it alone

Verification stays on, and the private CA that signs the internal server's certificate is trusted explicitly with ca.

Go

Flagged

inventory/client.go · GoReported on line 10
package inventory import (	"crypto/tls"	"net/http") func NewClient() *http.Client {	return &http.Client{Transport: &http.Transport{		TLSClientConfig: &tls.Config{InsecureSkipVerify: true},	}}}
go.mod · Text
module example.com/inventory go 1.22

Not flagged

internal/testutil/client.go · Go
package testutil import (	"crypto/tls"	"net/http"	"testing") func NewTLSClient(t testing.TB) *http.Client {	t.Helper()	return &http.Client{Transport: &http.Transport{		TLSClientConfig: &tls.Config{InsecureSkipVerify: true},	}}}

go.mod: same as in the flagged example.

Why Skylos leaves it alone

This is a test helper: the file imports testing and takes a testing.TB. The Go engine treats such files like tests and does not report InsecureSkipVerify there.

Rust

Flagged

src/client.rs · RustReported on line 4
use curl::easy::Easy; pub fn configure(client: &mut Easy) -> Result<(), curl::Error> {    client.ssl_verify_peer(false)}

Not flagged

src/client.rs · Rust
use curl::easy::Easy; pub fn configure(client: &mut Easy) -> Result<(), curl::Error> {    client.ssl_verify_peer(true)}

Why Skylos leaves it alone

The curl client checks the server's certificate chain.

How Skylos decides

  1. Runs with --danger. In Python it reports a call with the keyword verify=False (or 0) that resolves to requests or httpx, including Session, Client and AsyncClient objects; ssl._create_unverified_context(); and any call with ignore_https_errors=True, as browser libraries such as Playwright take.
  2. It reports ssl.SSLContext(...) unless the context is a PROTOCOL_TLS_SERVER context, a PROTOCOL_TLS_CLIENT context left with its defaults, or a context that the following code sets to verify_mode = ssl.CERT_REQUIRED and check_hostname = True before a client uses it. A protocol held in an unknown variable is not reported.
  3. Only the literal values count: verify=settings.VERIFY_TLS is not reported, and neither is session.verify = False set as an attribute.
  4. Skips Python test modules (test_*.py, *_test.py, conftest.py, anything under tests/ or test/), and a call that resolves to a small data-only function or class of your own project, not the library, whose result is never used.
  5. In TypeScript and JavaScript it reports any rejectUnauthorized: false in an object literal and process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0", outside test files (.test./.spec. names, test, tests and __tests__ folders).
  6. In Go it reports a tls.Config{...} literal with InsecureSkipVerify: true (by the Go engine as SKY-G210, shown as SKY-D210), except in test helpers that import testing and take a testing.TB, *testing.T, B, F or M. _test.go files are not scanned by the Go engine.
  7. In Rust it checks reqwest and native-tls builders for danger_accept_invalid_certs(true) and danger_accept_invalid_hostnames(true), including reqwest's newer tls_danger_accept_invalid_* names. On curl Easy and Easy2 handles, ssl_verify_peer(false) disables certificate chain checks and ssl_verify_host(false) disables hostname checks. The scanner recognizes literals, local Boolean branches and direct same-file calls with a disabling argument. It also reports when a supported filesystem or standard-input check can disable verification. The message distinguishes a possible setting from one known to disable the check. An opaque configuration switch or unrelated receiver stays quiet.
  8. It also detects openssl set_verify(SslVerifyMode::NONE) and an impl ServerCertVerifier from rustls whose verify_server_cert does nothing but return Ok(ServerCertVerified::assertion()), however it is installed (with_custom_certificate_verifier, set_certificate_verifier). A verifier that checks anything first is not reported, and neither is code under tests/ or benches/, build.rs, or #[cfg(test)]/#[test] code.
  9. In Java, resolves JDK X.509 trust-manager implementations and reports certificate checks that return without validating. The finding points to the method. It does not establish whether a client uses that manager.
  10. In Dart, checks a resolved dart:io HttpClient whose effective badCertificateCallback accepts every certificate within the tracked scope.
  11. In PHP, checks direct cURL option calls and literal option arrays that turn off peer or hostname verification.

How to fix it

Keep verification on. For a server whose certificate comes from a private CA, point the client at that CA instead: verify= a CA bundle path in requests/httpx, ca: in Node, RootCAs in Go.

app/inventory.py · Python · the fix, against the flagged file
import requests INVENTORY_URL = "https://inventory.internal.example.com/api/stock"Added: INTERNAL_CA = "/etc/ssl/certs/internal-ca.pem"  def fetch_stock(sku: str) -> dict:Removed:     response = requests.get(INVENTORY_URL, params={"sku": sku}, verify=False)Added:     response = requests.get(INVENTORY_URL, params={"sku": sku}, verify=INTERNAL_CA)    response.raise_for_status()    return response.json()

When it can be wrong

  • Test helpers that live outside test paths, such as scripts/smoke.py or a devtools/ package, are reported.
  • In TypeScript, rejectUnauthorized: false is reported in any object literal, including options that never reach a TLS connection.
  • Missed: session.verify = False, a verification flag read from settings, and ssl.create_default_context() followed by check_hostname = False and verify_mode = ssl.CERT_NONE. In Go, a flag that is not the literal true (InsecureSkipVerify: cfg.Insecure) is missed.

Seeing a case that isn't listed here? Report the wrong result so the rule can be fixed. Don't paste company code: describe the shape of it.

How to silence it

  • Mark a reviewed line, for example a tool that only ever talks to a device on the local network with a fixed self-signed certificate.

    Python
    r = requests.get(url, verify=False)  # skylos: ignore[SKY-D210] lab device, no CA
  • Accept the findings you already have with skylos baseline ., then scan with --baseline so only new ones are listed.

  • [tool.skylos] ignore = ["SKY-D210"] turns the rule off for the whole project.

From the Skylos rule handbook, Skylos 5.8.0 (commit 5b880b0). All rules.