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
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
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
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 == 200Why 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
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
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
package inventory import ( "crypto/tls" "net/http") func NewClient() *http.Client { return &http.Client{Transport: &http.Transport{ TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, }}}module example.com/inventory go 1.22Not flagged
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}, }}}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
use curl::easy::Easy; pub fn configure(client: &mut Easy) -> Result<(), curl::Error> { client.ssl_verify_peer(false)}Not flagged
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
- Runs with
--danger. In Python it reports a call with the keywordverify=False(or0) that resolves torequestsorhttpx, includingSession,ClientandAsyncClientobjects;ssl._create_unverified_context(); and any call withignore_https_errors=True, as browser libraries such as Playwright take. - It reports
ssl.SSLContext(...)unless the context is aPROTOCOL_TLS_SERVERcontext, aPROTOCOL_TLS_CLIENTcontext left with its defaults, or a context that the following code sets toverify_mode = ssl.CERT_REQUIREDandcheck_hostname = Truebefore a client uses it. A protocol held in an unknown variable is not reported. - Only the literal values count:
verify=settings.VERIFY_TLSis not reported, and neither issession.verify = Falseset as an attribute. - Skips Python test modules (
test_*.py,*_test.py,conftest.py, anything undertests/ortest/), 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. - In TypeScript and JavaScript it reports any
rejectUnauthorized: falsein an object literal andprocess.env.NODE_TLS_REJECT_UNAUTHORIZED = "0", outside test files (.test./.spec.names,test,testsand__tests__folders). - In Go it reports a
tls.Config{...}literal withInsecureSkipVerify: true(by the Go engine as SKY-G210, shown as SKY-D210), except in test helpers that importtestingand take atesting.TB,*testing.T,B,ForM._test.gofiles are not scanned by the Go engine. - In Rust it checks reqwest and native-tls builders for
danger_accept_invalid_certs(true)anddanger_accept_invalid_hostnames(true), including reqwest's newertls_danger_accept_invalid_*names. On curlEasyandEasy2handles,ssl_verify_peer(false)disables certificate chain checks andssl_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. - It also detects openssl
set_verify(SslVerifyMode::NONE)and animpl ServerCertVerifierfrom rustls whoseverify_server_certdoes nothing but returnOk(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 undertests/orbenches/,build.rs, or#[cfg(test)]/#[test]code. - 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.
- In Dart, checks a resolved
dart:ioHttpClient whose effectivebadCertificateCallbackaccepts every certificate within the tracked scope. - 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.
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.pyor adevtools/package, are reported. - In TypeScript,
rejectUnauthorized: falseis reported in any object literal, including options that never reach a TLS connection. - Missed:
session.verify = False, a verification flag read from settings, andssl.create_default_context()followed bycheck_hostname = Falseandverify_mode = ssl.CERT_NONE. In Go, a flag that is not the literaltrue(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 CAAccept the findings you already have with
skylos baseline ., then scan with--baselineso only new ones are listed.[tool.skylos] ignore = ["SKY-D210"]turns the rule off for the whole project.