CVE-2022-1292

7.3 HIGH

📋 TL;DR

CVE-2022-1292 is a command injection vulnerability in the c_rehash script distributed with OpenSSL. It allows attackers to execute arbitrary commands with script privileges when the script processes untrusted input. This affects systems using vulnerable OpenSSL versions where c_rehash is automatically executed.

💻 Affected Systems

Products:
  • OpenSSL
Versions: OpenSSL 3.0.0-3.0.2, 1.1.1-1.1.1n, 1.0.2-1.0.2zd
Operating Systems: Linux distributions including Debian, Ubuntu, CentOS, RHEL that package vulnerable OpenSSL versions
Default Config Vulnerable: ⚠️ Yes
Notes: Only vulnerable when c_rehash script is executed, which may happen automatically during certificate management on some systems.

📦 What is this software?

Openssl by Openssl

OpenSSL is a robust, commercial-grade toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. It provides cryptographic functions and is one of the most widely used libraries for implementing secure communications in applications worldwide.

Learn more about Openssl →

Openssl by Openssl

OpenSSL is a robust, commercial-grade toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. It provides cryptographic functions and is one of the most widely used libraries for implementing secure communications in applications worldwide.

Learn more about Openssl →

Openssl by Openssl

OpenSSL is a robust, commercial-grade toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. It provides cryptographic functions and is one of the most widely used libraries for implementing secure communications in applications worldwide.

Learn more about Openssl →

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution with the privileges of the user running c_rehash, potentially leading to full system compromise if run as root.

🟠

Likely Case

Local privilege escalation or arbitrary command execution when c_rehash processes attacker-controlled certificate files.

🟢

If Mitigated

Limited impact if script execution is restricted or untrusted input is not processed.

🌐 Internet-Facing: MEDIUM - Requires specific conditions where c_rehash processes external input, but automated execution increases risk.
🏢 Internal Only: MEDIUM - Internal users could exploit if they can influence certificate files processed by c_rehash.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires ability to influence input to c_rehash script. Proof-of-concept code is publicly available.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: OpenSSL 3.0.3, 1.1.1o, 1.0.2ze

Vendor Advisory: https://www.openssl.org/news/secadv/20220503.txt

Restart Required: No

Instructions:

1. Update OpenSSL to patched version using system package manager. 2. For Linux: 'sudo apt update && sudo apt upgrade openssl' (Debian/Ubuntu) or 'sudo yum update openssl' (RHEL/CentOS). 3. Verify update with 'openssl version'.

🔧 Temporary Workarounds

Remove c_rehash script

linux

Delete or rename the vulnerable c_rehash script to prevent execution

sudo rm /usr/bin/c_rehash
sudo mv /usr/bin/c_rehash /usr/bin/c_rehash.bak

Use OpenSSL rehash tool

all

Replace c_rehash usage with the secure 'openssl rehash' command

openssl rehash /path/to/certificates

🧯 If You Can't Patch

  • Restrict execution permissions on c_rehash script to prevent unauthorized use
  • Audit systems for automated c_rehash execution and disable those processes

🔍 How to Verify

Check if Vulnerable:

Check OpenSSL version with 'openssl version' and compare to affected ranges. Also check if c_rehash exists with 'which c_rehash'.

Check Version:

openssl version

Verify Fix Applied:

Confirm OpenSSL version is 3.0.3+, 1.1.1o+, or 1.0.2ze+ using 'openssl version'.

📡 Detection & Monitoring

Log Indicators:

  • Unusual process execution from c_rehash script
  • Shell commands in certificate processing logs

Network Indicators:

  • Unusual outbound connections from systems running c_rehash

SIEM Query:

Process execution where parent_process contains 'c_rehash' AND (command_line contains ';' OR command_line contains '|' OR command_line contains '&')

🔗 References

📤 Share & Export