{"id":126,"date":"2026-11-04T07:10:02","date_gmt":"2026-11-04T01:40:02","guid":{"rendered":"https:\/\/nomorebreach.com\/blog\/?p=126"},"modified":"2026-11-04T07:10:04","modified_gmt":"2026-11-04T01:40:04","slug":"ssrf-prevention-how-a-url-fetch-leaks-your-cloud-keys","status":"publish","type":"post","link":"https:\/\/nomorebreach.com\/blog\/ssrf-prevention-how-a-url-fetch-leaks-your-cloud-keys\/","title":{"rendered":"SSRF Prevention: How a URL Fetch Leaks Your Cloud Keys"},"content":{"rendered":"<p><!-- WordPress post body. Title\/category\/tags are passed on the command line. --><\/p>\n<p>Every feature that makes your server fetch a URL someone else chose is a door into your network. <strong>SSRF prevention<\/strong> matters most in the cloud, because that door can lead to the service that hands out your IAM credentials.<\/p>\n<p><em>Last updated: 2026-11-04. CVE details, cloud documentation and OWASP status below were checked against the primary sources listed at the end on that date.<\/em><\/p>\n<div class=\"key-takeaways\">\n<p><strong>Key takeaways<\/strong><\/p>\n<ul>\n<li>Server-side request forgery (SSRF) means your server sends requests to destinations an attacker picks. In the cloud, the server&#8217;s network position and IAM role become the attacker&#8217;s.<\/li>\n<li>Filtering the URL string fails. Redirects, DNS rebinding, odd IP encodings and IPv6 all get around string checks.<\/li>\n<li>What holds is layers: validate the resolved IP and pin it, refuse redirects, restrict egress, harden the metadata service, and shrink the IAM role.<\/li>\n<li>IMDSv2 mitigates most metadata theft. It does not stop the SSRF from reaching other internal services.<\/li>\n<li>AI features with a &#8220;fetch this page&#8221; tool are SSRF sinks too. Treat model-chosen URLs as untrusted input.<\/li>\n<\/ul>\n<\/div>\n<h2>What is SSRF, and why does the cloud make it worse?<\/h2>\n<p>According to <a href=\"https:\/\/top10.owasp.org\/2021\/A10_2021-Server-Side_Request_Forgery_(SSRF)\/\">OWASP Top 10 2021 (A10)<\/a>, SSRF happens when an app fetches a remote resource from a user-supplied URL without validating it. The server then sends requests to destinations the attacker chooses, including ones the attacker could never reach directly.<\/p>\n<p>Where it sits in the OWASP lists has changed. SSRF entered in 2021 as A10, added from the community survey, and OWASP noted its incidence rate was relatively low. In the <a href=\"https:\/\/top10.owasp.org\/2025\/A01_2025-Broken_Access_Control\/\">2025 edition<\/a> there is no standalone category. CWE-918 (SSRF) is mapped into A01:2025 Broken Access Control. It was merged, not removed.<\/p>\n<p>The cloud raises the stakes. On AWS, GCP and Azure, the instance metadata service sits at the link-local address <code>169.254.169.254<\/code> and is reachable only from the instance itself. A server-side fetch is a request <em>from the instance<\/em>. The <a href=\"https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Server_Side_Request_Forgery_Prevention_Cheat_Sheet.html\">OWASP SSRF Prevention Cheat Sheet<\/a> names metadata services as a common SSRF target for credential theft.<\/p>\n<h2>Where server-side request forgery hides in a startup stack<\/h2>\n<p>Look for any place your backend turns a string into an outbound request. The usual sinks:<\/p>\n<ul>\n<li>Webhook URLs that customers configure<\/li>\n<li>Link previews and unfurls<\/li>\n<li>&#8220;Import from URL&#8221; and avatar or image fetch<\/li>\n<li>PDF and HTML renderers<\/li>\n<li>OAuth and OIDC discovery documents<\/li>\n<li>JWT <code>jku<\/code> and <code>x5u<\/code> headers, which make your server fetch a key from a URL the token supplies (we cover that in our <a href=\"https:\/\/nomorebreach.com\/blog\/jwt-vulnerabilities-how-to-check-your-api\/\">JWT vulnerabilities guide<\/a>)<\/li>\n<\/ul>\n<p>That is a pattern list from our testing, not a statistic. We have no sourced figure for how many apps have SSRF, and we will not invent one.<\/p>\n<h3>Frameworks and HTTP clients get it wrong too<\/h3>\n<p>Three published CVEs show that your own validation is not the only place this breaks:<\/p>\n<ul>\n<li><a href=\"https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2024-34351\">CVE-2024-34351<\/a>, Next.js Server Actions. A modified <code>Host<\/code> header can cause SSRF when the app is self-hosted, uses Server Actions and redirects to a relative path. Fixed in 14.1.1. NVD scores it 7.5 (CVSS 3.1).<\/li>\n<li><a href=\"https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2025-27152\">CVE-2025-27152<\/a>, axios. An absolute URL overrides <code>baseURL<\/code>, leading to &#8220;SSRF and credential leakage&#8221;. Fixed in 1.8.2. NVD scores it 5.3 (CVSS 3.1). The GitHub CNA scores it 7.7 (CVSS 4.0).<\/li>\n<li><a href=\"https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2024-39338\">CVE-2024-39338<\/a>, axios 1.7.2. Path-relative URLs are processed as protocol-relative. NVD scores it 7.5.<\/li>\n<\/ul>\n<p>The lesson is ours: a <code>baseURL<\/code> or a hardcoded prefix is not a security boundary. Patch the versions above, then keep validating.<\/p>\n<h2>How a URL fetch becomes cloud credentials<\/h2>\n<p>This is the mechanism, without payloads. A cloud VM gets temporary credentials for its IAM role from the metadata service. Whatever that role is allowed to do, anyone who can make the server query the service can do. The blast radius equals the role.<\/p>\n<p>AWS has two versions of the service. According to the <a href=\"https:\/\/docs.aws.amazon.com\/AWSEC2\/latest\/UserGuide\/instancedata-data-retrieval.html\">EC2 User Guide<\/a>, IMDSv1 answers a plain GET. IMDSv2 requires a session token, obtained with a <code>PUT<\/code> request and then sent as a header on later requests. A simple &#8220;fetch this URL&#8221; bug that can only send a GET cannot complete that handshake.<\/p>\n<p>The <a href=\"https:\/\/aws.amazon.com\/blogs\/security\/defense-in-depth-open-firewalls-reverse-proxies-ssrf-vulnerabilities-ec2-instance-metadata-service\/\">AWS Security Blog<\/a> (19 November 2019) says IMDSv2 &#8220;protects against the vast majority of SSRF vulnerabilities&#8221;. Note the wording: the vast majority, not all. IMDSv2 also refuses token requests that carry an <code>X-Forwarded-For<\/code> header, and the token response&#8217;s IP TTL defaults to 1 so it does not leave the instance.<\/p>\n<p>The other clouds use a similar idea. <a href=\"https:\/\/docs.cloud.google.com\/compute\/docs\/metadata\/querying-metadata\">Google Cloud<\/a> requires a <code>Metadata-Flavor: Google<\/code> header and rejects requests with <code>X-Forwarded-For<\/code>. <a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/virtual-machines\/instance-metadata-service\">Azure<\/a> requires <code>Metadata: true<\/code> and also rejects <code>X-Forwarded-For<\/code>.<\/p>\n<p>One caveat applies to all of them. AWS notes that a static header requirement is weaker against SSRF bugs that let an attacker set arbitrary headers. These controls stop the simple GET-only case. They are not a reason to skip the other layers.<\/p>\n<h2>Why URL filtering fails<\/h2>\n<p>Most first attempts at SSRF prevention check the URL string. Blocklist <code>localhost<\/code>, block <code>169.254.169.254<\/code>, done. It does not work, for five reasons.<\/p>\n<h3>DNS rebinding and time-of-check races<\/h3>\n<p>A hostname can resolve to a public IP when you check it and an internal IP when you connect. The OWASP cheat sheet is explicit that a domain allowlist alone does not prevent DNS rebinding. Validate the <em>resolved<\/em> IPs, then connect only to those IPs, including on retries and fallbacks. OWASP A10 also warns: &#8220;Be aware of the URL consistency to avoid attacks such as DNS rebinding&#8221; and TOCTOU races.<\/p>\n<h3>Redirects<\/h3>\n<p>A URL that passes your check can answer with a redirect to somewhere that would not. OWASP says to disable redirects. Check your HTTP client&#8217;s defaults: per the <a href=\"https:\/\/requests.readthedocs.io\/en\/latest\/user\/quickstart\/\">Requests documentation<\/a>, Python <code>requests<\/code> follows redirects by default for every verb except HEAD, so pass <code>allow_redirects=False<\/code>.<\/p>\n<h3>IP encodings and parser gaps<\/h3>\n<p>Addresses can be written in hex, octal, dword and mixed forms, and IPv4 and IPv6 handling differs between libraries. String checks miss these. The cheat sheet advises parsing with a vetted library, comparing the parsed output, and rejecting the URL if parsers disagree on the host.<\/p>\n<h3>The IPv6 metadata endpoint<\/h3>\n<p>AWS also offers an IPv6 metadata endpoint, <code>[fd00:ec2::254]<\/code>. It is off by default and available on Nitro instances only. If it is enabled, a blocklist that covers only the IPv4 address misses it.<\/p>\n<h3>Deny-lists in general<\/h3>\n<p>OWASP&#8217;s position is that deny-lists are bypass-prone and allow-lists are preferred. Build the outbound URL yourself where you can, and do not accept full URLs from users.<\/p>\n<h2>AI features and agents: SSRF with a language-model front end<\/h2>\n<p>The same flaw shows up in AI products. <a href=\"https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2023-46229\">CVE-2023-46229<\/a> affected LangChain before 0.0.317. Its <code>recursive_url_loader<\/code> allowed SSRF because &#8220;crawling can proceed from an external server to an internal server&#8221;. NVD scores it 8.8.<\/p>\n<p>Our analysis, not an industry finding: a &#8220;browse&#8221; or &#8220;fetch URL&#8221; tool, a RAG ingester and a document loader are all SSRF sinks. The URL can come from a user, from a crawled page, or from model output. Treat every one of them as untrusted input.<\/p>\n<p>An attacker can steer which URL an agent fetches. That steering is covered in our post on prompt injection.<!-- link-when-live: prompt-injection-for-builders --><\/p>\n<p>Our recommendation, consistent with the OWASP guidance: run fetch tools in a sandbox or an egress-restricted network with no cloud role, and apply the same resolved-IP checks to them as to any other sink.<\/p>\n<h2>Containers and Kubernetes: the hop-limit trade-off<\/h2>\n<p>The default metadata hop limit on EC2 is 1, which AWS says is &#8220;to prevent IP forwarding&#8221;.<\/p>\n<p>According to the <a href=\"https:\/\/docs.aws.amazon.com\/eks\/latest\/best-practices\/identity-and-access-management.html\">Amazon EKS Best Practices guide<\/a>, eksctl and the official EKS CloudFormation templates set the hop limit to 2 and enable both IMDSv1 and IMDSv2. Pods can then inherit the node&#8217;s instance-profile permissions. EKS guidance is to require IMDSv2 and set hop count 1 to block pods that do not need access, without disabling IMDS on the nodes.<\/p>\n<p>AWS recommends hop limit 2 for containers that genuinely need IMDS. The trade-off is that an SSRF inside such a container can reach IMDS too. The better answer is EKS Pod Identity or IRSA, so pods never need the node role. Hop limit 1 is not universally right. It breaks containers that legitimately depend on IMDS.<\/p>\n<h2>A defensive resolve-and-validate check<\/h2>\n<p>This is the core of layer three below. It is conceptual, for Python 3.11 or later. It rejects non-HTTPS URLs, credentials in the URL, odd ports, and any resolved address that is not public.<\/p>\n<pre><code>import ipaddress, socket\nfrom urllib.parse import urlsplit\n\ndef resolve_public_ips(url: str) -&gt; list[str]:\n    \"\"\"Reject non-https, credentials-in-URL, odd ports, and any non-public resolved IP.\"\"\"\n    u = urlsplit(url)\n    if u.scheme != \"https\" or not u.hostname or u.username or u.password:\n        raise ValueError(\"blocked: scheme\/host\/userinfo\")\n    if u.port not in (None, 443):\n        raise ValueError(\"blocked: port\")\n    ips = {ai[4][0] for ai in socket.getaddrinfo(u.hostname, 443, proto=socket.IPPROTO_TCP)}\n    for ip in ips:\n        if not ipaddress.ip_address(ip.split(\"%\")[0]).is_global:  # drops 169.254\/16, RFC1918, loopback, fc00::\/7\n            raise ValueError(\"blocked: non-public destination\")\n    return sorted(ips)\n\n# Then connect ONLY to these IPs (pin them in your HTTP transport or egress proxy),\n# send the original Host\/SNI, set allow_redirects=False, a timeout, and a response size cap.\n# Never return the raw upstream response to the user.<\/code><\/pre>\n<p>This check alone is not enough. Without pinning, your HTTP client does a second DNS lookup when it connects, and that lookup can return a different answer. Pinning the validated IPs is what closes the rebinding gap. It needs a custom transport or an egress proxy.<\/p>\n<h2>SSRF prevention checklist, in priority order<\/h2>\n<p>This is the order we would work through it. Each step lists its cost.<\/p>\n<ol>\n<li><strong>Inventory every server-side fetch,<\/strong> including async jobs and AI tools. Cost: a few hours. It is the step most often skipped.<\/li>\n<li><strong>Allowlist destinations where you can.<\/strong> Build the URL yourself and do not accept full URLs. Trade-off: impossible for generic webhooks and link previews, so those need steps 3 and 4.<\/li>\n<li><strong>Resolve, validate the IP, pin it, and disable redirects<\/strong> (the code above). Trade-off: pinning needs a custom transport or a proxy.<\/li>\n<li><strong>Restrict egress at the network layer.<\/strong> Put fetchers in a separate network or behind an egress proxy with deny-by-default rules, and log allowed and blocked flows. Trade-off: infrastructure work, plus a proxy to operate.<\/li>\n<li><strong>Harden metadata.<\/strong> On AWS, set the account default to IMDSv2 (<code>HttpTokens=required<\/code>), enforce it, and use hop limit 1 unless containers need 2. Trade-off: old SDKs or agents that only speak IMDSv1 will break, so audit them first.<\/li>\n<li><strong>Shrink the IAM role<\/strong> on anything that fetches URLs, and use Pod Identity or IRSA in EKS. This limits the blast radius when the earlier layers fail.<\/li>\n<li><strong>Patch the known sinks:<\/strong> Next.js 14.1.1 or later, axios 1.8.2 or later, and LangChain past 0.0.317.<\/li>\n<li><strong>Do not return raw upstream responses<\/strong> to the user. This turns full-read SSRF into blind SSRF.<\/li>\n<\/ol>\n<p>On step 5, be careful with what AWS defaults actually did. According to the <a href=\"https:\/\/aws.amazon.com\/blogs\/aws\/amazon-ec2-instance-metadata-service-imdsv2-by-default\/\">AWS News Blog<\/a> (6 November 2023), defaults changed for new launches and new instance types, and IMDSv1 can still be enabled. Existing instances are not migrated. Check yours.<\/p>\n<h2>How long this has been known<\/h2>\n<table>\n<thead>\n<tr>\n<th>Date<\/th>\n<th>Event<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>19 Nov 2019<\/td>\n<td>AWS announces IMDSv2: session token, <code>X-Forwarded-For<\/code> refusal, TTL of 1<\/td>\n<\/tr>\n<tr>\n<td>2021<\/td>\n<td>OWASP Top 10 2021 adds A10, SSRF<\/td>\n<\/tr>\n<tr>\n<td>19 Oct 2023<\/td>\n<td>LangChain recursive URL loader SSRF, CVE-2023-46229<\/td>\n<\/tr>\n<tr>\n<td>6 Nov 2023<\/td>\n<td>AWS: Quick Start goes IMDSv2-only; new instance types IMDSv2-only &#8220;effective mid-2024&#8221;<\/td>\n<\/tr>\n<tr>\n<td>14 May 2024<\/td>\n<td>Next.js Server Actions SSRF, CVE-2024-34351<\/td>\n<\/tr>\n<tr>\n<td>12 Aug 2024<\/td>\n<td>axios CVE-2024-39338<\/td>\n<\/tr>\n<tr>\n<td>7 Mar 2025<\/td>\n<td>axios CVE-2025-27152, fixed in 1.8.2<\/td>\n<\/tr>\n<tr>\n<td>2025<\/td>\n<td>OWASP Top 10 2025 maps CWE-918 into A01 Broken Access Control<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>How we test for SSRF<\/h2>\n<p>We map every server-side fetch, then test resolved-IP validation, redirect handling, encoding and IPv6 bypasses, and metadata reachability, all inside the agreed scope. OWASP describes the same categories.<\/p>\n<p>In our opinion, scanners find obvious reflected SSRF and miss the blind kind in async jobs: webhooks, renderers and AI ingesters. They also cannot judge the IAM blast radius, which depends on what your roles are allowed to do. That takes a person who has read your architecture.<\/p>\n<p>If an enterprise customer is asking you for a pentest, see our answer to <a href=\"https:\/\/nomorebreach.com\/blog\/does-soc-2-require-a-penetration-test\/\">does SOC 2 require a penetration test<\/a>.<\/p>\n<h2>FAQ<\/h2>\n<h3>What is SSRF in simple terms?<\/h3>\n<p>SSRF, or server-side request forgery, is when an attacker gets your server to make a request to a destination they choose. It happens when an app fetches a user-supplied URL without validating it. The server can then reach internal systems and services that the attacker cannot reach from the internet.<\/p>\n<h3>How can SSRF steal AWS credentials?<\/h3>\n<p>An EC2 instance gets temporary role credentials from the instance metadata service, reachable only from the instance. If an attacker can make your server request that service and read the response, they obtain those credentials. What they can then do is limited by the permissions of that IAM role.<\/p>\n<h3>Does IMDSv2 prevent SSRF?<\/h3>\n<p>No. IMDSv2 mitigates metadata credential theft. AWS says it protects against &#8220;the vast majority&#8221; of SSRF vulnerabilities, not all of them. The SSRF bug itself remains, and it can still reach internal services that are not the metadata endpoint. Fix the fetch logic as well.<\/p>\n<h3>Is a domain allowlist enough to stop SSRF?<\/h3>\n<p>No. DNS rebinding can make an allowed hostname resolve to an internal IP at connection time, and redirects can send an allowed URL to a forbidden one. Validate the resolved IP, connect only to that pinned address, disable redirects, and restrict egress at the network layer.<\/p>\n<h3>Is SSRF still in the OWASP Top 10?<\/h3>\n<p>SSRF was A10 in the 2021 list. In the 2025 edition there is no standalone category. OWASP maps CWE-918, the SSRF weakness, into A01:2025 Broken Access Control. So it was merged rather than removed, and the risk is the same.<\/p>\n<h3>Can an AI agent or LLM feature cause SSRF?<\/h3>\n<p>Yes, if it has a tool that fetches URLs. CVE-2023-46229 in LangChain&#8217;s recursive URL loader is one published example. The URL can come from a user, a crawled page or model output, so treat it as untrusted. Run fetch tools in an egress-restricted sandbox with no cloud role.<\/p>\n<h2>Sources<\/h2>\n<ul>\n<li><a href=\"https:\/\/top10.owasp.org\/2021\/A10_2021-Server-Side_Request_Forgery_(SSRF)\/\">OWASP Top 10 2021, A10 Server-Side Request Forgery<\/a><\/li>\n<li><a href=\"https:\/\/top10.owasp.org\/2025\/A01_2025-Broken_Access_Control\/\">OWASP Top 10 2025, A01 Broken Access Control<\/a><\/li>\n<li><a href=\"https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Server_Side_Request_Forgery_Prevention_Cheat_Sheet.html\">OWASP SSRF Prevention Cheat Sheet<\/a><\/li>\n<li><a href=\"https:\/\/docs.aws.amazon.com\/AWSEC2\/latest\/UserGuide\/instancedata-data-retrieval.html\">AWS EC2 User Guide, Access instance metadata<\/a><\/li>\n<li><a href=\"https:\/\/docs.aws.amazon.com\/AWSEC2\/latest\/UserGuide\/configuring-IMDS-new-instances.html\">AWS EC2 User Guide, Configure instance metadata options for new instances<\/a><\/li>\n<li><a href=\"https:\/\/aws.amazon.com\/blogs\/security\/defense-in-depth-open-firewalls-reverse-proxies-ssrf-vulnerabilities-ec2-instance-metadata-service\/\">AWS Security Blog, defense in depth with the EC2 Instance Metadata Service (19 Nov 2019)<\/a><\/li>\n<li><a href=\"https:\/\/aws.amazon.com\/blogs\/aws\/amazon-ec2-instance-metadata-service-imdsv2-by-default\/\">AWS News Blog, IMDSv2 by default (6 Nov 2023)<\/a><\/li>\n<li><a href=\"https:\/\/docs.aws.amazon.com\/eks\/latest\/best-practices\/identity-and-access-management.html\">Amazon EKS Best Practices, Identity and Access Management<\/a><\/li>\n<li><a href=\"https:\/\/docs.cloud.google.com\/compute\/docs\/metadata\/querying-metadata\">Google Cloud, Query VM metadata<\/a><\/li>\n<li><a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/virtual-machines\/instance-metadata-service\">Microsoft Learn, Azure Instance Metadata Service<\/a><\/li>\n<li>NVD: <a href=\"https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2024-34351\">CVE-2024-34351<\/a>, <a href=\"https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2025-27152\">CVE-2025-27152<\/a>, <a href=\"https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2024-39338\">CVE-2024-39338<\/a>, <a href=\"https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2023-46229\">CVE-2023-46229<\/a><\/li>\n<li><a href=\"https:\/\/requests.readthedocs.io\/en\/latest\/user\/quickstart\/\">Requests documentation, Redirection and History<\/a><\/li>\n<\/ul>\n<hr>\n<p><strong>Want us to test every place your servers fetch a URL?<\/strong> <a href=\"https:\/\/nomorebreach.com\/contact.html\">Book a scoping call<\/a> and we will map a web and API pentest, including SSRF and cloud metadata, to your stack. If your product has agents or fetch tools, we can add an AI red team. See what we test on our <a href=\"https:\/\/nomorebreach.com\/products.html\">services page<\/a>. Not ready to talk? Start with a no-access check: our <a href=\"https:\/\/nomorebreach.com\/#snapshot\">free external attack-surface snapshot<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How SSRF turns a URL-fetch feature into stolen cloud credentials, why URL filters fail, and the layered fixes: IP checks, no redirects, egress, IMDSv2.<\/p>\n","protected":false},"author":1,"featured_media":127,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[50],"tags":[42,60,43,59],"class_list":["post-126","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-web-security","tag-appsec","tag-aws","tag-cloud-security","tag-ssrf"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>SSRF Prevention: How a URL Fetch Leaks Your Cloud Keys - NoMoreBreach Insights<\/title>\n<meta name=\"description\" content=\"How SSRF turns a URL-fetch feature into stolen cloud credentials, why URL filters fail, and the layered fixes: IP checks, no redirects, egress, IMDSv2.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/nomorebreach.com\/blog\/ssrf-prevention-how-a-url-fetch-leaks-your-cloud-keys\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SSRF Prevention: How a URL Fetch Leaks Your Cloud Keys - NoMoreBreach Insights\" \/>\n<meta property=\"og:description\" content=\"How SSRF turns a URL-fetch feature into stolen cloud credentials, why URL filters fail, and the layered fixes: IP checks, no redirects, egress, IMDSv2.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/nomorebreach.com\/blog\/ssrf-prevention-how-a-url-fetch-leaks-your-cloud-keys\/\" \/>\n<meta property=\"og:site_name\" content=\"NoMoreBreach Insights\" \/>\n<meta property=\"article:published_time\" content=\"2026-11-04T01:40:02+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-11-04T01:40:04+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/nomorebreach.com\/blog\/wp-content\/uploads\/2026\/11\/ssrf-in-cloud-apps-prevention-guide.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"nomorebreachofficial\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@NoMoreBreachSec\" \/>\n<meta name=\"twitter:site\" content=\"@nomorebreach\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"nomorebreachofficial\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/nomorebreach.com\\\/blog\\\/ssrf-prevention-how-a-url-fetch-leaks-your-cloud-keys\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/nomorebreach.com\\\/blog\\\/ssrf-prevention-how-a-url-fetch-leaks-your-cloud-keys\\\/\"},\"author\":{\"name\":\"nomorebreachofficial\",\"@id\":\"https:\\\/\\\/nomorebreach.com\\\/blog\\\/#\\\/schema\\\/person\\\/bb2410510214ded6aa0305e6ff04de94\"},\"headline\":\"SSRF Prevention: How a URL Fetch Leaks Your Cloud Keys\",\"datePublished\":\"2026-11-04T01:40:02+00:00\",\"dateModified\":\"2026-11-04T01:40:04+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/nomorebreach.com\\\/blog\\\/ssrf-prevention-how-a-url-fetch-leaks-your-cloud-keys\\\/\"},\"wordCount\":2287,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/nomorebreach.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/nomorebreach.com\\\/blog\\\/ssrf-prevention-how-a-url-fetch-leaks-your-cloud-keys\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/nomorebreach.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/ssrf-in-cloud-apps-prevention-guide.png\",\"keywords\":[\"appsec\",\"aws\",\"cloud-security\",\"ssrf\"],\"articleSection\":[\"Web Security\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/nomorebreach.com\\\/blog\\\/ssrf-prevention-how-a-url-fetch-leaks-your-cloud-keys\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/nomorebreach.com\\\/blog\\\/ssrf-prevention-how-a-url-fetch-leaks-your-cloud-keys\\\/\",\"url\":\"https:\\\/\\\/nomorebreach.com\\\/blog\\\/ssrf-prevention-how-a-url-fetch-leaks-your-cloud-keys\\\/\",\"name\":\"SSRF Prevention: How a URL Fetch Leaks Your Cloud Keys - NoMoreBreach Insights\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/nomorebreach.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/nomorebreach.com\\\/blog\\\/ssrf-prevention-how-a-url-fetch-leaks-your-cloud-keys\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/nomorebreach.com\\\/blog\\\/ssrf-prevention-how-a-url-fetch-leaks-your-cloud-keys\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/nomorebreach.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/ssrf-in-cloud-apps-prevention-guide.png\",\"datePublished\":\"2026-11-04T01:40:02+00:00\",\"dateModified\":\"2026-11-04T01:40:04+00:00\",\"description\":\"How SSRF turns a URL-fetch feature into stolen cloud credentials, why URL filters fail, and the layered fixes: IP checks, no redirects, egress, IMDSv2.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/nomorebreach.com\\\/blog\\\/ssrf-prevention-how-a-url-fetch-leaks-your-cloud-keys\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/nomorebreach.com\\\/blog\\\/ssrf-prevention-how-a-url-fetch-leaks-your-cloud-keys\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/nomorebreach.com\\\/blog\\\/ssrf-prevention-how-a-url-fetch-leaks-your-cloud-keys\\\/#primaryimage\",\"url\":\"https:\\\/\\\/nomorebreach.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/ssrf-in-cloud-apps-prevention-guide.png\",\"contentUrl\":\"https:\\\/\\\/nomorebreach.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/ssrf-in-cloud-apps-prevention-guide.png\",\"width\":1200,\"height\":630},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/nomorebreach.com\\\/blog\\\/ssrf-prevention-how-a-url-fetch-leaks-your-cloud-keys\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/nomorebreach.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SSRF Prevention: How a URL Fetch Leaks Your Cloud Keys\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/nomorebreach.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/nomorebreach.com\\\/blog\\\/\",\"name\":\"No More Breach Insights\",\"description\":\"Stop Threats Before They Start\",\"publisher\":{\"@id\":\"https:\\\/\\\/nomorebreach.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/nomorebreach.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/nomorebreach.com\\\/blog\\\/#organization\",\"name\":\"No More Breach\",\"url\":\"https:\\\/\\\/nomorebreach.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/nomorebreach.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/nomorebreach.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/01\\\/Untitled_design-removebg-preview.png\",\"contentUrl\":\"https:\\\/\\\/nomorebreach.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/01\\\/Untitled_design-removebg-preview.png\",\"width\":500,\"height\":500,\"caption\":\"No More Breach\"},\"image\":{\"@id\":\"https:\\\/\\\/nomorebreach.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/x.com\\\/nomorebreach\",\"https:\\\/\\\/instagram.com\\\/nomorebreach\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/nomorebreach.com\\\/blog\\\/#\\\/schema\\\/person\\\/bb2410510214ded6aa0305e6ff04de94\",\"name\":\"nomorebreachofficial\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6d4a84f25c82ed978512f73233e5c099b060eb4a2a74d789a240c355d0e280f4?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6d4a84f25c82ed978512f73233e5c099b060eb4a2a74d789a240c355d0e280f4?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6d4a84f25c82ed978512f73233e5c099b060eb4a2a74d789a240c355d0e280f4?s=96&r=g\",\"caption\":\"nomorebreachofficial\"},\"description\":\"The NoMoreBreach team helps startups and businesses find and fix security gaps before attackers do. We write practical, no-hype guides on real vulnerabilities, misconfigurations and attack techniques, each checked against primary sources and turned into steps you can act on. Want to see what attackers can see? Request a free external attack-surface snapshot at nomorebreach.com.\",\"sameAs\":[\"https:\\\/\\\/nomorebreach.com\\\/blog\",\"https:\\\/\\\/instagram.com\\\/nomorebreach\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/nomorebreach\",\"https:\\\/\\\/x.com\\\/NoMoreBreachSec\"],\"url\":\"https:\\\/\\\/nomorebreach.com\\\/blog\\\/author\\\/nomorebreachofficial\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SSRF Prevention: How a URL Fetch Leaks Your Cloud Keys - NoMoreBreach Insights","description":"How SSRF turns a URL-fetch feature into stolen cloud credentials, why URL filters fail, and the layered fixes: IP checks, no redirects, egress, IMDSv2.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/nomorebreach.com\/blog\/ssrf-prevention-how-a-url-fetch-leaks-your-cloud-keys\/","og_locale":"en_US","og_type":"article","og_title":"SSRF Prevention: How a URL Fetch Leaks Your Cloud Keys - NoMoreBreach Insights","og_description":"How SSRF turns a URL-fetch feature into stolen cloud credentials, why URL filters fail, and the layered fixes: IP checks, no redirects, egress, IMDSv2.","og_url":"https:\/\/nomorebreach.com\/blog\/ssrf-prevention-how-a-url-fetch-leaks-your-cloud-keys\/","og_site_name":"NoMoreBreach Insights","article_published_time":"2026-11-04T01:40:02+00:00","article_modified_time":"2026-11-04T01:40:04+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/nomorebreach.com\/blog\/wp-content\/uploads\/2026\/11\/ssrf-in-cloud-apps-prevention-guide.png","type":"image\/png"}],"author":"nomorebreachofficial","twitter_card":"summary_large_image","twitter_creator":"@NoMoreBreachSec","twitter_site":"@nomorebreach","twitter_misc":{"Written by":"nomorebreachofficial","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/nomorebreach.com\/blog\/ssrf-prevention-how-a-url-fetch-leaks-your-cloud-keys\/#article","isPartOf":{"@id":"https:\/\/nomorebreach.com\/blog\/ssrf-prevention-how-a-url-fetch-leaks-your-cloud-keys\/"},"author":{"name":"nomorebreachofficial","@id":"https:\/\/nomorebreach.com\/blog\/#\/schema\/person\/bb2410510214ded6aa0305e6ff04de94"},"headline":"SSRF Prevention: How a URL Fetch Leaks Your Cloud Keys","datePublished":"2026-11-04T01:40:02+00:00","dateModified":"2026-11-04T01:40:04+00:00","mainEntityOfPage":{"@id":"https:\/\/nomorebreach.com\/blog\/ssrf-prevention-how-a-url-fetch-leaks-your-cloud-keys\/"},"wordCount":2287,"commentCount":0,"publisher":{"@id":"https:\/\/nomorebreach.com\/blog\/#organization"},"image":{"@id":"https:\/\/nomorebreach.com\/blog\/ssrf-prevention-how-a-url-fetch-leaks-your-cloud-keys\/#primaryimage"},"thumbnailUrl":"https:\/\/nomorebreach.com\/blog\/wp-content\/uploads\/2026\/11\/ssrf-in-cloud-apps-prevention-guide.png","keywords":["appsec","aws","cloud-security","ssrf"],"articleSection":["Web Security"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/nomorebreach.com\/blog\/ssrf-prevention-how-a-url-fetch-leaks-your-cloud-keys\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/nomorebreach.com\/blog\/ssrf-prevention-how-a-url-fetch-leaks-your-cloud-keys\/","url":"https:\/\/nomorebreach.com\/blog\/ssrf-prevention-how-a-url-fetch-leaks-your-cloud-keys\/","name":"SSRF Prevention: How a URL Fetch Leaks Your Cloud Keys - NoMoreBreach Insights","isPartOf":{"@id":"https:\/\/nomorebreach.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/nomorebreach.com\/blog\/ssrf-prevention-how-a-url-fetch-leaks-your-cloud-keys\/#primaryimage"},"image":{"@id":"https:\/\/nomorebreach.com\/blog\/ssrf-prevention-how-a-url-fetch-leaks-your-cloud-keys\/#primaryimage"},"thumbnailUrl":"https:\/\/nomorebreach.com\/blog\/wp-content\/uploads\/2026\/11\/ssrf-in-cloud-apps-prevention-guide.png","datePublished":"2026-11-04T01:40:02+00:00","dateModified":"2026-11-04T01:40:04+00:00","description":"How SSRF turns a URL-fetch feature into stolen cloud credentials, why URL filters fail, and the layered fixes: IP checks, no redirects, egress, IMDSv2.","breadcrumb":{"@id":"https:\/\/nomorebreach.com\/blog\/ssrf-prevention-how-a-url-fetch-leaks-your-cloud-keys\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/nomorebreach.com\/blog\/ssrf-prevention-how-a-url-fetch-leaks-your-cloud-keys\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/nomorebreach.com\/blog\/ssrf-prevention-how-a-url-fetch-leaks-your-cloud-keys\/#primaryimage","url":"https:\/\/nomorebreach.com\/blog\/wp-content\/uploads\/2026\/11\/ssrf-in-cloud-apps-prevention-guide.png","contentUrl":"https:\/\/nomorebreach.com\/blog\/wp-content\/uploads\/2026\/11\/ssrf-in-cloud-apps-prevention-guide.png","width":1200,"height":630},{"@type":"BreadcrumbList","@id":"https:\/\/nomorebreach.com\/blog\/ssrf-prevention-how-a-url-fetch-leaks-your-cloud-keys\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/nomorebreach.com\/blog\/"},{"@type":"ListItem","position":2,"name":"SSRF Prevention: How a URL Fetch Leaks Your Cloud Keys"}]},{"@type":"WebSite","@id":"https:\/\/nomorebreach.com\/blog\/#website","url":"https:\/\/nomorebreach.com\/blog\/","name":"No More Breach Insights","description":"Stop Threats Before They Start","publisher":{"@id":"https:\/\/nomorebreach.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/nomorebreach.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/nomorebreach.com\/blog\/#organization","name":"No More Breach","url":"https:\/\/nomorebreach.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/nomorebreach.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/nomorebreach.com\/blog\/wp-content\/uploads\/2025\/01\/Untitled_design-removebg-preview.png","contentUrl":"https:\/\/nomorebreach.com\/blog\/wp-content\/uploads\/2025\/01\/Untitled_design-removebg-preview.png","width":500,"height":500,"caption":"No More Breach"},"image":{"@id":"https:\/\/nomorebreach.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/nomorebreach","https:\/\/instagram.com\/nomorebreach"]},{"@type":"Person","@id":"https:\/\/nomorebreach.com\/blog\/#\/schema\/person\/bb2410510214ded6aa0305e6ff04de94","name":"nomorebreachofficial","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/6d4a84f25c82ed978512f73233e5c099b060eb4a2a74d789a240c355d0e280f4?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/6d4a84f25c82ed978512f73233e5c099b060eb4a2a74d789a240c355d0e280f4?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6d4a84f25c82ed978512f73233e5c099b060eb4a2a74d789a240c355d0e280f4?s=96&r=g","caption":"nomorebreachofficial"},"description":"The NoMoreBreach team helps startups and businesses find and fix security gaps before attackers do. We write practical, no-hype guides on real vulnerabilities, misconfigurations and attack techniques, each checked against primary sources and turned into steps you can act on. Want to see what attackers can see? Request a free external attack-surface snapshot at nomorebreach.com.","sameAs":["https:\/\/nomorebreach.com\/blog","https:\/\/instagram.com\/nomorebreach","https:\/\/www.linkedin.com\/company\/nomorebreach","https:\/\/x.com\/NoMoreBreachSec"],"url":"https:\/\/nomorebreach.com\/blog\/author\/nomorebreachofficial\/"}]}},"_links":{"self":[{"href":"https:\/\/nomorebreach.com\/blog\/wp-json\/wp\/v2\/posts\/126","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nomorebreach.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nomorebreach.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nomorebreach.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nomorebreach.com\/blog\/wp-json\/wp\/v2\/comments?post=126"}],"version-history":[{"count":2,"href":"https:\/\/nomorebreach.com\/blog\/wp-json\/wp\/v2\/posts\/126\/revisions"}],"predecessor-version":[{"id":129,"href":"https:\/\/nomorebreach.com\/blog\/wp-json\/wp\/v2\/posts\/126\/revisions\/129"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nomorebreach.com\/blog\/wp-json\/wp\/v2\/media\/127"}],"wp:attachment":[{"href":"https:\/\/nomorebreach.com\/blog\/wp-json\/wp\/v2\/media?parent=126"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nomorebreach.com\/blog\/wp-json\/wp\/v2\/categories?post=126"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nomorebreach.com\/blog\/wp-json\/wp\/v2\/tags?post=126"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}