{
  "id": "security/ssrf-aws-metadata-timing",
  "signature": "SSRF: AWS metadata endpoint accessed via DNS rebinding bypassing IP-based blocklists",
  "signature_zh": "SSRF: 通过 DNS 重新绑定绕过基于 IP 的黑名单访问 AWS 元数据端点",
  "regex": "169\\.254\\.169\\.254|metadata.*endpoint|DNS.*rebind",
  "domain": "security",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "An SSRF filter blocks requests to 169.254.169.254 by IP, but an attacker uses a domain that initially resolves to a benign IP and later rebinds to the metadata endpoint during the request.",
  "root_cause_type": "generic",
  "root_cause_zh": "SSRF 过滤器通过 IP 阻止对 169.254.169.254 的请求，但攻击者使用一个最初解析为良性 IP 的域名，在请求过程中重新绑定到元数据端点。",
  "versions": [
    {
      "version": "AWS EC2",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Kubernetes 1.28",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Python requests 2.31.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "DNS rebinding bypasses IP blocklists because the IP changes after the initial DNS resolution",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The IP can change mid-request; a single check is insufficient",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This breaks legitimate functionality and is not a practical fix",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Implement a DNS pinning mechanism: resolve the domain once and reject if the IP is in the blocklist, then use the resolved IP for the connection. Example in Python: `socket.getaddrinfo(url)` then check IP before making request.",
      "success_rate": 0.78,
      "how": "Implement a DNS pinning mechanism: resolve the domain once and reject if the IP is in the blocklist, then use the resolved IP for the connection. Example in Python: `socket.getaddrinfo(url)` then check IP before making request.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use a proxy that enforces DNS resolution and IP validation before forwarding requests, such as Squid with strict ACLs.",
      "success_rate": 0.82,
      "how": "Use a proxy that enforces DNS resolution and IP validation before forwarding requests, such as Squid with strict ACLs.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Disable HTTP redirects and follow redirects manually with IP validation at each step",
      "success_rate": 0.75,
      "how": "Disable HTTP redirects and follow redirects manually with IP validation at each step",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Implement a DNS pinning mechanism: resolve the domain once and reject if the IP is in the blocklist, then use the resolved IP for the connection. Example in Python: `socket.getaddrinfo(url)` then check IP before making request.",
    "Use a proxy that enforces DNS resolution and IP validation before forwarding requests, such as Squid with strict ACLs.",
    "Disable HTTP redirects and follow redirects manually with IP validation at each step"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html",
  "official_doc_section": null,
  "error_code": "SSRF-004",
  "verification_tier": "ai_generated",
  "confidence": 0.82,
  "fix_success_rate": 0.78,
  "resolvable": "true",
  "first_seen": "2023-11-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}