Skip to content

Local API accepts requests from other sites through simple requests and DNS rebinding #1070

Backlog

Description

@Irozuku

Summary

The API has no authentication and accepts any Host header. #1063 replaces the wildcard CORS policy with an allowlist, which stops other sites from reading responses, but other sites can still reach the API in two ways.

Gaps left after #1063

The desktop default (127.0.0.1, main.py#L136-L140) is right and should stay.

Suggested fix

  • Add TrustedHostMiddleware allowing 127.0.0.1, localhost and hosts from a setting for Docker or server deployments.
  • Require a per launch secret on API requests that a foreign page cannot obtain, for example a SameSite=Strict HttpOnly cookie set when the backend serves the app (this keeps image URLs, downloads and the pywebview window working), with a documented token for Docker or server setups.
  • Document that binding 0.0.0.0 needs a reverse proxy with authentication.

Activity

  1. added
    bug
    back
    priority: high
    on Dec 2, 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

    backbugpriority: high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions