# GHSA-P4H3-4H99-9665: Nuxt Vite server builder wildcard redirect route rules can redirect to another origin

- Database: GitHub
- Severity: CVSS 3.1 (Low)
- Published: 2026-11-02
- Modified: 2026-11-02

## Affected versions

- @nuxt/vite-server (npm): from 4.6.0, fixed in 4.6.4

## Description

### Summary

Under the experimental Vite server builder (`@nuxt/vite-server`), a wildcard `redirect` route rule whose target starts with `**` or `/**` could redirect to another origin. A request path continuing with an extra `/` or `\` after the rule's prefix (or a path that normalises to one, such as `/old/x/..//evil.example`) produced a protocol-relative `Location` header.

### Impact

A wildcard `redirect` rule copies the rest of the request path onto its target. With this configuration:

```ts
export default defineNuxtConfig({
  server: { builder: 'vite' },
  routeRules: {
    '/old/**': { redirect: '/**' },
  },
})
```

the server built by `nuxt build` (`.output/server/index.mjs`) redirected a request for `/old//evil.example` or `/old/\evil.example` to `//evil.example`, which browsers follow to `evil.example`. A link to an affected site can therefore send a visitor to an origin chosen by an attacker.

Only applications that meet all of the following are affected:

- They build with the experimental Vite server builder (`server: { builder: 'vite' }`), which was introduced in `4.6.0`. Applications on the default Nitro server builder (`@nuxt/nitro-server`) do not run this code.
- They deploy its server output. Static output (`nuxt generate`) and SPA builds (`ssr: false`) have no server and are not affected.
- They have a wildcard `redirect` rule whose target starts with `**` or `/**`, such as `'/**'` or `'/**/x'`. Targets with a path before the `**` (`'/new/**'`) stay on the same origin.

Nuxt 3 does not include the Vite server builder.

### Patches

Fixed in `@nuxt/vite-server` 4.6.4, which `nuxt` 4.6.4 depends on. A run of separators (`/`, `\` or their percent-encoded forms) at the start of the copied path now collapses to a single `/`, so the target stays on the origin it names.

### Workarounds

Upgrade to `nuxt` 4.6.4. If you cannot upgrade, give wildcard redirect targets a path before the `**` (for example `'/new/**'`), or build with the default Nitro server builder.

## References

- https://github.com/nuxt/nuxt/security/advisories/GHSA-p4h3-4h99-9665

Page: https://cve.now/GHSA-P4H3-4H99-9665

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
