browse: no supported way to keep untrusted page loads off loopback and private addresses (proxy bypass always includes loopback)

オープン
#4,812 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
typescript
領域
backend, security

調査の方向性

Start in browse/src/url-validation.ts, where classifyAddress and the "Localhost and private IPs are allowed" policy live, then read browse/src/proxy-config.ts (withLoopbackBypass, resolveProxy) and proxyServerEnv in browse/src/cli.ts. Done would be an opt-in mode that refuses non-public ranges or keeps loopback off the Chromium bypass list, with the default unchanged. Design choice comes first, so check with maintainers before coding.

索引モデルが issue の本文から書いたものです。

説明

enhancement S3

What happens

An agent drives browse to read untrusted pages (social posts, vendor pages). We want those page loads unable to reach the host's own services or its private network. browse allows loopback and RFC 1918 on purpose (browse/src/url-validation.ts: "Localhost and private IPs are allowed"), which is right for QA of local dev servers. But there is no supported way to turn that off for an untrusted-reading session:

  • browse goto http://127.0.0.1:<port>/ navigates to a local service.
  • A filtering egress proxy can't close the gap. With BROWSE_PROXY_URL set, resolveProxy always appends localhost,127.0.0.1,[::1] to the Chromium bypass list (withLoopbackBypass, browse/src/proxy-config.ts), and the CLI forwards that as BROWSE_PROXY_BYPASS to the daemon (proxyServerEnv, browse/src/cli.ts). Loopback navigations therefore always go direct, and a user-set BROWSE_PROXY_BYPASS is overwritten.
  • On a root container where user namespaces are unavailable, Chromium also runs with --no-sandbox (browser-manager.ts). That is expected, but it raises the cost of a page reaching local services.

Checked on gstack 8b684985 (Linux container, root, headless).

Ask

Either of these would do:

  1. A public-only navigation mode, for example BROWSE_PUBLIC_ONLY=1. It would extend the existing classifyAddress checks (literal, DNS answers, redirects, page-driven navigations) to refuse loopback, RFC 1918, CGNAT 100.64/10 and the other non-public ranges for top-level and subresource requests.
  2. Or a switch that leaves loopback off the Chromium bypass list, so a filtering proxy sees every request. For example, honour a user-set BROWSE_PROXY_BYPASS, or add BROWSE_PROXY_LOOPBACK=proxy.

Prior art: #17 (closed) covered SSRF generally. This issue asks for an opt-in mode, not a change to the default.

主要言語
TypeScript
スター
143k
フォーク
21k
平均マージ
7時間 19分
マージ済み PR(30日)
781

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

garrytan/gstack のほかの issue

garrytan/gstack の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。