[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CSQQEH23N6SHVJVGG21GHR":3,"skill-same:01M7CSQQEH23N6SHVJVGG21GHR":50},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":27,"commitSha":28,"skillDirectory":29,"forksCount":30,"repositoryHtmlUrl":31,"repositoryHomepageUrl":32,"ownerHtmlUrl":33,"ownerBlogUrl":6,"ownerDescription":34,"updatedAt":35,"install":36,"resources":49},"01M7CSQQEH23N6SHVJVGG21GHR","ssrf-and-url-allowlists",null,"Use when the server side of the diff fetches, renders, redirects to or validates a URL that input can influence - webhooks, link previews, import-from-URL, PDF renderers, OAuth\u002FJWKS discovery, allowlist and blocklist checks","makifbaysal\u002Ftasktrooper","makifbaysal","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F25031940?v=4","01M7CRG3ZCSYZSSEVDMW3DEYC8","Mehmet Akif Baysal","01M7CRG401FJ8YAXH5ER730XYV",122,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper\u002Fblob\u002Fmain\u002Fcatalog\u002Fagents\u002Fsecurity-agent\u002Fskills\u002Fssrf-and-url-allowlists\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: ssrf-and-url-allowlists\ncategory: security\ndescription: Use when the server side of the diff fetches, renders, redirects to or validates a URL that input can influence - webhooks, link previews, import-from-URL, PDF renderers, OAuth\u002FJWKS discovery, allowlist and blocklist checks\ntech_stack: Web & API\nsource: original; informed by trailofbits\u002Fskills (CC BY-SA 4.0, ideas only, own wording); OWASP Top 10:2025 A01 and CWE-918 cited by name only\n---\n# SSRF and URL Allowlists\n\n## Overview\n\nServer-side request forgery turns your server into the attacker's network client — inside your VPC, past your firewall, next to the cloud metadata service. Since OWASP Top 10:2025 it sits under A01 Broken Access Control (CWE-918).\n\n**Core principle:** validate the address you actually connect to, after DNS, on every hop — not the string the user typed.\n\n## 1. Is It a Finding?\n\n- The attacker must control the **scheme or host** (or the whole URL). Path-only control on a fixed host is excluded.\n- The fetch happens **server-side**. SSRF in browser or mobile client code is not a finding.\n- Impact: response returned to the attacker (full read), or side effects on internal services (blind). Blind SSRF still matters when internal endpoints act on GET.\n- Cloud metadata raises severity: AWS IMDSv1 (`http:\u002F\u002F169.254.169.254\u002Flatest\u002Fmeta-data\u002Fiam\u002Fsecurity-credentials\u002F`) answers a plain GET with credentials. IMDSv2 (PUT-token), GCP (`Metadata-Flavor: Google`) and Azure (`Metadata: true`) require a header a simple SSRF usually cannot set — check what the deployment runs before calling it CRITICAL.\n\n## 2. Allowlist Bypasses\n\n```ts\n\u002F\u002F ❌ substring: \"https:\u002F\u002Fexample.com.evil.net\" and \"https:\u002F\u002Fevil.net\u002F?x=example.com\" pass\nif (!url.includes(\"example.com\")) throw new Error(\"blocked\");\n\n\u002F\u002F ❌ suffix without a dot boundary: \"https:\u002F\u002Fevilexample.com\" passes\nif (!new URL(url).hostname.endsWith(\"example.com\")) throw ...\n\n\u002F\u002F ❌ regex with an unescaped dot and no end anchor: \"https:\u002F\u002Fapi.example.com.evil.net\"\nif (!\u002F^https:\\\u002F\\\u002Fapi.example.com\u002F.test(url)) throw ...\n\n\u002F\u002F ✅ parse once, compare exact host (or a dot-bounded suffix), fixed scheme\nconst u = new URL(url);\nconst ok = u.protocol === \"https:\" && (u.hostname === \"example.com\" || u.hostname.endsWith(\".example.com\"));\n```\n\nParser tricks that defeat string checks:\n\n- **Userinfo:** `https:\u002F\u002Fexample.com@evil.net\u002F` — the host is `evil.net`.\n- **Backslash and parser differentials:** `https:\u002F\u002Fevil.net\\@example.com\u002F` — validators and HTTP clients disagree (WHATWG vs RFC 3986). Validate with the same parser the fetcher uses, or better, the fetcher's resolved address.\n- **Base-URL resolution:** `new URL(userPath, base)`, Python `urljoin(base, user)` and Java `URI.resolve` let `\u002F\u002Fevil.net\u002Fx` or a full `https:\u002F\u002Fevil.net` replace the base host.\n\n## 3. Private-Address Blocklist Bypasses\n\nA blocklist on the URL string misses:\n\n- alternate IPv4 forms: `http:\u002F\u002F2130706433\u002F`, `http:\u002F\u002F0x7f.1\u002F`, `http:\u002F\u002F0177.0.0.1\u002F`, `http:\u002F\u002F127.1\u002F`, `http:\u002F\u002F0.0.0.0\u002F`;\n- IPv6: `http:\u002F\u002F[::1]\u002F`, `http:\u002F\u002F[::ffff:127.0.0.1]\u002F`, `http:\u002F\u002F[fd00::1]\u002F`;\n- names that resolve inside: `localhost.`, `127.0.0.1.nip.io`, an attacker domain with an A record of `10.0.0.5`;\n- **DNS rebinding:** the validator resolves to a public IP, the fetch re-resolves to `127.0.0.1`;\n- **redirects:** the allowed URL answers `302 Location: http:\u002F\u002F169.254.169.254\u002F…` and the client follows it.\n\n```go\n\u002F\u002F ✅ the check runs on the address actually dialled — after DNS, on every redirect hop\ndialer := &net.Dialer{Control: func(_, address string, _ syscall.RawConn) error {\n\thost, _, _ := net.SplitHostPort(address)\n\tip := net.ParseIP(host)\n\tif ip == nil || ip.IsLoopback() || ip.IsPrivate() || ip.IsLinkLocalUnicast() || ip.IsUnspecified() {\n\t\treturn errBlockedAddress\n\t}\n\treturn nil\n}}\nclient := &http.Client{Transport: &http.Transport{Proxy: nil, DialContext: dialer.DialContext}}\n```\n\n`Proxy: nil` matters: through a proxy the dialled address is the proxy's, and the check never sees the target. Add any internal ranges the deployment uses (for example `100.64.0.0\u002F10`). Node: a request-filtering agent that checks the resolved IP; Python: resolve, check with `ipaddress` (`is_private`, `is_loopback`, `is_link_local`, `is_reserved`), then connect to that IP with the original `Host` header and SNI.\n\n## 4. Schemes Other Than HTTP(S)\n\n`file:\u002F\u002F`, `gopher:\u002F\u002F`, `dict:\u002F\u002F`, `ftp:\u002F\u002F`, Java `jar:`\u002F`netdoc:`, and everything libcurl supports. A fetcher that accepts a user URL must restrict the scheme to `https` (or `http`\u002F`https`) before anything else.\n\n## 5. Indirect Fetchers\n\n- **HTML-to-PDF and screenshot services** (headless Chrome, wkhtmltopdf, Puppeteer) rendering user HTML: `\u003Ciframe src=\"http:\u002F\u002F169.254.169.254\u002F…\">`, `\u003Cimg src=\"file:\u002F\u002F\u002Fetc\u002Fpasswd\">`.\n- **SVG\u002Fimage processors** that follow `xlink:href`; **XML parsers** with external entities (injection-and-dangerous-sinks); **OAuth\u002FOIDC** flows fetching a `jwks_uri` or discovery document from a token-supplied issuer; **webhook test buttons**; **LLM browsing tools** whose URL comes from model output (llm-and-agent-security).\n- An allowlisted host with an **open redirect** turns the allowlist into SSRF.\n\n## Severity Guide\n\nFull-read SSRF to internal services or credential-bearing metadata → HIGH to CRITICAL. Blind SSRF to an internal network with no known side effect → MEDIUM. Path-only control → not reported.\n\n## Common Mistakes\n\n- Reporting SSRF when the host is fixed in server config and the user controls only a path segment or query.\n- Accepting a check on `url.hostname` as sufficient while the client follows redirects.\n- Calling IMDS exposure CRITICAL without checking whether the platform enforces IMDSv2.\n- Reporting `fetch(userUrl)` in a React component.\n\n## Red Flags\n\n- `http.Get(u)`, `requests.get(u)`, `fetch(u)`, `RestTemplate`\u002F`WebClient`, `HttpClient.send` where `u` comes from a request body, a stored profile field or a webhook config.\n- An allowlist implemented with `includes`, `contains`, `endsWith` without a leading dot, or an unanchored regex.\n- Validation on the URL string followed by a client with default redirect following.\n- A headless browser or PDF renderer fed user HTML with network access.\n\n## References (names and links only)\n\n[OWASP Top 10:2025 A01 Broken Access Control](https:\u002F\u002Fowasp.org\u002FTop10\u002F2025\u002F) · [CWE-918](https:\u002F\u002Fcwe.mitre.org\u002Fdata\u002Fdefinitions\u002F918.html) · [OWASP API Security Top 10 2023 API7](https:\u002F\u002Fowasp.org\u002FAPI-Security\u002Feditions\u002F2023\u002Fen\u002F0x11-t10\u002F)\n","# SSRF and URL Allowlists\n\n## Overview\n\nServer-side request forgery turns your server into the attacker's network client — inside your VPC, past your firewall, next to the cloud metadata service. Since OWASP Top 10:2025 it sits under A01 Broken Access Control (CWE-918).\n\n**Core principle:** validate the address you actually connect to, after DNS, on every hop — not the string the user typed.\n\n## 1. Is It a Finding?\n\n- The attacker must control the **scheme or host** (or the whole URL). Path-only control on a fixed host is excluded.\n- The fetch happens **server-side**. SSRF in browser or mobile client code is not a finding.\n- Impact: response returned to the attacker (full read), or side effects on internal services (blind). Blind SSRF still matters when internal endpoints act on GET.\n- Cloud metadata raises severity: AWS IMDSv1 (`http:\u002F\u002F169.254.169.254\u002Flatest\u002Fmeta-data\u002Fiam\u002Fsecurity-credentials\u002F`) answers a plain GET with credentials. IMDSv2 (PUT-token), GCP (`Metadata-Flavor: Google`) and Azure (`Metadata: true`) require a header a simple SSRF usually cannot set — check what the deployment runs before calling it CRITICAL.\n\n## 2. Allowlist Bypasses\n\n```ts\n\u002F\u002F ❌ substring: \"https:\u002F\u002Fexample.com.evil.net\" and \"https:\u002F\u002Fevil.net\u002F?x=example.com\" pass\nif (!url.includes(\"example.com\")) throw new Error(\"blocked\");\n\n\u002F\u002F ❌ suffix without a dot boundary: \"https:\u002F\u002Fevilexample.com\" passes\nif (!new URL(url).hostname.endsWith(\"example.com\")) throw ...\n\n\u002F\u002F ❌ regex with an unescaped dot and no end anchor: \"https:\u002F\u002Fapi.example.com.evil.net\"\nif (!\u002F^https:\\\u002F\\\u002Fapi.example.com\u002F.test(url)) throw ...\n\n\u002F\u002F ✅ parse once, compare exact host (or a dot-bounded suffix), fixed scheme\nconst u = new URL(url);\nconst ok = u.protocol === \"https:\" && (u.hostname === \"example.com\" || u.hostname.endsWith(\".example.com\"));\n```\n\nParser tricks that defeat string checks:\n\n- **Userinfo:** `https:\u002F\u002Fexample.com@evil.net\u002F` — the host is `evil.net`.\n- **Backslash and parser differentials:** `https:\u002F\u002Fevil.net\\@example.com\u002F` — validators and HTTP clients disagree (WHATWG vs RFC 3986). Validate with the same parser the fetcher uses, or better, the fetcher's resolved address.\n- **Base-URL resolution:** `new URL(userPath, base)`, Python `urljoin(base, user)` and Java `URI.resolve` let `\u002F\u002Fevil.net\u002Fx` or a full `https:\u002F\u002Fevil.net` replace the base host.\n\n## 3. Private-Address Blocklist Bypasses\n\nA blocklist on the URL string misses:\n\n- alternate IPv4 forms: `http:\u002F\u002F2130706433\u002F`, `http:\u002F\u002F0x7f.1\u002F`, `http:\u002F\u002F0177.0.0.1\u002F`, `http:\u002F\u002F127.1\u002F`, `http:\u002F\u002F0.0.0.0\u002F`;\n- IPv6: `http:\u002F\u002F[::1]\u002F`, `http:\u002F\u002F[::ffff:127.0.0.1]\u002F`, `http:\u002F\u002F[fd00::1]\u002F`;\n- names that resolve inside: `localhost.`, `127.0.0.1.nip.io`, an attacker domain with an A record of `10.0.0.5`;\n- **DNS rebinding:** the validator resolves to a public IP, the fetch re-resolves to `127.0.0.1`;\n- **redirects:** the allowed URL answers `302 Location: http:\u002F\u002F169.254.169.254\u002F…` and the client follows it.\n\n```go\n\u002F\u002F ✅ the check runs on the address actually dialled — after DNS, on every redirect hop\ndialer := &net.Dialer{Control: func(_, address string, _ syscall.RawConn) error {\n\thost, _, _ := net.SplitHostPort(address)\n\tip := net.ParseIP(host)\n\tif ip == nil || ip.IsLoopback() || ip.IsPrivate() || ip.IsLinkLocalUnicast() || ip.IsUnspecified() {\n\t\treturn errBlockedAddress\n\t}\n\treturn nil\n}}\nclient := &http.Client{Transport: &http.Transport{Proxy: nil, DialContext: dialer.DialContext}}\n```\n\n`Proxy: nil` matters: through a proxy the dialled address is the proxy's, and the check never sees the target. Add any internal ranges the deployment uses (for example `100.64.0.0\u002F10`). Node: a request-filtering agent that checks the resolved IP; Python: resolve, check with `ipaddress` (`is_private`, `is_loopback`, `is_link_local`, `is_reserved`), then connect to that IP with the original `Host` header and SNI.\n\n## 4. Schemes Other Than HTTP(S)\n\n`file:\u002F\u002F`, `gopher:\u002F\u002F`, `dict:\u002F\u002F`, `ftp:\u002F\u002F`, Java `jar:`\u002F`netdoc:`, and everything libcurl supports. A fetcher that accepts a user URL must restrict the scheme to `https` (or `http`\u002F`https`) before anything else.\n\n## 5. Indirect Fetchers\n\n- **HTML-to-PDF and screenshot services** (headless Chrome, wkhtmltopdf, Puppeteer) rendering user HTML: `\u003Ciframe src=\"http:\u002F\u002F169.254.169.254\u002F…\">`, `\u003Cimg src=\"file:\u002F\u002F\u002Fetc\u002Fpasswd\">`.\n- **SVG\u002Fimage processors** that follow `xlink:href`; **XML parsers** with external entities (injection-and-dangerous-sinks); **OAuth\u002FOIDC** flows fetching a `jwks_uri` or discovery document from a token-supplied issuer; **webhook test buttons**; **LLM browsing tools** whose URL comes from model output (llm-and-agent-security).\n- An allowlisted host with an **open redirect** turns the allowlist into SSRF.\n\n## Severity Guide\n\nFull-read SSRF to internal services or credential-bearing metadata → HIGH to CRITICAL. Blind SSRF to an internal network with no known side effect → MEDIUM. Path-only control → not reported.\n\n## Common Mistakes\n\n- Reporting SSRF when the host is fixed in server config and the user controls only a path segment or query.\n- Accepting a check on `url.hostname` as sufficient while the client follows redirects.\n- Calling IMDS exposure CRITICAL without checking whether the platform enforces IMDSv2.\n- Reporting `fetch(userUrl)` in a React component.\n\n## Red Flags\n\n- `http.Get(u)`, `requests.get(u)`, `fetch(u)`, `RestTemplate`\u002F`WebClient`, `HttpClient.send` where `u` comes from a request body, a stored profile field or a webhook config.\n- An allowlist implemented with `includes`, `contains`, `endsWith` without a leading dot, or an unanchored regex.\n- Validation on the URL string followed by a client with default redirect following.\n- A headless browser or PDF renderer fed user HTML with network access.\n\n## References (names and links only)\n\n[OWASP Top 10:2025 A01 Broken Access Control](https:\u002F\u002Fowasp.org\u002FTop10\u002F2025\u002F) · [CWE-918](https:\u002F\u002Fcwe.mitre.org\u002Fdata\u002Fdefinitions\u002F918.html) · [OWASP API Security Top 10 2023 API7](https:\u002F\u002Fowasp.org\u002FAPI-Security\u002Feditions\u002F2023\u002Fen\u002F0x11-t10\u002F)\n",{"name":5,"source":24,"category":25,"tech_stack":26,"description":7},"original; informed by trailofbits\u002Fskills (CC BY-SA 4.0, ideas only, own wording); OWASP Top 10:2025 A01 and CWE-918 cited by name only","security","Web & API","main","910394a0b6db9fc8c9a8f36328ec421d3ebd8b38","catalog\u002Fagents\u002Fsecurity-agent\u002Fskills\u002Fssrf-and-url-allowlists",18,"https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper","https:\u002F\u002Ftasktrooper.ai","https:\u002F\u002Fgithub.com\u002Fmakifbaysal","Senior Software Developer","2026-11-15 04:50:29",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add makifbaysal\u002Ftasktrooper --skill ssrf-and-url-allowlists",{"tool":42,"command":43},"bunx","bunx skills add makifbaysal\u002Ftasktrooper --skill ssrf-and-url-allowlists",{"tool":45,"command":46},"pnpm","pnpm dlx skills add makifbaysal\u002Ftasktrooper --skill ssrf-and-url-allowlists","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper\u002Fblob\u002Fmain\u002Fcatalog\u002Fagents\u002Fsecurity-agent\u002Fskills\u002Fssrf-and-url-allowlists\u002FSKILL.md",true,[],[51,57,64,71,78,85],{"skillNo":52,"name":53,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":56,"publishedAt":19},"01M7CSVEPQW6J6TD6CS2T5FPNZ","visual-craft","https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper\u002Fblob\u002Fmain\u002Fcatalog\u002Fagents\u002Fui-designer\u002Fskills\u002Fvisual-craft\u002FSKILL.md",[],[],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M7CSVAQG91ETHQ0HBNZDG5FR","ux-copy","Use when you write any words a user reads in a mockup or a hand-off - content language and voice, buttons, labels, errors, empty states, confirmations, numbers and dates, and the longest-string check","https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper\u002Fblob\u002Fmain\u002Fcatalog\u002Fagents\u002Fui-designer\u002Fskills\u002Fux-copy\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M7CSV6H0J38659NDXHJQ8396","screen-mockup-html","Use when you draw screens as the design task's HTML mockup - ONE canvas document holding every screen and every variant side by side, the sanitizer-safe recipe, phone and wide frames, the states grid, static control states, and the loopback self-check with screenshots at 375, 768 and 1440 attached to the task","https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper\u002Fblob\u002Fmain\u002Fcatalog\u002Fagents\u002Fui-designer\u002Fskills\u002Fscreen-mockup-html\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M7CSV3JFRF3BM3XK52M7YEYR","performance-awareness","How the performance score moves for your role. Use when the score context shows a declining trend, or before handing off work you have not self-checked against every criterion.","https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper\u002Fblob\u002Fmain\u002Fcatalog\u002Fagents\u002Fui-designer\u002Fskills\u002Fperformance-awareness\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M7CSTZDH00YRF5SCT7BRT9QD","design-variants","Use when a screen design needs variants - how many, variants as side-by-side rows on the one canvas, what makes two variants genuinely different, recommending one, how the human's choice is read, and narrowing to the chosen one in revision","https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper\u002Fblob\u002Fmain\u002Fcatalog\u002Fagents\u002Fui-designer\u002Fskills\u002Fdesign-variants\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M7CSTV6P3SM3PAE28DB0RF77","design-system-authoring","Use when you derive, change or extend a design system - where tokens live per stack, the DTCG token tree, role-based names for both themes, base vs layer vs drift, the DESIGN.md section order, the inventory format, the contrast check and the lint every proposal returns","https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper\u002Fblob\u002Fmain\u002Fcatalog\u002Fagents\u002Fui-designer\u002Fskills\u002Fdesign-system-authoring\u002FSKILL.md",[],[]]