CVE-2016-7063: Pritunl Privilege Escalation via Path Traversal
The Pritunl Client's local root service wrote user-supplied profile data to a user-controlled path without sanitising the ID, allowing path traversal. An attacker could overwrite system files such as cron tabs to escalate privileges to root.
amlw.dev
Published on amlw.dev
The Pritunl Client communicated with a local service to perform actions. The service, running as root, would write user specified data to the user specified path, leading to privilege escalation.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Impact
An attacker could modify system files and escalate privileges to root, but the file is deleted after a few seconds, so timing is required.
What the attacker needed
Local access to the Pritunl Client service; ability to send requests to localhost:9770; timing to match cron schedule
How it was found
- Prepare a malicious profile with an ID containing path traversal to a cron tab file and data that compiles a setuid shell.
- Wait until just before cron would trigger.
- Send a POST request to the local service's /profile endpoint with the malicious profile.
- Wait for cron to execute the payload and then run the created binary to get a root shell.
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 write-up has not been written yet. The Original tab links to the source.
A background service running with full system rights accepted a file name from the user and wrote data there. Because it did not check the name, someone could use '../' to escape the intended folder and overwrite important system files, like a scheduled task list, to run their own code as the administrator.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.