Tried, Tested and Proven

Vulnerability title: SetUID/SetGID Programs Allow Privilege Escalation Via Insecure RPATH In IBM DB2

CVE: CVE-2014-0907
Vendor: IBM
Product: DB2
Affected versions: V9.1, V9.5, V9.7, V10.1 and V10.5
Fixed versions: V9.7 FP9a, V10.1 FP3a, V10.1 FP4 and V10.5 FP3a
Reported by: Tim Brown

Details:

It has been identified that binaries that are executed with elevated privileges (SetGID and SetUID programs) in IBM’s DB2 for AIX and Linux have been compiled in manner that means they searched for libraries in insecure locations.

SUIDFILE='/db2/db2gpe/sqllib/acs/acscim' SUIDFILELS='-rwsr-x--- 1 root dbgpeadm 43848124 04 Oct 2012 /db2/db2gpe/sqllib/acs/acscim' RPATH='../../common/unx/supincl/pegcim251/lib' RPATHRELATIVE=yes RPATHLS=N/A RAPTHEXISTS=N/A ISBAD=yes
SUIDFILE='/db2/db2gpe/sqllib/acs/acsnnas' SUIDFILELS='-rwsr-x--- 1 root dbgpeadm 43399984 04 Oct 2012 /db2/db2gpe/sqllib/acs/acsnnas' RPATH='../../common/unx/supincl/ontapsdk16/lib/aix' RPATHRELATIVE=yes RPATHLS=N/A RAPTHEXISTS=N/A ISBAD=yes
SUIDFILE='/db2/db2gpe/sqllib/acs/acsnsan' SUIDFILELS='-rwsr-x--- 1 root dbgpeadm 46767866 04 Oct 2012 /db2/db2gpe/sqllib/acs/acsnsan' RPATH='../../common/unx/supincl/ontapsdk16/lib/aix' RPATHRELATIVE=yes RPATHLS=N/A RAPTHEXISTS=N/A ISBAD=yes
SUIDFILE='/db2/db2gpe/sqllib/adm/db2iclean' SUIDFILELS='-r-sr-x--- 1 root dbgpeadm 23157 25 May 2013 /db2/db2gpe/sqllib/adm/db2iclean' RPATH='.' RPATHRELATIVE=yes RPATHLS=N/A RAPTHEXISTS=N/A ISBAD=yes
SUIDFILE='/db2/db2gpp/sqllib/acs/acscim' SUIDFILELS='-rwsr-x--- 1 root dbgppadm 43848124 04 Oct 2012 /db2/db2gpp/sqllib/acs/acscim' RPATH='../../common/unx/supincl/pegcim251/lib' RPATHRELATIVE=yes RPATHLS=N/A RAPTHEXISTS=N/A ISBAD=yes
SUIDFILE='/db2/db2gpp/sqllib/acs/acsnnas' SUIDFILELS='-rwsr-x--- 1 root dbgppadm 43399984 04 Oct 2012 /db2/db2gpp/sqllib/acs/acsnnas' RPATH='../../common/unx/supincl/ontapsdk16/lib/aix' RPATHRELATIVE=yes RPATHLS=N/A RAPTHEXISTS=N/A ISBAD=yes
SUIDFILE='/db2/db2gpp/sqllib/acs/acsnsan' SUIDFILELS='-rwsr-x--- 1 root dbgppadm 46767866 04 Oct 2012 /db2/db2gpp/sqllib/acs/acsnsan' RPATH='../../common/unx/supincl/ontapsdk16/lib/aix' RPATHRELATIVE=yes RPATHLS=N/A RAPTHEXISTS=N/A ISBAD=yes
SUIDFILE='/db2/db2gpp/sqllib/adm/db2iclean' SUIDFILELS='-r-sr-x--- 1 root dbgppadm 23157 25 May 2013 /db2/db2gpp/sqllib/adm/db2iclean' RPATH='.' RPATHRELATIVE=yes RPATHLS=N/A RAPTHEXISTS=N/A ISBAD=yes
SUIDFILE='/hpadmin/swrepo/sqllib/adm/db2iclean' SUIDFILELS='-r-sr-x--- 1 root 226 23157 06 May 2013 /hpadmin/swrepo/sqllib/adm/db2iclean' RPATH='.' RPATHRELATIVE=yes RPATHLS=N/A RAPTHEXISTS=N/A ISBAD=yes

Impact:

An attacker could place a malicious library in one of the above directories, which would then be loaded when the affected program is run, leading to privilege escalation in instances where the program runs with privileges that the attacker does not have. For example, if the program is SetUID root, the attacker would obtain root privileges upon exploiting this vulnerability.

Exploit:

The proof of concept exploit code is available.

Vendor status:

26/02/2014 Advisory created
28/02/2014 Vendor contacted
13/03/2014 Vendor contact reattempted
13/03/2014 Vendor responded and investigating to confirm vulnerabilities
24/03/2014 Vulnerability confirmed – vendor working on a fix
04/04/2014 Requested update from vendor
07/04/2014 Vendor responded with brief progress update
16/04/2014 Requested update from vendor and informed them of release of similar RPATH advisories from other vendors
17/04/2014 Vendor responded with a planned release in May and an assigned CVE-ID
22/05/2014 Requested update from vendor
29/05/2014 Vendor responded and informed us they have released a fix and bulletin
03/06/2014 Published
Copyright:

Copyright © Portcullis Computer Security Limited 2014, All rights reserved worldwide. Permission is hereby granted for the electronic redistribution of this information. It is not to be edited or altered in any way without the express written consent of Portcullis Computer Security Limited.

Disclaimer:

The information herein contained may change without notice. Use of this information constitutes acceptance for use in an AS IS condition. There are NO warranties, implied or otherwise, with regard to this information or its use. Any use of this information is at the user’s risk. In no event shall the author/distributor (Portcullis Computer Security Limited) be held liable for any damages whatsoever arising out of or in connection with the use or spread of this information.