Repository navigation
Audit fixes (Oct 2026): loopback-only origins, optional API key, no public bind without key, trust_remote_code opt-in - #15
Merged
Conversation
…public bind without key; trust_remote_code opt-in
…pull content-type, trust_remote_code opt-in
…from GitHub (PyPI name taken)
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
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. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Security fixes from the Oct 2026 audit of the local inference server and fine-tune path.
Fixes
Originis not loopback (localhost,127.x,[::1], any port) get403; CORS only allows loopback plus anything inOPENDROP_CORS_ORIGINS.OPENDROP_API_KEYrequiresAuthorization: Bearer <key>orX-API-Keyon every route except/healthand the web UI page; the web UI reads the key fromlocalStorage.opendrop_api_key.opendrop serve --host 0.0.0.0(any non-loopback host) exits unlessOPENDROP_API_KEYis set. Default bind stays loopback.POST /v1/pullrequiresContent-Type: application/json(415otherwise), so a form post from a page can't trigger a model download.trust_remote_codeis opt-in. Fine-tuning no longer runs a model repo's own Python code unless--trust-remote-codeis passed.pip install opendropinstalls 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,/healthexempt, public bind refused without key and allowed with one, pull content-type,trust_remote_codedefault off and opt-in.Local:
pytest tests/178 passed,ruff check/ruff format --check/mypy opendropclean.testteeth:
opendrop/inference/server.py28.6% → 47.9%;opendrop/inference/security.py(new) 96.9%. The remaining server survivors are mostly in non-security routes andrun_serverdefaults.genesis: n/a (no verifier/validator changed).