CVE-2026-40074: @sveltejs/kit Unvalidated Redirect Vulnerability

MODERATE
Advisory Identifier: GHSA-3f6h-2hrp-w5wx
CWE-755
Published
Advisory Summary

CVE-2026-40074 is a MODERATE unvalidated redirect vulnerability (CWE-755: Improper Handling of Exceptional Conditions) affecting @sveltejs/kit libraries in the npm ecosystem. The issue involves unvalidated redirect in handle hook causes denial-of-service. Remediation is available by upgrading affected packages to version 2.57.1.

CVE-2026-40074 at a Glance

CVE Identifier CVE-2026-40074
GHSA Identifier GHSA-3f6h-2hrp-w5wx
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-755: Improper Handling of Exceptional Conditions
Affected Product @sveltejs/kit
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2026-40074

To remediate this vulnerability, upgrade all affected @sveltejs/kit dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@sveltejs/kit fixed: 2.57.1
npm install @sveltejs/kit@2.57.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @sveltejs/kit

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-40074, inspect your project dependencies using npm:

npm ls @sveltejs/kit

Analyze the terminal output to locate any version of @sveltejs/kit in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.57.1), your application is affected.

Note: The npm ls @sveltejs/kit command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-755: Improper Handling of Exceptional Conditions, where the product does not handle or incorrectly handles an exceptional condition. In @sveltejs/kit, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

`redirect`, when called from inside the `handle` server hook with a location parameter containing characters that are invalid in a HTTP header, will cause an unhandled `TypeError`. This could result in DoS on some platforms, especially if the location passed to `redirect` contains unsanitized user input.

CVE-2026-40074 Affected @sveltejs/kit Versions

1 component(s)
Fixed Versions:
2.57.1
Product / Package Ecosystem Affected Versions Fixed Version
@sveltejs/kit
npm
< 2.57.1
2.57.1

References

Frequently Asked Questions

What is CVE-2026-40074?
CVE-2026-40074 is a security vulnerability in @sveltejs/kit involving Unvalidated redirect in handle hook causes Denial-of-Service under CWE-755: Improper Handling of Exceptional Conditions.
Which @sveltejs/kit versions are affected?
Affected versions include releases prior to 2.57.1 across affected packages: @sveltejs/kit.
What version fixes CVE-2026-40074?
Upgrading to 2.57.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @sveltejs/kit affected?
Yes, @sveltejs/kit is affected in releases prior to 2.57.1. Upgrade your dependency to 2.57.1 or later.
What CWE is associated with CVE-2026-40074?
CVE-2026-40074 is classified under CWE-755: Improper Handling of Exceptional Conditions (The product does not handle or incorrectly handles an exceptional condition.).
How can I check npm dependencies for CVE-2026-40074?
Run the dependency tree command: 'npm ls @sveltejs/kit'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-3f6h-2hrp-w5wx",
  "modified" : "2026-04-10T19:46:47Z",
  "published" : "2026-04-10T17:32:00Z",
  "aliases" : [ "CVE-2026-40074" ],
  "summary" : "@sveltejs/kit: Unvalidated redirect in handle hook causes Denial-of-Service",
  "details" : "`redirect`, when called from inside the `handle` server hook with a location parameter containing characters that are invalid in a HTTP header, will cause an unhandled `TypeError`. This could result in DoS on some platforms, especially if the location passed to `redirect` contains unsanitized user input.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@sveltejs/kit"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.57.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.57.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/sveltejs/kit/security/advisories/GHSA-3f6h-2hrp-w5wx"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-40074"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sveltejs/kit/commit/10d7b44425c3d9da642eecce373d0c6ef83b4fcd"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/sveltejs/kit"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sveltejs/kit/releases/tag/%40sveltejs%2Fkit%402.57.1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sveltejs/kit/releases/tag/@sveltejs/kit@2.57.1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-755" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-10T17:32:00Z",
    "nvd_published_at" : "2026-04-10T17:17:12Z"
  }
}