Getting code execution on Veeam through CVE-2023-27532
The Veeam Backup Service exposed an unauthenticated WCF endpoint that allowed deserialization of untrusted data. By chaining three WCF calls, an attacker could execute arbitrary code on the server.
Published on blog.scrt.ch
While several blog posts have shown how to retrieve credentials through this vulnerability, we decided to dig deeper and see whether it was possible to execute arbitrary code through this issue.
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 unauthenticated attacker could execute arbitrary code on the Veeam Backup server, escalating the CVSS score from 7.5 to a higher severity.
What the attacker needed
Network access to the Veeam Backup Service; no authentication required
The fix
Veeam initially added authentication tokens to WCF endpoints and later blacklisted the ToolboxItemContainer gadget, but the ObjRef gadget still bypassed the blacklist; a proper fix would use a whitelist-based deserialization binder.
How it was found
- Call the RestoreJobSessionsDbScopeCreateSession WCF endpoint to create a restore session and obtain a RestoreContextId.
- Call the OpenVbRestoreSession WCF endpoint with the RestoreContextId to create a session context.
- Call the ExecuteStartAgentSessionTrafficProxy WCF endpoint with the session context ID and a serialized malicious object to trigger deserialization and code execution.
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.
Veeam Backup has a network service that accepts commands without checking who sent them. One of those commands deserializes data, which means it turns a stream of bytes back into objects. If an attacker sends a crafted object, the server can be tricked into running code.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.