Last active
April 9, 2024 05:33
-
-
Save paulwaldmann/ac915ca26cc6875e4a10f84a0168d1aa to your computer and use it in GitHub Desktop.
The script will check if the system is vulnerable to the CVE-2024-3094 vulnerability.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if ! command -v xz &> /dev/null; then | |
echo "xz package not installed. You're safe from this CVE." | |
exit 1 | |
fi | |
xz_version=$(xz --version | awk 'NR==1{print $4}') | |
vulnerable_versions=("5.6.0" "5.6.1") | |
for ver in "${vulnerable_versions[@]}"; do | |
if [[ "$xz_version" == "$ver" ]]; then | |
echo "You're Vulnerable to CVE-2024-3094. Update xz IMMEDIATELY." | |
exit 0 | |
fi | |
done | |
echo "Not vulnerable to CVE-2024-3094." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment