Skip to content

Instantly share code, notes, and snippets.

@paulwaldmann
Last active April 9, 2024 05:33
Show Gist options
  • Save paulwaldmann/ac915ca26cc6875e4a10f84a0168d1aa to your computer and use it in GitHub Desktop.
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.
#!/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