Skip to content

Audit fixes (Oct 2026): loopback-only origins, optional API key, no public bind without key, trust_remote_code opt-in - #15

Merged
fernandogarzaaa merged 3 commits into
mainfrom
fix/audit-2026-10
Oct 12, 2026
Merged

fernandogarzaaa merged 3 commits into
mainfrom
fix/audit-2026-10

Conversation

@fernandogarzaaa

Copy link
Copy Markdown
Owner

Security fixes from the Oct 2026 audit of the local inference server and fine-tune path.

Fixes

  • Drive-by requests from web pages (localhost CSRF). Browser requests whose Origin is not loopback (localhost, 127.x, [::1], any port) get 403; CORS only allows loopback plus anything in OPENDROP_CORS_ORIGINS.
  • Optional API key. OPENDROP_API_KEY requires Authorization: Bearer <key> or X-API-Key on every route except /health and the web UI page; the web UI reads the key from localStorage.opendrop_api_key.
  • Public binds refused without a key. opendrop serve --host 0.0.0.0 (any non-loopback host) exits unless OPENDROP_API_KEY is set. Default bind stays loopback.
  • POST /v1/pull requires Content-Type: application/json (415 otherwise), so a form post from a page can't trigger a model download.
  • trust_remote_code is opt-in. Fine-tuning no longer runs a model repo's own Python code unless --trust-remote-code is passed.
  • Install docs: pip install opendrop installs an unrelated PyPI project (an AirDrop implementation); README and the missing-extra error messages now point at the GitHub install instead. Package not renamed or published.

Tests

New tests/test_security.py (29 tests): loopback vs foreign origins incl. lookalike hosts, CORS preflight, key required/accepted via both headers, /health exempt, public bind refused without key and allowed with one, pull content-type, trust_remote_code default off and opt-in.
Local: pytest tests/ 178 passed, ruff check / ruff format --check / mypy opendrop clean.

testteeth: opendrop/inference/server.py 28.6% → 47.9%; opendrop/inference/security.py (new) 96.9%. The remaining server survivors are mostly in non-security routes and run_server defaults.

genesis: n/a (no verifier/validator changed).

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Oct 12, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0fff20cb-77c8-46ab-b885-bf987589b3d5

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@fernandogarzaaa
fernandogarzaaa merged commit fdac987 into main Oct 12, 2026
9 checks passed
@fernandogarzaaa
fernandogarzaaa deleted the fix/audit-2026-10 branch October 12, 2026 15:34
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