Arbitrary File Reading leads to RCE in the Pulse Secure SSL VPN on the https://███
The Pulse Secure SSL VPN instance was vulnerable to a pre-auth arbitrary file reading flaw (CVE-2019-11510) that allowed reading files such as /etc/passwd. By reading stored plaintext credentials, an attacker could authenticate and then exploit a post-auth command injection (CVE-2019-11539) to achieve remote code execution as root.
- Triaged in 3 hours
- Fixed in 56 days
- Disclosed after 3 months
##Description Hello. Some time ago, researcher Orange Tsai from DEVCORE team had a talk on Defcon/BlackHat regarding Pulse Secure SSL VPN vulnerabilities fixed on 2019/4/25: CVE-2019-11510 - Pre-auth Arbitrary File Reading CVE-2019-11542 - Post-auth Stack Buffer Overflow CVE-2019-11539 - Post-auth Command Injection CVE-2019-11538 - Post-auth Arbitrary File Reading CVE-2019-11508 - Post-auth Arbitrary File Writing CVE-2019-11540 - Post-auth Session Hijacking
Link to the slides: https://i.blackhat.com/USA-19/Wednesday/us-19-Tsai-Infiltrating-Corporate-Intranet-Like-NSA.pdf
I discovered that https://████ instance is vulnerable to described vulnerabilities.
##POC
Extracting /etc/passwd as example:
curl -i -k --path-as-is https://██████/dana-na/../dana/html5acc/guacamole/../../../../../../etc/passwd?/dana/html5acc/guacamole/
The RCE can be achieved with this chain:
- Pulse Secure stores credentials in the cleartext.
- Attacker reads credentials via CVE-2019-11510 (it stored in the
/data/runtime/mtmp/lmdb/dataa/data.mdb) and authorizes on VPN - Attacker exploits CVE-2019-11539 - Post-auth Command Injection achieving RCE as root.
##Suggested fix Update the Pulse Secure SSL VPN software (also implementing certificate validation can harden access a bit if some similar CVEs will be discovered in future).
Impact
Remote code execution as root (by reading plaintext credentials and then exploiting CVE-2019-11539 - Post-auth Command Injection) and accessing intranet behind VPN.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely a path traversal vulnerability in the Pulse Secure SSL VPN allowed unauthenticated attackers to read arbitrary files, and the stored plaintext credentials enabled further exploitation.
Impact
Remote code execution as root and access to the intranet behind the VPN.
What the attacker needed
Network access to the VPN server; No authentication needed for file read
The fix
The Pulse Secure SSL VPN software should be updated, and certificate validation can be implemented to harden access.
How it was found
- Send a crafted request to the VPN server to read /etc/passwd.
- Read the file containing stored credentials.
- Use the credentials to log in to the VPN.
- Exploit the post-auth command injection to execute commands as root.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A VPN is a private network you access remotely. This report says the VPN software had a bug that let anyone read files on the server without logging in. Because the VPN saved passwords in plain text, an attacker could read them, log in, and then run commands on the server as an administrator.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.