Disabled TLS Validation (ARCH7119)
Ce contenu n’est pas encore disponible dans votre langue.
Key php.security.disabled-tls-validation · Severity error · Category security · CWE CWE-295
Unconditionally disabling certificate or hostname validation defeats the authentication purpose of TLS. An attacker can sit in the middle (MITM), present a forged certificate, and read the traffic.
Incorrect
Section titled “Incorrect”<?php$response = $client->get('https://api.example.com', [ 'verify' => false, // certificate validation off]);Correct
Section titled “Correct”<?php$response = $client->get('https://api.example.com', [ 'verify' => true, // validate against the system CA bundle]);Always keep TLS certificate and hostname validation enabled; if a custom CA is required, pass the CA bundle path to verify.