{
    "title": "SSRF (server-side request forgery)",
    "seo_title": "SSRF: definition, examples and prevention on WordPress",
    "h1": "SSRF (server-side request forgery)",
    "description": "SSRF explained: how a site becomes an attacker's relay into the internal network, examples, wp_safe_remote_get and the fixes in code and hosting.",
    "lead": "An SSRF (server-side request forgery) vulnerability lets an attacker make the server send requests to an address of their choosing: internal services, the cloud metadata endpoint or the server itself, all normally unreachable from the internet.",
    "language": "en",
    "locale": "en-US",
    "type": "definition",
    "url": "https://www.wp-feint.com/glossary/ssrf/",
    "canonical": "https://www.wp-feint.com/glossary/ssrf/",
    "markdown": "https://www.wp-feint.com/glossary/ssrf/index.md",
    "json": "https://www.wp-feint.com/glossary/ssrf/index.json",
    "published": "2026-10-28T08:00:00+00:00",
    "modified": "2026-11-22T12:08:38+00:00",
    "site": {
        "name": "WP Feint",
        "url": "https://www.wp-feint.com/"
    },
    "translations": [
        {
            "language": "en",
            "hreflang": "en-US",
            "title": "SSRF (server-side request forgery)",
            "url": "https://www.wp-feint.com/glossary/ssrf/",
            "markdown": "https://www.wp-feint.com/glossary/ssrf/index.md",
            "json": "https://www.wp-feint.com/glossary/ssrf/index.json"
        },
        {
            "language": "fr",
            "hreflang": "fr-FR",
            "title": "SSRF",
            "url": "https://www.wp-feint.com/fr/definitions/ssrf/",
            "markdown": "https://www.wp-feint.com/fr/definitions/ssrf/index.md",
            "json": "https://www.wp-feint.com/fr/definitions/ssrf/index.json"
        },
        {
            "language": "es",
            "hreflang": "es-ES",
            "title": "SSRF",
            "url": "https://www.wp-feint.com/es/glosario/ssrf/",
            "markdown": "https://www.wp-feint.com/es/glosario/ssrf/index.md",
            "json": "https://www.wp-feint.com/es/glosario/ssrf/index.json"
        },
        {
            "language": "de",
            "hreflang": "de-DE",
            "title": "SSRF (Server-Side Request Forgery)",
            "url": "https://www.wp-feint.com/de/glossar/ssrf/",
            "markdown": "https://www.wp-feint.com/de/glossar/ssrf/index.md",
            "json": "https://www.wp-feint.com/de/glossar/ssrf/index.json"
        },
        {
            "language": "it",
            "hreflang": "it-IT",
            "title": "SSRF (server-side request forgery)",
            "url": "https://www.wp-feint.com/it/glossario/ssrf/",
            "markdown": "https://www.wp-feint.com/it/glossario/ssrf/index.md",
            "json": "https://www.wp-feint.com/it/glossario/ssrf/index.json"
        },
        {
            "language": "pt",
            "hreflang": "pt-BR",
            "title": "SSRF",
            "url": "https://www.wp-feint.com/pt/glossario/ssrf/",
            "markdown": "https://www.wp-feint.com/pt/glossario/ssrf/index.md",
            "json": "https://www.wp-feint.com/pt/glossario/ssrf/index.json"
        },
        {
            "language": "nl",
            "hreflang": "nl-NL",
            "title": "SSRF (server-side request forgery)",
            "url": "https://www.wp-feint.com/nl/woordenlijst/ssrf/",
            "markdown": "https://www.wp-feint.com/nl/woordenlijst/ssrf/index.md",
            "json": "https://www.wp-feint.com/nl/woordenlijst/ssrf/index.json"
        }
    ],
    "headings": [
        {
            "level": 1,
            "text": "SSRF (server-side request forgery)"
        },
        {
            "level": 2,
            "text": "How an SSRF attack works"
        },
        {
            "level": 2,
            "text": "How to protect against it"
        },
        {
            "level": 2,
            "text": "For WordPress: wp_safe_remote_get and pingbacks"
        }
    ],
    "body": "In an SSRF attack, the attacker doesn't target the machine they are after directly: they use the website as a go-between. The web server often sits in a network where it can reach services nobody should be able to reach from the internet. If a feature of the site fetches a user-supplied URL without checking the destination, the attacker can make it query those services on their behalf. OWASP gave SSRF its own category in its 2021 Top 10 (A10), and MITRE lists it as CWE-918.\n\n## How an SSRF attack works\n\nThe features at risk are the ones that fetch a URL: importing an image from an address, generating a link preview, calling a webhook, checking a feed. The attacker slips in an internal address instead of a public one:\n\n- **the cloud metadata endpoint** `169.254.169.254`, used by AWS, Azure and Google Cloud, which can reveal credentials and access tokens;\n- **the server itself** (`localhost`, `127.0.0.1`), for example an admin panel or a database that only listens locally;\n- **the private network** (`10.0.0.0/8`, `192.168.0.0/16`…), to map machines and open ports;\n- **protocols other than HTTP**, such as `file://` or `gopher://`, when the library in use accepts them.\n\n![Five-step SSRF attack: the attacker passes the cloud metadata address to an import-image-from-URL feature, the server sends the request from inside the network, the internal service responds with metadata or tokens, the response gets back to the attacker directly or through an error message, and the defense is to validate the destination (allowlist of hosts, http and https only, private addresses refused, redirects checked)](https://www.wp-feint.com/media/2026/10/ssrf-flux-en.webp)\n\nThe response doesn't always come back in full: this is called “blind” SSRF when the attacker only sees an error message or a response time, which is still enough to tell whether a port is open.\n\n*Video: “SSRF in 100 seconds” (Intigriti)*\n\n## How to protect against it\n\n- **Allowlist**: when the destinations are known (a specific API), accept only those.\n- **http and https only**, on standard ports.\n- **Refuse internal addresses** after DNS resolution, and check every redirect too: a public domain name can point to a private address.\n- **On the hosting side**: network segmentation and, on AWS, switching to IMDSv2, which OWASP recommends to limit metadata theft.\n\n## For WordPress: wp_safe_remote_get and pingbacks\n\nWordPress provides the right tools, as long as you use them. `wp_safe_remote_get()` and its variants validate the URL and every redirect URL with `wp_http_validate_url()`: only `http` and `https` are allowed, credentials in the URL are refused, loopback and private addresses are rejected, and an explicit port must be 80, 443 or 8080. By contrast, `wp_remote_get()` doesn't perform this validation by default: a plugin that uses it with a visitor-supplied URL is exposed. The `http_request_host_is_external` filter lets you allow one specific internal host; opening it to everything defeats the protection.\n\n```\n$response = wp_safe_remote_get( esc_url_raw( $supplied_url ), array( 'timeout' => 5 ) );\nif ( is_wp_error( $response ) ) {\n    return; // URL refused or unreachable\n}\n```\n\nCore itself once had this problem: before WordPress 3.5.1, the [XML-RPC](https://www.wp-feint.com/glossary/xml-rpc/) pingback could be used to send requests to internal servers and scan ports (CVE-2013-0235). Pingbacks now use `wp_safe_remote_get()`, but they remain a feature that makes your server send requests at a third party's request. If you don't use them, the [WP Feint Hardening module](https://www.wp-feint.com/features/hardening/) blocks pingbacks and XML-RPC for free; [our article on XML-RPC](https://www.wp-feint.com/wordpress-xml-rpc-risks/) helps you check that no service depends on it. For the rest, SSRF has to be fixed in the code of the affected plugin, and a [web application firewall](https://www.wp-feint.com/glossary/waf/) can filter the most obvious internal addresses in the meantime.\n\n## Related terms\n\n- [XML-RPC](https://www.wp-feint.com/glossary/xml-rpc/)\n- [WAF (web application firewall)](https://www.wp-feint.com/glossary/waf/)\n- [CSRF (cross-site request forgery)](https://www.wp-feint.com/glossary/csrf/)\n- [Remote code execution (RCE)](https://www.wp-feint.com/glossary/remote-code-execution/)\n\n\n## Sources\n\n- [OWASP Cheat Sheet Series : Server-Side Request Forgery Prevention](https://cheatsheetseries.owasp.org/cheatsheets/Server_Side_Request_Forgery_Prevention_Cheat_Sheet.html)\n- [MITRE CWE-918 : Server-Side Request Forgery (SSRF)](https://cwe.mitre.org/data/definitions/918.html)\n- [WordPress Developer Resources : wp_http_validate_url()](https://developer.wordpress.org/reference/functions/wp_http_validate_url/)\n- [CVE Record : CVE-2013-0235](https://www.cve.org/CVERecord?id=CVE-2013-0235)",
    "definition": "An SSRF (server-side request forgery) vulnerability lets an attacker make the server send requests to an address of their choosing: internal services, the cloud metadata endpoint or the server itself, all normally unreachable from the internet.",
    "group": "Web security",
    "aka": [
        "server-side request forgery",
        "SSRF attack",
        "CWE-918"
    ],
    "related": [
        {
            "title": "XML-RPC",
            "url": "https://www.wp-feint.com/glossary/xml-rpc/",
            "markdown": "https://www.wp-feint.com/glossary/xml-rpc/index.md"
        },
        {
            "title": "WAF (web application firewall)",
            "url": "https://www.wp-feint.com/glossary/waf/",
            "markdown": "https://www.wp-feint.com/glossary/waf/index.md"
        },
        {
            "title": "CSRF (cross-site request forgery)",
            "url": "https://www.wp-feint.com/glossary/csrf/",
            "markdown": "https://www.wp-feint.com/glossary/csrf/index.md"
        },
        {
            "title": "Remote code execution (RCE)",
            "url": "https://www.wp-feint.com/glossary/remote-code-execution/",
            "markdown": "https://www.wp-feint.com/glossary/remote-code-execution/index.md"
        }
    ],
    "sources": [
        {
            "title": "OWASP Cheat Sheet Series : Server-Side Request Forgery Prevention",
            "url": "https://cheatsheetseries.owasp.org/cheatsheets/Server_Side_Request_Forgery_Prevention_Cheat_Sheet.html"
        },
        {
            "title": "MITRE CWE-918 : Server-Side Request Forgery (SSRF)",
            "url": "https://cwe.mitre.org/data/definitions/918.html"
        },
        {
            "title": "WordPress Developer Resources : wp_http_validate_url()",
            "url": "https://developer.wordpress.org/reference/functions/wp_http_validate_url/"
        },
        {
            "title": "CVE Record : CVE-2013-0235",
            "url": "https://www.cve.org/CVERecord?id=CVE-2013-0235"
        }
    ],
    "format": "application/json"
}