Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Navigation guard misses redirect hops to private addresses

未关闭
#20 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
68/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript
领域
security

调研方向

Read the page.route('**/*') handler and the existing assertPublicUrl and isPublicHost checks; then find the tests for request routing. Add a test where a public URL redirects to a private address, and verify that the redirect is blocked before the browser follows it.

由索引模型根据 Issue 内容生成。

描述

The SSRF guard from #18 checks the initial URL (assertPublicUrl) and every request seen by page.route('**/*'). Playwright only calls the route handler for the first URL in a redirect chain, so a public URL that redirects to a private or link-local address is followed without being checked.

Reproduction (appwrite/browser 0.3.5, Appwrite Cloud staging and production, 2026-10-04/05):

  • /v1/avatars/screenshots?url=https://httpbin.org/redirect-to?url=http%3A%2F%2F169.254.169.254%2Flatest%2Fmeta-data%2F passes the API's URL validator (the initial host is public), and the browser follows the redirect to 169.254.169.254. The request timed out after 30s with nothing returned, apparently because the address isn't reachable from the pod. The guard did not stop it.
  • A direct private URL, or a hostname that resolves privately (10.0.0.1.nip.io), is refused, but by the API's validator before the browser is involved.

Expected: every hop is checked with isPublicHost, and a redirect to a non-public host aborts the navigation (blockedbyclient).

Possible fix: in the route handler, fetch with redirects disabled (route.fetch({ maxRedirects: 0 })). On a 3xx, resolve Location against the request URL, check it with isPublicHost, and either abort or route.fulfill the redirect response so the browser re-requests the next hop, which passes through the handler again. Add a test with a public redirect to a private address.

Context: appwrite-labs/cloud#6236 (cloud runs 0.3.5 since 2026-10-05).

主要语言
TypeScript
星标
8
派生
2
平均合并
21 分钟
30 天内合并 PR
2

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

appwrite/docker-browser 的其他 Issue

查看 appwrite/docker-browser 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。