Skip to content

/api/page follows redirects to internal addresses (from Opus) #37

Closed

Description

@a-Fig

/api/page refuses internal addresses with isPublicHttpUrl, but only for the first URL. fetchReadable (in page.js once #36 lands, server.js before) fetches with redirect: "follow". A public URL that redirects to 127.0.0.1, 169.254.169.254 or another private address gets fetched, and its text comes back to the page.

Found by the Opus review of #36 (2026-11-13). It predates that PR. AGENT_TOKEN limits who can try, but the token sits in the bot's page URL.

Fix: use redirect: "manual" and follow at most a few redirects by hand, checking each Location with isPublicHttpUrl. DNS tricks, where a public name resolves to a private address, stay out of scope, as CLAUDE.md already says.

This changes server.js/the API, so it needs an Opus or Sol review.

Activity

  1. added
    bug
    priority: soon
    PR needed
    from: Opus
    on Nov 13, 2026
  2. changed the title [-]C:/Program Files/Git/api/page follows redirects to internal addresses (from Opus)[/-] [+]/api/page follows redirects to internal addresses (from Opus)[/+] on Nov 13, 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

    PR neededbugfrom: Opuspriority: soon

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions