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

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

npm/@angular/platform-server: @angular/platform-server: SSRF via Hostname Hijacking

来源: github_advisory · 发布时间 2026-05-20 04:29 (UTC+08:00) · 抓取时间 2026-05-20 09:45 (UTC+08:00)

原文链接

摘要

Severity: HIGH | CVE: CVE-2026-46417 | Package: npm/@angular/platform-server | Affected: >= 22.0.0-next.0, < 22.0.0-next.12 | Patched: 22.0.0-next.12

正文

### Impact A Server-Side Request Forgery (SSRF) vulnerability exists in `@angular/platform-server`. The issue stems from how the server-side rendering (SSR) engine processes the request URL provided to the rendering entry points. When an absolute-form URL (e.g., `http://evil.com`) is passed to the rendering engine, the internal `ServerPlatformLocation` can be manipulated into adopting the attacker-controlled domain as the "current" hostname. Consequently, any relative `HttpClient` requests or `PlatformLocation.hostname` references are redirected to the attacker controlled server, potentially exposing internal APIs or metadata services. ### Fix Information The vulnerability is mitigated by introducing an Allowlist Mechanism directly into the core rendering APIs. The renderModule and renderApplication functions now include an allowedHosts configuration option. The rendering engine validates the hostname extracted from the request URL against this list before proceeding. If the hostname does not match an allowed entry, the engine prevents the hostname hijacking, ensuring that HttpClient requests remain restricted to trusted domains. ### Patches - 22.0.0-next.12 - 21.2.13 - 20.3.21 - 19.2.22 ### Workarounds Developers unable to update immediately should implement strict URL validation in their server entry point (e.g., `server.ts`). Ensure that `req.url` is validated against a known list of trusted hostnames or normalized to a relative path before being passed to`renderApplication` or `renderModule`. ```TypeScript // Example manual normalization in Express app.get('*', (req, res, next) => { const trustedHost = 'localhost:4000'; // Ensure the request target matches expectations if (req.headers.host !== trustedHost) { return res.status(403).send('Forbidden'); } next(); }); ```

标签

扩展字段

{
  "credits": [
    {
      "login": "alan-agius4",
      "type": "remediation_developer"
    },
    {
      "login": "AndrewKushnir",
      "type": "remediation_reviewer"
    },
    {
      "login": "VenkatKwest",
      "type": "finder"
    },
    {
      "login": "dgp1130",
      "type": "remediation_reviewer"
    }
  ],
  "cve_id": "CVE-2026-46417",
  "cwe_ids": [
    "CWE-918"
  ],
  "cwe_names": [
    "Server-Side Request Forgery (SSRF)"
  ],
  "ghsa_id": "GHSA-rfh7-fxqc-q52v",
  "package": {
    "ecosystem": "npm",
    "name": "@angular/platform-server",
    "patched_version": "22.0.0-next.12",
    "vulnerable_range": ">= 22.0.0-next.0, < 22.0.0-next.12"
  },
  "references": [
    "https://github.com/angular/angular/security/advisories/GHSA-rfh7-fxqc-q52v",
    "https://github.com/angular/angular/pull/68570",
    "https://github.com/advisories/GHSA-rfh7-fxqc-q52v"
  ],
  "source_code_location": "https://github.com/angular/angular",
  "updated_at": "2026-05-19T20:29:53Z"
}