Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
backloop-biz authored May 4, 2022
1 parent d8c410f commit 2b6fbd5
Showing 1 changed file with 3 additions and 81 deletions.
84 changes: 3 additions & 81 deletions CVE-2022-29799_CVE-2022-29800.sh
Original file line number Diff line number Diff line change
Expand Up @@ -358,88 +358,10 @@ elif [ "$DISTRIB" == "Debian" ]; then

elif [ "$PARENT_DISTRIB" == "Centos" ] || [ "$PARENT_DISTRIB" == "RedHat" ]; then

vulnerable_versions=(
'polkit-0.112-5.ael7b'
'polkit-0.112-13.p1.el7a'
'polkit-0.96-2.el6'
'polkit-0.96-2.el6_0.1'
'polkit-0.96-5.el6_4'
'polkit-0.96-7.el6'
'polkit-0.96-7.el6_6.1'
'polkit-0.96-11.el6'
'polkit-0.96-11.el6_10.1'
'polkit-0.112-1.el7'
'polkit-0.112-5.el7'
'polkit-0.112-6.el7_2'
'polkit-0.112-7.el7_2.2'
'polkit-0.112-7.el7_2.3'
'polkit-0.112-7.el7_2'
'polkit-0.112-9.el7'
'polkit-0.112-11.el7_3'
'polkit-0.112-12.el7_3'
'polkit-0.112-12.el7_4.1'
'polkit-0.112-14.el7'
'polkit-0.112-14.el7_5.1'
'polkit-0.112-17.el7'
'polkit-0.112-18.el7'
'polkit-0.112-18.el7_6.1'
'polkit-0.112-18.el7_6.2'
'polkit-0.112-22.el7'
'polkit-0.112-22.el7_7.1'
'polkit-0.112-26.el7'
'polkit-0.115-6.el8'
'polkit-0.115-9.el8'
'polkit-0.115-9.el8_1.1'
'polkit-0.115-11.el8'
'polkit-0.115-11.el8_2.1'
'polkit-0.115-11.el8_3.2'
'polkit-0.115-11.el8_4.1'
'polkit-0.115-12.el8'
)

curver=`getRedHatPkgVer "polkit"`
echo "Your polkit version is: $curver"

vuln=0
for test_package in "${vulnerable_versions[@]}"; do
if [ "$test_package" == "$curver" ]; then
vuln=1
fi
done

if [ "$vuln" == "0" ]; then
echo "System not vulnerable"
else
echo "System vulnerable!"

if [ "$fix" == "1" ]; then

isroot=`id -u`
if [ "$isroot" != "0" ]; then
echo "Auto-fix option need root privildge. Please run with sudo or as root"
exit 1
fi

yum install -y polkit

newver=`getRedHatPkgVer "polkit"`

if [ "$curver" != "$newver" ]; then
echo "Upgrade done"

echo "System no more vulnerable!"
else
echo "Attempt to install new version of pkg failed!"
fi

fi

fi

echo "Checks for CentOS and RH aren't available now but RH6,7,8 are no vulnerables (https://access.redhat.com/security/cve/cve-2022-29799)"
exit 0
else
echo "Fix and check not available for your distribution!"
echo "Try mitigate with command: chmod 0755 /usr/bin/pkexec"
echo "Fix and check not available for your distribution!"
echo $PARENT_DISTRIB
exit 1
fi
CVE-2022-29799

0 comments on commit 2b6fbd5

Please sign in to comment.