nitropack @2.13.3
Maintainers
Dependencies (70)
| Package | Constraint | Registry Status |
|---|---|---|
| h3 | ^1.15.10 | auto_approved |
| c12 | ^3.3.4 | No greenflagged match |
| db0 | ^0.3.4 | auto_approved |
| ufo | ^1.6.3 | auto_approved |
| defu | ^6.1.6 | auto_approved |
| etag | ^1.8.1 | auto_approved |
| jiti | ^2.6.1 | auto_approved |
| mime | ^4.1.0 | auto_approved |
| mlly | ^1.8.2 | auto_approved |
| citty | ^0.2.2 | auto_approved |
| destr | ^2.0.5 | auto_approved |
| klona | ^2.0.6 | auto_approved |
| ohash | ^2.0.11 | auto_approved |
| pathe | ^2.0.3 | auto_approved |
| scule | ^1.3.0 | auto_approved |
| unctx | ^2.5.0 | auto_approved |
| unenv | 2.0.0-rc.24 | No greenflagged match |
| youch | ^4.1.1 | auto_approved |
| croner | ^10.0.1 | auto_approved |
| globby | ^16.2.0 | auto_approved |
| httpxy | ^0.5.0 | auto_approved |
| ofetch | ^1.5.1 | auto_approved |
| radix3 | ^1.1.2 | auto_approved |
| rollup | ^4.60.1 | auto_approved |
| semver | ^7.7.4 | auto_approved |
| unwasm | ^0.5.3 | auto_approved |
| compatx | ^0.2.0 | auto_approved |
| confbox | ^0.2.4 | auto_approved |
| consola | ^3.4.2 | auto_approved |
| crossws | ^0.3.5 | auto_approved |
| esbuild | ^0.27.5 | auto_approved |
| exsolve | ^1.0.8 | auto_approved |
| ioredis | ^5.10.1 | auto_approved |
| listhen | ^1.9.1 | auto_approved |
| std-env | ^4.0.0 | auto_approved |
| untyped | ^2.0.0 | auto_approved |
| archiver | ^7.0.1 | auto_approved |
| chokidar | ^5.0.0 | auto_approved |
| dot-prop | ^10.1.0 | auto_approved |
| hookable | ^5.5.3 | No greenflagged match |
| knitwork | ^1.3.0 | auto_approved |
| magicast | ^0.5.2 | auto_approved |
| uncrypto | ^0.1.3 | auto_approved |
| unimport | ^6.0.2 | auto_approved |
| cookie-es | ^2.0.1 | auto_approved |
| gzip-size | ^7.0.0 | auto_approved |
| pkg-types | ^2.3.0 | auto_approved |
| ultrahtml | ^1.6.0 | auto_approved |
| unstorage | ^1.17.5 | auto_approved |
| source-map | ^0.7.6 | auto_approved |
| youch-core | ^0.3.3 | auto_approved |
| @vercel/nft | ^1.5.0 | auto_approved |
| magic-string | ^0.30.21 | auto_approved |
| pretty-bytes | ^7.1.0 | auto_approved |
| serve-static | ^2.2.1 | auto_approved |
| node-mock-http | ^1.0.4 | auto_approved |
| unplugin-utils | ^0.3.1 | auto_approved |
| perfect-debounce | ^2.1.0 | auto_approved |
| node-fetch-native | ^1.6.7 | auto_approved |
| serve-placeholder | ^2.0.2 | auto_approved |
| @rollup/plugin-json | ^6.1.0 | auto_approved |
| @rollup/plugin-alias | ^6.0.0 | No greenflagged match |
| escape-string-regexp | ^5.0.0 | auto_approved |
| @rollup/plugin-inject | ^5.0.5 | auto_approved |
| @rollup/plugin-terser | ^1.0.0 | auto_approved |
| @rollup/plugin-replace | ^6.0.3 | auto_approved |
| @rollup/plugin-commonjs | ^29.0.2 | auto_approved |
| rollup-plugin-visualizer | ^7.0.1 | auto_approved |
| @rollup/plugin-node-resolve | ^16.0.3 | auto_approved |
| @cloudflare/kv-asset-handler | ^0.4.2 | auto_approved |
Dev Dependencies (36)
| Package | Constraint | Registry Status |
|---|---|---|
| execa | ^9.6.1 | auto_approved |
| automd | ^0.4.3 | auto_approved |
| eslint | ^10.1.0 | auto_approved |
| undici | ^7.24.7 | auto_approved |
| vitest | ^4.1.2 | auto_approved |
| xml2js | ^0.6.2 | auto_approved |
| unbuild | ^3.6.1 | auto_approved |
| ohash-v1 | npm:ohash@^1.1.6 | Not imported |
| prettier | ^3.8.1 | auto_approved |
| wrangler | ^4.79.0 | auto_approved |
| miniflare | ^4.20260329.0 | auto_approved |
| typescript | ^6.0.2 | auto_approved |
| @deno/types | ^0.0.1 | Not imported |
| @types/etag | ^1.8.4 | auto_approved |
| changelogen | ^0.6.2 | No greenflagged match |
| expect-type | ^1.3.0 | auto_approved |
| edge-runtime | ^4.0.1 | auto_approved |
| @types/estree | ^1.0.8 | auto_approved |
| @types/semver | ^7.7.1 | auto_approved |
| @types/xml2js | ^0.4.14 | auto_approved |
| firebase-admin | ^13.7.0 | auto_approved |
| @types/archiver | ^7.0.0 | auto_approved |
| @types/fs-extra | ^11.0.4 | No greenflagged match |
| get-port-please | ^3.2.0 | auto_approved |
| @azure/functions | ^3.5.1 | auto_approved |
| @types/aws-lambda | ^8.10.161 | auto_approved |
| @types/node-fetch | ^2.6.13 | auto_approved |
| @netlify/functions | ^5.1.5 | auto_approved |
| eslint-config-unjs | ^0.6.2 | Not imported |
| firebase-functions | ^7.2.2 | auto_approved |
| @types/serve-static | ^2.2.0 | auto_approved |
| @vitest/coverage-v8 | ^4.1.2 | auto_approved |
| @scalar/api-reference | ^1.49.8 | auto_approved |
| @netlify/edge-functions | ^3.0.6 | auto_approved |
| @cloudflare/workers-types | ^4.20260401.1 | auto_approved |
| @azure/static-web-apps-cli | ^2.0.8 | Not imported |
Transitive Dependency Tree
Changes from v2.13.2
Dependency Changes
| Change | Package | Version |
|---|---|---|
| changed | h3 | ^1.15.9 → ^1.15.10 |
| changed | c12 | ^3.3.3 → ^3.3.4 |
| changed | defu | ^6.1.4 → ^6.1.6 |
| changed | citty | ^0.2.1 → ^0.2.2 |
| changed | unenv | ^2.0.0-rc.24 → 2.0.0-rc.24 |
| changed | youch | ^4.1.0 → ^4.1.1 |
| changed | globby | ^16.1.1 → ^16.2.0 |
| changed | httpxy | ^0.3.1 → ^0.5.0 |
| changed | rollup | ^4.59.0 → ^4.60.1 |
| changed | esbuild | ^0.27.4 → ^0.27.5 |
| changed | listhen | ^1.9.0 → ^1.9.1 |
| changed | cookie-es | ^2.0.0 → ^2.0.1 |
| changed | unstorage | ^1.17.4 → ^1.17.5 |
| changed | @vercel/nft | ^1.4.0 → ^1.5.0 |
File Changes
Risk Dispositions (2 applicable to this version, 0 other)
Accepted rules are downgraded to INFO on future analyses; rejected rules escalate to CRITICAL.
| Rule | Source | Disposition | Author | Reason | |
|---|---|---|---|---|---|
osv:GHSA-5w89-w975-hf9q |
osv | reject | AI | AI (osv): Proxy scope bypass via %2F path traversal; fixed in 2.13.4. Affects all versions < 2.13.4. | |
osv:GHSA-9phm-9p8f-hw5m |
osv | reject | AI | AI (osv): Open redirect via protocol-relative URL in wildcard redirect rules; fixed in 2.13.4. Affects all versions < 2.13.4. |
SAST Findings (3)
[Always reject] CVSS 5.3 (MEDIUM) — CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N A proxy route rule like: ```ts routeRules: { "/api/orders/**": { proxy: { to: "http://upstream/orders/**" } } } ``` is intended to limit the proxy to URLs under `/api/orders/`. Before the patch, an attacker could bypass that scope by sending percent-encoded path traversal (`..%2f`) in the URL, causing Nitro to forward a request that the upstream resolved outside the configured scope. Example exploit: ``` GET /api/orders/..%2fadmin%2fconfig.json ``` Nitro sees `..%2f` as opaque characters at match time, the `/api/orders/**` rule matched, and the raw path was forwarded to the upstream as `/orders/..%2fadmin/config.json`. An upstream that decodes `%2F` to `/` then resolved `..` and can serve `/admin/config.json` outside the intended scope. ### Are you affected? Users may be affected if **ALL** of the following are true: 1. Their project uses Nitro's `routeRules` with a `proxy` entry (`{ proxy: { to: "..." } }`). 2. The proxy `to` value uses a `/**` wildcard suffix to forward sub-paths. 3. The **upstream** behind the proxy decodes `%2F` as `/` before routing or filesystem lookup. 4. Proxy route rules are _not_ handled natively at CDN (nitro v3 and vercel) Whether the bypass actually leaks data depends on the upstream. Modern JS frameworks keep `%2F` opaque per RFC 3986 and are safe by construction. - **Safe examples:** H3 v2, Express v5, Hono v4 — modern JS frameworks keep `%2F` opaque per RFC 3986. - **Vulnerable examples:** naive imlementations that decodes the URL, static file servers, CGI dispatchers, Python `os.path`-based routing, anything sitting behind another layer that decodes `%2F` (common in microservice meshes). ## Impact Any HTTP path reachable from the Nitro server to the upstream could be requested, regardless of the configured `/**` scope. In typical deployments (API gateway, BFF, microservice proxy) this could expose internal admin endpoints, secrets endpoints, or other services the developer believed the scope rule fenced off. ## Patched versions Upgrade to one of: - [2.13.4](https://github.com/nitrojs/nitro/releases/tag/v2.13.4) or later (https://github.com/nitrojs/nitro/pull/4223) - [3.0.260429-beta](https://github.com/nitrojs/nitro/releases/tag/v3.0.260429-beta) or later (https://github.com/nitrojs/nitro/pull/4222) The fix canonicalizes the incoming pathname before building the upstream URL and rejects requests with `400 Bad Request` if the resolved path would escape the rule's base. The bytes forwarded upstream are unchanged when the request is allowed. > Note: the fix assumes the upstream does not double-decode percent-encoding. If your upstream decodes twice (`%252F → %2F → /`), it remains your responsibility to harden it. **Single-decode is standard**. ## Credits Reported by [@mHe4am](https://github.com/mHe4am) ([@he4am on HackerOne](https://hackerone.com/he4am)) via the [Vercel Open Source](https://hackerone.com/vercel-open-source?type=team) program.
[Always reject] A redirect route rule like: ```ts routeRules: { "/legacy/**": { redirect: "/**" } } ``` is intended to rewrite paths within the same host. Before the patch, an attacker could turn the rewrite into a cross-host redirect by sliding an extra slash in after the rule prefix. Example exploit: ``` GET /legacy//evil.com ``` Nitro stripped `/legacy` from the matched pathname and joined the remainder against the rule's target. The remainder was `//evil.com`, which the join preserved verbatim, so Nitro responded with `Location: //evil.com`. Browsers resolve `//evil.com` as a protocol-relative URL against the current scheme, sending the user to `https://evil.com`. ### Are you affected? Users may be affected if **all** of the following are true: 1. Their project uses Nitro's `routeRules` with a `redirect` entry. 2. The target uses a `/**` wildcard suffix to forward sub-paths (e.g. `redirect: "/**"`, `redirect: "/new/**"`, `proxy: { to: "http://upstream/**" }`). 3. The `redirect` rule is _not_ handled natively at the CDN layer. The `vercel`, `netlify`, `cloudflare-pages`, and `edgeone` presets translate `routeRules.redirect` into platform config (`vercel.json`, `_redirects`, EdgeOne v3 config) and serve the redirect at the edge — those deployments bypass the Nitro runtime entirely and are not affected. Every other preset executes the redirect through the Nitro runtime and can be vulnerable. ## Impact Open redirect from any host serving Nitro with a wildcard `redirect` rule. The redirect target is fully attacker-controlled, the URL looks legitimate (it starts with the victim's domain), and the browser silently follows it. ## Patched versions Upgrade to one of: - [2.13.4](https://github.com/nitrojs/nitro/releases/tag/v2.13.4) or later (or upgrade lockfile with latest ufo 1.6.4+) - [3.0.260429-beta](https://github.com/nitrojs/nitro/releases/tag/v3.0.260429-beta) or later (https://github.com/nitrojs/nitro/pull/4236) The fix has two parts: 1. `ufo` is bumped to `^1.6.4` ([unjs/ufo@5cd9e67](https://github.com/unjs/ufo/commit/5cd9e676711af3f4e4b5398ddf6ca8d52c1c7e1f)), which collapses any run of leading slashes to a single `/` inside `withoutBase`. This covers the typical `"/scope/**"` rule. 2. The Nitro runtime additionally collapses leading `//` before joining when the rule path itself is `/**` (in rare case which case `withoutBase` is never called and the raw pathname flows straight into `joinURL("", …)`).
[Accepted risk] Package was published without Sigstore provenance. Consider requesting the maintainer enable provenance via CI/CD.
Review Summary
Risk score: 80. Findings: 2 critical (+80), 5 info (+0).
Commit: be8b79b45d7f Browse source
Published to npm: