Skip to content

[Security] SSRF and local resource access via unrestricted URL handling #17

Closed

Description

@fredluz

Summary

The goto, newtab, and diff commands accept arbitrary URLs and pass them directly to Playwright's page.goto() with no scheme or host validation. This enables Server-Side Request Forgery (SSRF) and local file access.

Affected Code

  • browse/src/write-commands.ts:21 — goto command
    const response = await page.goto(url, { waitUntil: 'domcontentloaded', timeout: 15000 });
  • browse/src/browser-manager.ts:69 — newTab() method
    await page.goto(url, { waitUntil: 'domcontentloaded', timeout: 15000 });
  • browse/src/meta-commands.ts:158,168 — diff command
    await page.goto(url1, { waitUntil: 'domcontentloaded', timeout: 15000 });
    await page.goto(url2, { waitUntil: 'domcontentloaded', timeout: 15000 });

Impact

The browser can be directed to access:

  • file:///etc/passwd and other local files
  • http://127.0.0.1/... and other private network targets
  • http://169.254.169.254/... cloud metadata endpoints
  • Any other scheme Chromium accepts

In an agentic context, a prompt-injected page could coerce the model into fetching internal resources and exfiltrating content via text, html, or screenshot.

Proof of Concept

  • bun run dev goto file:///etc/hosts → Navigated ... (200) — successfully reads local file
  • bun run dev goto http://127.0.0.1:<port>/... → successfully accesses localhost services

Suggested Fix

  • Default-deny non-HTTP(S) schemes
  • Add a denylist for localhost, RFC1918, link-local, .internal, and cloud metadata IPs (169.254.169.254)
  • Make access to local/private targets an explicit opt-in with a warning

Severity

High — enables local file read and internal network access, amplified by agentic automation context

Activity

  1. added a commit that references this issue on Mar 12, 2026
    37ef25c
  2. added a commit that references this issue on Mar 17, 2026
    52811df
  3. innodonni commented on Mar 17, 2026

    @innodonni

    This still doesn't prevent malignment from hacking insecure networks and launching nukes. I won't be using or recommending it.

  4. added a commit that references this issue on Mar 18, 2026
    f5573bd
  5. added a commit that references this issue on Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions