Cyber Security Brasilby Igor Deungaro

SSRF in an MCP Server: How a URL Becomes an IAM Credential

SSRF in an MCP Server: How a URL Becomes an IAM Credential

There is a four-step chain that turns an unremarkable MCP server feature into cloud account compromise. It relies on nothing exotic. It relies on a server that fetches a URL supplied by whoever is on the other end.

The chain, step by step

First, the MCP server exposes a tool that accepts a URL — convert a document, fetch a page, read a feed. Second, it performs the request server-side without validating the destination. Third, it runs on a cloud instance that can reach the provider's metadata endpoint. Fourth, someone points the tool at that endpoint and receives temporary IAM credentials.

This is not hypothetical. BlueRock Security analysed over 7,000 MCP servers and found roughly 36.7% potentially vulnerable to SSRF. In their proof of concept against Microsoft's MarkItDown MCP server, researchers pulled AWS access keys, secret keys and session tokens from an EC2 instance metadata endpoint.

A misconfigured server became a direct path to cloud infrastructure credentials.

Note what did not happen: no authentication bypass, no zero-day, no manipulation of the model. SSRF entered the OWASP Top 10 in 2021 and was well understood long before that. The component is from 2025; the flaw is timeless.

Why cloud makes it worse

On a traditional server, SSRF gets you access to internal services — bad, but bounded. On a cloud instance, the metadata endpoint is an unauthenticated HTTP service, reachable from any process on the machine, that hands out credentials for the attached role. That is the difference between climbing a wall and being given the house key.

And the role attached to an instance running an agent tends to be generous, because nobody knew in advance which tools the agent would need to call.

Breaking the chain

You do not need to break all four links. One is enough, and several controls cost almost nothing:

  • Require IMDSv2 and forbid IMDSv1. Version 2 uses a token obtained via PUT with a dedicated header, which defeats naive GET-based SSRF. On AWS, set HttpTokens=required. On GCP, the Metadata-Flavor: Google header plays a similar role — but only if the tool cannot control request headers.
  • Set HttpPutResponseHopLimit=1 so the response does not traverse container layers.
  • Block 169.254.169.254 on egress from any process that accepts untrusted input. An nftables rule or a network policy handles it.
  • Validate the destination before fetching: resolve DNS, reject private and link-local ranges, and re-check after redirects — otherwise a 302 undoes your validation.
  • Remove the long-lived credential with workload identity federation. If there is no static key on the instance, the prize shrinks.

The ten-minute test

List the tools your MCP servers expose and mark the ones taking a URL, file path or hostname as an argument. For each, ask whether that process can reach 169.254.169.254. If it can, the whole chain is already assembled, waiting for someone to walk it.

Este blog publica em português e inglês. / This blog publishes in Portuguese and English. EN · PT

Denunciar abuso

As inseguranças do sucesso da segurança cibernética

As inseguranças do sucesso da segurança cibernética. Tornar-se um grande profissional não precisa custar sua felicidade, mas a cultura da moagem torna isso provável. Nos últimos anos, a questão da saúde mental no setor de segurança cibernética ganhou destaque. Uma  pesquisa de 2019  revelou que 1 em cada 6 CISOs admitiu se  automedicar  para lidar com o estresse de seu trabalho. A tensão passa pelo escritório do CISO e permeia todo o setor. Um perfil que está crescendo  mais rápido que o orçamento  e uma sofisticação cada vez maior e  o impacto financeiro  dos ataques se combinam para transformar o que antes era um canto do departamento de TI em uma panela de pressão. John Hammond  , pesquisador de segurança cibernética da Huntress, falou sobre “ Hard Truths and Unexpected Realities: Lamentations in Producing Cybersecurity Content ” na  Intigriti 1337UP Live  , uma conferência online sobre bugs, em março de 2022. Seus...

DICA: comandos para pentest e segurança ofensiva

Fala galera, blz ? Segue uma lista de comandos maravilhosa, voltada para teste de vulnerabilidades. Observação Pertinente: Os TIPOS de COMANDOS e as INSTRUÇÕES estão em INGLÊS! NÂO ME RESPONSABILIZO POR USO INDEVIDO. Pré-requisitos: ✔️  Python 3.5 ✔️  OS que suporte Python (eu utilizei Kali) Reconnaissance / Enumeration Extracting Live IPs from Nmap Scan nmap 10.1.1.1 --open -oG scan-results; cat scan-results | grep "/open" | cut -d " " -f 2 > exposed-services-ips Simple Port Knocking for x in 7000 8000 9000; do nmap -Pn –host_timeout 201 –max-retries 0 -p $x 1.1.1.1; done DNS lookups, Zone Transfers & Brute-Force whois domain.com dig {a|txt|ns|mx} domain.com dig {a|txt|ns|mx} domain.com @ns1.domain.com host -t {a|txt|ns|mx} megacorpone.com host -a megacorpone.com host -l megacorpone.com ns1.megacorpone.com dnsrecon -d megacorpone.com -t axfr @ns2.megacorpone.com dnsenum domain.com nslookup -> set type=any -> ls -d domain.com for ...

Atacantes precisam de menos de 10 horas para encontrar fraquezas

Atacantes precisam de menos de 10 horas para encontrar fraquezas. Configurações vulneráveis, falhas de software e serviços da Web expostos permitem que hackers encontrem pontos fracos exploráveis ​​nos perímetros das empresas em apenas algumas horas, não em dias. O hacker ético médio pode encontrar uma vulnerabilidade que permite a violação do perímetro da rede e, em seguida, explorar o ambiente em menos de 10 horas, com testadores de penetração focados na segurança da nuvem obtendo acesso mais rapidamente aos ativos direcionados. Além disso, uma vez que uma vulnerabilidade ou fraqueza é encontrada, cerca de 58% dos hackers éticos podem invadir um ambiente em menos de cinco horas. Isso está de acordo com uma pesquisa com 300 especialistas do SANS Institute e patrocinada pela empresa de serviços de segurança cibernética Bishop Fox, que também descobriu que as fraquezas mais comuns exploradas pelos hackers incluem configurações vulneráveis, falhas de software e serviços da Web expost...

Quem sou eu

Minha foto
Igor Deungaro
Bem Vindo ao Cyber Security Brasil, espero que goste !!!
Ver meu perfil completo

Cyber Security

Marcadores