# Security Policy

## Reporting a Vulnerability

If you discover a security vulnerability in wheriflo, please report it
responsibly by emailing the maintainers or opening a
[GitHub Security Advisory](https://github.com/harrisonhoffman1/wheriflo/security/advisories/new).

Please do **not** open a public issue for security vulnerabilities.

## Scope

### Lua Sandbox

The toolkit runs Lua cartridge code in a sandboxed lupa (Lua 5.1) environment.
The runtime is created with lupa's Python bridge disabled
(`register_eval=False`, `register_builtins=False`) and an attribute filter that
denies Lua access to any private/dunder (`_`-prefixed) attribute of Python
objects. In addition, the following are removed before cartridge code runs:

- `io` — file I/O
- `os` — operating system access
- `debug` — debug library
- `loadfile` / `dofile` — file loading and execution
- `loadstring` / `load` — runtime compilation of arbitrary Lua
- `package.loadlib`, `package.cpath`, `package.loaders` — loading native (C)
  libraries or arbitrary files

`require` is kept only so cartridges can `require "Wherigo"` (served from a
pre-populated `package.loaded` cache); the loaders are removed so it cannot
pull in anything else.

If you find a way to escape this sandbox (e.g., accessing the filesystem,
running system commands, or invoking Python from within a `.lua` cartridge),
that is a security vulnerability and should be reported.

### Web Player

The web player binds to `localhost` only and is intended for local development
testing. It does not implement authentication or CORS protections. Do not expose
it to the public internet.

### MCP Server

The MCP server communicates over stdio (stdin/stdout) and does not open network
ports. It inherits the permissions of the user running it.

## Supported Versions

| Version | Supported |
|---------|-----------|
| 2.0.x   | Yes       |
