网安资讯详情 - SecLens 情报雷达

网安资讯,一网打尽。汇集权威漏洞通告与行业要闻,结合分组浏览、智能过滤、RSS订阅 和 Webhook 推送,多通道拓展您的安全情报视野。

npm/@astrojs/node: @astrojs/node: Backslash-prefixed paths not recognized as internal by trailing-slash redirect

来源: github_advisory · 发布时间 2026-07-21 07:22 (UTC+08:00) · 抓取时间 2026-07-21 08:45 (UTC+08:00)

原文链接

摘要

Severity: LOW | CVE: CVE-2026-59730 | Package: npm/@astrojs/node | Affected: >= 8.1.0, < 11.0.2 | Patched: 11.0.2

正文

### Impact With `trailingSlash: 'always'` configured, the `@astrojs/node` standalone server's static file handler appends a trailing slash to request paths and issues a `301` redirect. Paths beginning with `/\` (slash-backslash) were not recognized as internal paths, so the handler would echo the raw path back in the `Location` header. Because browsers treat `\` as `/` per the WHATWG URL specification, the resulting redirect could resolve to an external host. **Preconditions:** - `trailingSlash: 'always'` must be set (non-default; the default is `'ignore'`) - The request path must not have a file extension in its final segment - An attacker must deliver the crafted link to a user ### Patches Fixed by treating backslash-prefixed paths the same as `//`-prefixed paths in `isInternalPath()`, so they are no longer rewritten with a trailing slash. ### Workarounds Use the default `trailingSlash: 'ignore'` setting, which does not issue trailing-slash redirects in the static file handler. ### References - [WHATWG URL spec: backslash normalization](https://url.spec.whatwg.org/#url-parsing)

标签

扩展字段

{
  "credits": [
    {
      "login": "alanturing881",
      "type": "reporter"
    }
  ],
  "cve_id": "CVE-2026-59730",
  "cwe_ids": [
    "CWE-601"
  ],
  "cwe_names": [
    "URL Redirection to Untrusted Site ('Open Redirect')"
  ],
  "ghsa_id": "GHSA-r557-wffq-wvrc",
  "package": {
    "ecosystem": "npm",
    "name": "@astrojs/node",
    "patched_version": "11.0.2",
    "vulnerable_range": ">= 8.1.0, < 11.0.2"
  },
  "references": [
    "https://github.com/withastro/astro/security/advisories/GHSA-r557-wffq-wvrc",
    "https://github.com/withastro/astro/pull/17252",
    "https://github.com/withastro/astro/commit/eb6f97e391ee587747e37609c255c7cd4b9cce3c",
    "https://github.com/withastro/astro/releases/tag/@astrojs/[email protected]",
    "https://github.com/advisories/GHSA-r557-wffq-wvrc"
  ],
  "source_code_location": "https://github.com/withastro/astro",
  "updated_at": "2026-07-20T23:22:22Z"
}