# Security

## Prompt injection

Advisory text is written by whoever reported or published a flaw. A CVE description, an advisory body or a reference URL can carry instructions aimed at a model. Hole Monitor cannot tell hostile prose from honest prose, so the protection is to leave prose out unless the endpoint asks for it.

- The default content mode, `structured`, is an allowlist. It copies named fields that pass a rule. A field a source adds later is absent until it is added to the list.
- Summary, details and credits are omitted. References are replaced by URLs the service builds from validated IDs.
- IDs, versions, package names, CVSS vectors and CPEs are sent only when they match a strict pattern. Vendor and product names are cleaned and limited to 128 characters of a fixed set. `omitted` counts what was dropped.
- Invisible characters are removed from all text in both modes, and `sanitized: true` marks a body that had any.
- No detector for instruction-like phrases is run. A detector misses rewordings, and a record it passed would read as cleared.
- `full` content marks every field holding third-party text in `untrusted_fields`. Whoever turns it on carries the risk.

What this does not cover: package, vendor and product names and version strings are still chosen by third parties. Someone can publish a package whose name reads as an instruction. An agent has to treat every value as data. The service has no control over what a subscriber's agent does with an event.

## Abuse controls

The service will POST to any URL a stranger registers, so:

- An endpoint must be verified before it receives events.
- URLs must use `https` on the default port and a public, multi-label DNS name, not an IP literal and not one of the service's own hosts. The rules are checked when the endpoint is saved and before every request, together with a DNS-over-HTTPS lookup that refuses names resolving to private addresses.
- A subscriber chooses which events arrive and has no influence over the body.
- The response body of a delivery is discarded; only the status code and duration are logged.
- Sign-in is guarded by Turnstile and limited per address and per IP. The API is rate-limited per key and per IP.

## Secrets and keys

- API keys are stored as SHA-256 hashes beside their first 8 characters.
- Endpoint signing secrets are 32 random bytes, stored encrypted with AES-GCM.
- Sessions are opaque cookies (`HttpOnly`, `Secure`, `SameSite=Lax`) stored as hashes, lasting 30 days from last use.

Report a security problem in Hole Monitor itself to security@holemonitor.live.
