Skip to content

fix(security): isolate authenticated box API from web exposure locks - #614

Open
dunv wants to merge 1 commit into
toniebox-reverse-engineering:developfrom
dunv:fix/security-mit-box-api
Open

dunv wants to merge 1 commit into
toniebox-reverse-engineering:developfrom
dunv:fix/security-mit-box-api

Conversation

@dunv

@dunv dunv commented Nov 19, 2026 •

Copy link
Copy Markdown

Problem

Fixes #613.

With the default domain-blacklist and crawler checks both enabled, #508 made crawler detection effective in 0.7.1. The shared request callback processes these checks before box authorization: an unauthenticated crawler request to the dedicated HTTPS box API can set the global incident flag and lock out both management clients and enrolled Tonieboxes until restart.

This also affects intentional remote box access through TLS passthrough (including no-SNI boxes) when the management listeners themselves are private.

Change

  • Reject unauthorized requests to a certificate-protected HTTPS box API before automated exposure detection.
  • Do not record automated exposure incidents for accepted requests on that protected listener, or apply web-triggered automated locks to them.
  • Preserve explicit security_mit.hardLock handling for authenticated boxes.
  • Preserve automated mitigation for management listeners and box API configurations with certificate authentication disabled, including per-box overrides.
  • Document the boundary: management listeners still need their own access protection.

No new setting and no TLS termination/routing changes.

Verification

Built the server with the default ASan/UBSan configuration on x86_64 Linux using Nix-provided build tools.

  • make test_c: 19 C tests passed.
  • make test_py TESTS="security_mit\|box_cert_check": 6 new security-mitigation cases and all 14 existing box-certificate checks passed.
  • New cases cover certificate-less crawler probes, accepted certificates with crawler User-Agents, rejected new boxes, management-triggered global incidents, global/per-box certificate-auth-disabled behavior, persisted manual hard locks, and management-route isolation on the box listener.

The new cases use fresh disposable server instances because incidents intentionally persist until restart. A minimal static index was used locally for harness readiness; no frontend behavior or actual hardware playback was tested. Full test suite not run.

AI assistance

This implementation, tests, and PR description were AI-assisted. Local verification results and remaining verification gaps are documented above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant