magus v0.4.3 is out. See what's new
¶ View markdown source · ✎ Suggest an edit
1 min read

MGS9007: host not allowed

The server answered 403 forbidden because the request's Host header, or its Origin header when one was sent, named a host the server does not serve.

[MGS9007] the server serves only loopback hosts and the configured console
origin; this request named another host in its Host or Origin header
  see: .../MGS9007.md

Why

The server listens on loopback, but a web page on any site can point a DNS name at 127.0.0.1 and have the browser send requests to it (DNS rebinding). Those requests carry the attacker's hostname in Host and Origin, so the server accepts only loopback addresses, localhost, and the hosted console's origin.

Resolution

  • Reach the server as 127.0.0.1:<port> or localhost:<port>, not through another hostname that resolves to this machine.
  • A browser client on another origin: open the console from the server itself (magus console), or from the hosted console the server already trusts.

What this is NOT

  • Not a token problem. The host check runs before the bearer check; a missing or wrong token is MGS9001.
MGS9007authrebindhostorigincors403
Last updated (95680f58)
Earlier changes on this page (1)

Full history ↗ · Blame source ↗

Glossary

Op

A single tool-native command a target composes (long form: operation); the middle of the work hierarchy (Spell to Op to Target). See operations.

Server

The background process a person starts with magus server start. It serves MCP, the console, background jobs and the warm knowledge graph, and adopts nested magus calls into one pool. See server.

Run

One target executing under one magus invocation, such as magus run test web or magus affected ci. A run keeps its captured output behind an output reference. Every magus run is a run whether or not any job asked for it; see Job for how the two relate.

Conventions

Placeholders

Angle brackets mark a value you replace with your own - never type the brackets:

magus run <target>
magus completion <shell>    # e.g. bash, zsh, fish

<target>, <path>, <shell>, <name> and the like are stand-ins, not literal text.