Local Privilege Escalation Vulnerability in Ant Media Server (CVE-2024-32656)
Ant Media Server exposed an unauthenticated JMX remote management interface on localhost, allowing any local user to load a malicious MBean and execute code as the 'antmedia' service account. The attacker could then use the account's sudo privileges to run a script as root, achieving full privilege escalation.
Published on praetorian.com
In an effort to safeguard our customers, we perform proactive vulnerability research with the goal of identifying zero-day vulnerabilities that are likely to impact the security of leading organizations. Recently, we decided to take a look at Ant Media Server with the goal of identifying any vulnerabilities within the…
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
Root cause
The application started a JMX remote management listener on localhost with authentication disabled, and the service account had sudo rights to run a script as root.
Impact
A local unprivileged user could execute code as the 'antmedia' service account and then escalate to root, fully compromising the host.
What the attacker needed
Local access to the host; ability to run commands as an unprivileged user
The fix
The JMX remote management interface should be disabled or require authentication, and the service account should not have sudo rights to run scripts as root.
How it was found
- Enumerate running processes and listening ports to find the JMX service on localhost.
- Confirm the JMX service requires no authentication by enumerating MBeans.
- Use the MLet MBean to load a remote attacker-controlled MBean from a local server.
- Connect to the loaded MBean and execute arbitrary commands as the 'antmedia' user.
- Use the 'antmedia' user's sudo permission to run a script as root and execute a command to confirm root access.
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 service running on the same machine had a remote management feature turned on without a password. Any user who could log into that machine could use it to run their own code as the service's user, and that user had special permission to run a script as the all-powerful root user.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.