CVE-2025-67647
Executive Summary
CVE-2025-67647 is a Server-Side Request Forgery (SSRF) and Denial of Service (DoS) vulnerability affecting SvelteKit, a popular framework for building web applications with Svelte. The vulnerability arises from insufficient validation of the Host header when handling prerendered routes. An attacker can craft a malicious Host header to cause the server to make requests to internal or external resources (SSRF) or to trigger a crash (DoS). The issue is present in versions 2.19.0 through 2.49.4, with a more severe DoS variant affecting versions 2.44.0 through 2.49.4 when at least one prerendered route exists. The vulnerability is fixed in version 2.49.5.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability affects the SvelteKit npm package (@sveltejs/kit). Organizations using SvelteKit should immediately audit their package.json and lock files to ensure they are not using a vulnerable version. The supply chain risk is moderate, as the vulnerability is in the framework itself, not a dependency. However, any application using a vulnerable version is at risk. The official patch is available via npm registry. Developers should update to version 2.49.5 or later and verify the integrity of the package using checksums provided by the SvelteKit maintainers.
CVSS Breakdown & Threat Level
- CVSS Score: 0.0 (NVD) – However, based on analysis, a more accurate score is 7.5 (High).
- Attack Vector (AV): Network (N)
- Attack Complexity (AC): Low (L)
- Privileges Required (PR): None (N)
- User Interaction (UI): None (N)
- Scope (S): Unchanged (U)
- Confidentiality (C): None (N) – SSRF can lead to information disclosure, but primary impact is availability.
- Integrity (I): None (N)
- Availability (A): High (H) – DoS is the primary impact.
- Threat Level: High. The vulnerability is easily exploitable remotely without authentication, and can cause significant service disruption.
Deep Dive & Mechanics
The vulnerability lies in how SvelteKit handles prerendered routes. When a route is prerendered (export const prerender = true), the server generates static HTML at build time. However, during runtime, the server may still process requests for these routes, particularly when handling redirects or rewriting URLs. The issue is that the server uses the Host header from the incoming request to construct URLs for internal redirects or to fetch prerendered content. An attacker can manipulate the Host header to point to an arbitrary host, causing the server to:
- SSRF: Make requests to internal services (e.g.,
http://localhost:8080/admin) or external malicious servers. - DoS: Cause the server to enter an infinite loop or crash by providing a malformed or self-referencing
Hostheader.
The vulnerability is particularly dangerous in environments without a reverse proxy that validates the Host header, or when the ORIGIN environment variable is not set (for adapter-node). The fix in version 2.49.5 introduces proper validation of the Host header against a whitelist of allowed origins.
Vulnerable vs. Patched Code
Vulnerable Code (SvelteKit < 2.49.5):
// In the server-side request handler, the Host header is used directly
// to construct redirect URLs or fetch prerendered content.
const host = request.headers.get('host');
const url = new URL(request.url);
url.host = host; // No validation
// ... use url for internal operations
Patched Code (SvelteKit >= 2.49.5):
// The Host header is validated against a whitelist of allowed origins.
const allowedOrigins = ['example.com', 'localhost:3000']; // Configurable
const host = request.headers.get('host');
if (!allowedOrigins.includes(host)) {
return new Response('Invalid Host header', { status: 400 });
}
const url = new URL(request.url);
url.host = host;
// ... use url for internal operations
Exploitation & Lab Setup
Red Team
Prerequisites:
- A SvelteKit application with at least one prerendered route (e.g.,
src/routes/+page.sveltewithexport const prerender = true). - The application is running on a vulnerable version (2.19.0 to 2.49.4).
- No reverse proxy or
ORIGINenvironment variable configured.
Exploitation Steps:
- Identify a vulnerable endpoint: Find a prerendered route, e.g.,
https://target.com/about. - Craft a malicious request: Use
curlor a similar tool to send a request with a manipulatedHostheader.curl -H "Host: 127.0.0.1:8080" https://target.com/about - Observe SSRF: The server may attempt to fetch content from
http://127.0.0.1:8080/about, potentially exposing internal services. - Trigger DoS: Use a
Hostheader that causes an infinite loop or crash.
If the server uses thecurl -H "Host: target.com" https://target.com/aboutHostheader to construct a redirect back to itself, it may enter an infinite loop.
Note: No public exploit code is available at this time.
Blue Team
Detection:
- Monitor for unusual
Hostheaders in incoming requests, especially those pointing to internal IP addresses (e.g.,127.0.0.1,10.0.0.1,192.168.x.x). - Look for repeated requests to the same prerendered route with varying
Hostheaders. - Use the detection rules provided in the Detection Engineering section.
Mitigation:
- Immediately upgrade to SvelteKit 2.49.5 or later.
- If upgrade is not possible, configure a reverse proxy (e.g., Nginx, Apache) to validate the
Hostheader. - Set the
ORIGINenvironment variable foradapter-nodedeployments. - Implement network segmentation to limit the impact of SSRF.
Indicators of Compromise (IOCs)
- Network IOCs:
- HTTP requests with
Hostheaders containing internal IP addresses (e.g.,127.0.0.1,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16). - HTTP requests with
Hostheaders pointing to external malicious domains. - Unusual 5xx error responses from the server, indicating a crash.
- HTTP requests with
- File IOCs:
- Log entries showing requests to prerendered routes with unexpected
Hostheaders. - Core dump files (if the server crashes) in the application directory.
- Log entries showing requests to prerendered routes with unexpected
- Behavioral IOCs:
- Server making outbound connections to internal services that are not normally accessed.
- Server becoming unresponsive or returning errors for prerendered routes.
Detection Engineering
YARA Rule
rule CVE_2025_67647_SvelteKit_SSRF_DoS {
meta:
description = "Detects SvelteKit SSRF/DoS exploitation attempts via Host header manipulation"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-67647"
severity = "high"
strings:
$host_header = /Host:\s*(127\.0\.0\.1|10\.\d{1,3}\.\d{1,3}\.\d{1,3}|172\.(1[6-9]|2\d|3[01])\.\d{1,3}\.\d{1,3}|192\.168\.\d{1,3}\.\d{1,3})/ nocase
$prerender_route = /\/[a-zA-Z0-9_-]+\/?(?=\s|$)/ // Adjust to match prerendered routes
condition:
$host_header and #prerender_route > 0
}
Sigma Rule
title: SvelteKit SSRF/DoS via Host Header Manipulation
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects attempts to exploit CVE-2025-67647 by manipulating the Host header in requests to prerendered SvelteKit routes.
author: Valters IT
date: 2025/04/10
references:
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2025-67647
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-host|contains:
- '127.0.0.1'
- '10.'
- '172.16.'
- '172.17.'
- '172.18.'
- '172.19.'
- '172.20.'
- '172.21.'
- '172.22.'
- '172.23.'
- '172.24.'
- '172.25.'
- '172.26.'
- '172.27.'
- '172.28.'
- '172.29.'
- '172.30.'
- '172.31.'
- '192.168.'
cs-uri-stem|contains: '/prerendered-route' # Adjust to actual prerendered routes
condition: selection
falsepositives:
- Legitimate internal network requests (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-67647 SvelteKit SSRF/DoS Attempt"; flow:to_server; content:"Host|3a|"; nocase; pcre:"/Host:\s*(127\.0\.0\.1|10\.\d{1,3}\.\d{1,3}\.\d{1,3}|172\.(1[6-9]|2\d|3[01])\.\d{1,3}\.\d{1,3}|192\.168\.\d{1,3}\.\d{1,3})/Hi"; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate Action: Upgrade SvelteKit to version 2.49.5 or later.
npm install @sveltejs/kit@latest - Workaround (if upgrade is not possible):
- Configure a reverse proxy (e.g., Nginx) to validate the
Hostheader.server { listen 80; server_name example.com; if ($host != $server_name) { return 400; } # ... rest of configuration } - Set the
ORIGINenvironment variable foradapter-nodedeployments.export ORIGIN=https://example.com
- Configure a reverse proxy (e.g., Nginx) to validate the
- Long-term:
- Implement network segmentation to limit the impact of SSRF.
- Regularly update dependencies and monitor for security advisories.
- Use a Web Application Firewall (WAF) to filter malicious
Hostheaders.
Valters IT
Securing the digital frontier, one CVE at a time.