TLS certificate or host name verification is turned off
What it finds
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false) and 'verify_peer' => false: turning off certificate checks lets anyone on the network path pose as the server and read or change the traffic. cURL options, set one by one or in an array, stream context options, and the verify option of HTTP clients such as Guzzle are checked. A setting made under a condition about verification follows a switch the user sets and is left alone.
From the rule's source, tls_verification_disabled.rs.
<?phpfunction fetch($url){ $ch = curl_init($url); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);tx0 reports: CURLOPT_SSL_VERIFYPEER turns off certificate verification curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);tx0 reports: CURLOPT_SSL_VERIFYHOST turns off certificate verification curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); $context = stream_context_create(['ssl' => [ 'verify_peer' => false,tx0 reports: verify_peer turns off certificate verification 'verify_peer_name' => true, ]]); $client = new Client(['verify' => false]);tx0 reports: verify turns off certificate verification return [$ch, $context, $client];} Turn it on, off or suppress it
The rule runs in every tier. To turn it off for a project, set its level in tx0.toml:
[rules]
"tx0/php:tls-verification-disabled" = "off"To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:
// tx0: ignore[tx0/php:tls-verification-disabled] reason="..."tx0 explain tx0/php:tls-verification-disabled shows the same in the terminal. Found a false positive? Report it.