Localhost Origin Guard — Development skill for Claude Code
Allow a browser app to talk to your local agent or bridge only if the Host is exact loopback and the Origin is explicitly allow-listed.
How to install Localhost Origin Guard
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open Kein-chronicle/localhost-origin-guard and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Localhost Origin Guard does
Allow a browser app to talk to your local agent or bridge only if the Host is exact loopback and the Origin is explicitly allow-listed.
Alternatives in Development
- CORS — Scan an endpoint for CORS misconfiguration — arbitrary-origin reflection, null-origin trust, credential exposu 4.5k ★
- Add To Amux Board — You are adding an item to the amux local kanban board at https://localhost:8822/api/board 86 ★
- Review Extension — Browser-extension + bridge review with extension-reviewer (Primary Owner) 52 ★
README
localhost-origin-guard
**Allow a browser app to talk to your local agent or bridge only if the Host is exact loopback and the Origin is explicitly allow-listed.**
[](https://github.com/Kein-chronicle/localhost-origin-guard/actions/workflows/test.yml)  
Why
A local server reachable from any web page is a remote-control surface. Checking `Origin` and the `Host` header exactly blocks cross-site requests and DNS-rebinding style hosts such as `localhost:8731.evil.example`.
Install
**As a Claude Code skill** (Claude uses it when the task matches the skill description):
git clone https://github.com/Kein-chronicle/localhost-origin-guard.git ~/.claude/skills/local-origin-guard
For a single project, clone into `/.claude/skills/local-origin-guard` instead, then start a new Claude Code session.
**As a library** (Node.js 22+, no dependencies):
npm install github:Kein-chronicle/localhost-origin-guard
or copy the one file you need: `scripts/guard.mjs` is self-contained.
**Requires:** Node.js 22+.
Quick start
Run the quickstart:
$ node examples/quickstart.mjs
true allowed origin on loopback
true 127.0.0.1 is fine too
false unlisted origin
false origin with trailing slash (not canonical)
false DNS-rebinding style Host
false wrong port in Host
false no Origin header at all
The output above is real: it is produced by the files in `examples/`.
API
import { requestAllowed } from 'localhost-origin-guard';
requestAllowed({
host: req.headers.host, origin: req.headers.origin,
port: 8731, allowedOrigins: ['https://editor.example.com'],
}); // true / false
`Host` must be exactly `localhost:PORT`, `127.0.0.1:PORT` or `[::1]:PORT`; `Origin` must be in the list and
Related Skills
Rogue Wardley Maps Skill
Strategic mapping visualization. Use when the project needs this capability or the user / team manifest asks f
Rogue Ngspice Skill
NGSpice circuit simulation MCP server. Use when the project needs this capability or the user / team manifest
Rogue Jvm Skill
JVM languages (Java, Kotlin, Scala). Use when the project needs this capability or the user / team manifest as
Rogue Import To Ontology Skill
Document to ontology import. Use when the project needs this capability or the user / team manifest asks for i
Rogue Imagemagick Skill
ImageMagick processing MCP server. Use when the project needs this capability or the user / team manifest asks
Rogue Haskell Skill
Haskell with GHC, Cabal, Stack, and HLS. Use when the project needs this capability or the user / team manifes
Related Agents
Extension Author
WRITE-access implementer for the browser extension (apps/extension/ — MV3, Chrome + Firefox) and the desktop⇄e
Webview Security Auditor
Static auditor for Android WebView and iOS WKWebView/SFSafariViewController configuration and bridge exposure:
Git Sync Agent
Git Sync Auditor. Use this agent to check for uncommitted differences and remote drift before risky operations