SSRFing the Web with the help of Copilot Studio
A server-side request forgery (SSRF) vulnerability in Microsoft Copilot Studio allowed an attacker to make the service send HTTP requests to internal resources, including the Azure Instance Metadata Service (IMDS) and an internal Cosmos DB instance. By bypassing SSRF protections, the attacker could retrieve managed identity access tokens and Cosmos DB master keys, potentially gaining read/write access to shared infrastructure.
Published on tenable.com
Subscribe
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
Likely the application allowed user-controlled HTTP requests without adequately restricting redirects and header manipulation, enabling bypass of SSRF protections.
Impact
The vulnerability could allow an attacker to access sensitive internal information, including managed identity tokens and Cosmos DB master keys, and potentially gain read/write access to shared infrastructure, though no cross-tenant information was immediately accessible.
What the attacker needed
Access to Copilot Studio; Ability to create a Copilot; Attacker-controlled server for redirect
How it was found
- Create a Copilot in Copilot Studio and add an HttpRequestAction to a topic.
- Configure the HttpRequestAction to send a request to an attacker-controlled server that responds with a 301 redirect to the target internal address.
- Add a Metadata header with value 'true' followed by newlines to push the automatically added X-Forwarded-For header into the request body.
- Send the request via the Copilot chat to retrieve instance metadata from the IMDS.
- Use the obtained managed identity access token to query Azure Resource Manager for subscriptions and resources.
- Use the Cosmos DB master keys and endpoint to make authorized requests to the internal Cosmos DB instance via the Copilot.
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.
This report describes a server-side request forgery (SSRF) bug. In SSRF, an attacker tricks a server into making requests to places it shouldn't, like internal services that are not meant to be exposed. Here, the Copilot Studio feature that lets users make HTTP requests could be abused to reach Microsoft's internal metadata service and a database, potentially exposing sensitive data.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.