Riding the Azure Service Bus (Relay) into Power Platform
The Power Platform's on-premises data gateway used an insecure JSON deserialisation binder that allowed arbitrary types from certain assemblies, enabling an attacker who controls a fake gateway to send a malicious payload to the Power Platform runtime and achieve remote code execution. This gave access to first-party Azure services, including managed identities and Key Vault secrets, potentially affecting multiple tenants.
Published on netspi.com
Technical / Vulnerability Management
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 achieve remote code execution on Power Platform servers, leading to access to managed identities, Key Vault secrets, and potentially cross-tenant compromise.
What the attacker needed
Azure account with Logic Apps; Ability to create a fake Azure Relay; Target uses on-premises data gateway connector
The fix
Microsoft fixed the issue by completely rebuilding the serialization binder to enforce a much stricter type allow list.
How it was found
- Set up a fake Azure Relay service that implements the gateway interface.
- Create a Logic App and configure it to use an on-premises connector pointing to the fake gateway.
- Trigger an activity in the Logic App to make the Power Platform send a request to the fake gateway.
- Respond with a malicious serialised payload wrapped in a RelayPacketHeader.
- The Power Platform deserialises the payload and executes arbitrary code.
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.
The gateway software used a feature that lets it rebuild complex objects from data sent over the network. Because it did not properly check which object types were allowed, an attacker could send a specially crafted message that made the server run their code. This is like letting someone choose any tool from your toolbox instead of only the ones they need.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.