Repository navigation
fix(composio): require shared secret on backend routes acting on uid-keyed credentials - #14700
Merged
kodjima33 merged 1 commit intoSep 19, 2026
Conversation
…keyed credentials
Four backend routes (/api/omi/facts, /api/omi/facts/batch, /api/notion/blocks/{block_id}, /api/notion/page/{page_id}) take uid from the request with no caller authentication: the facts routes create memories in Omi with the app's integration key, and the notion routes read the user's workspace with that user's stored OAuth token.
Adds the shared-secret guard idiom used by the reviewed BasedHardware#14561 fixes (COMPOSIO_TOOLS_SECRET via Authorization: Bearer or composio_tools_token, hmac.compare_digest, fail-closed 503 when unset) and applies it to the four routes.
Hermetic regression tests (7) + checks-manifest registration included. Browser-called settings routes (/search, /extract-memories, /process-pending-memories, /memories) are deliberately left untouched, matching the BasedHardware#14446/BasedHardware#14561 scope boundary.
Contributor
Author
|
Bounty proposal for this fix: #14701 |
Contributor
Author
|
@josancamon19 @Git-on-my-level — security fix ready for review: shared-secret guard on the four Composio backend routes that took uid with no caller auth (memory writes into any Omi account; reads of any user's Notion workspace with their stored token). Same idiom as the reviewed #14561 guards, 7 hermetic tests, manifest entry included. Bounty proposal: #14701 (US$150 proposed). |
This was referenced Sep 19, 2026
kduailabs
added a commit
to kduailabs/omi
that referenced
this pull request
Sep 19, 2026
The shared-secret guard merged in BasedHardware#14700 added 'from .tools_auth import require_composio_tools_auth' to src/omi_api.py, which the hermetic route test (from BasedHardware#14384) could not resolve with its stub module set — composio-memory-route-tests started failing in the PR preflight lane for every PR touching plugins/composio/**. Adds a src.tools_auth stub so the test stays hermetic. Verified: python3 plugins/composio/test_omi_api_route.py -> 7 tests pass.
Git-on-my-level
added a commit
that referenced
this pull request
Sep 20, 2026
#14700 added 'from .tools_auth import require_composio_tools_auth' to plugins/composio/src/omi_api.py but test_omi_api_route.py's hermetic module loader stubs only src.db, so the manifest check composio-memory-route-tests crashed with ModuleNotFoundError and the first-attempt Release Eligibility push run went red on main (run 35450082746) — blocking mobile release-tag admission until a green newer main. Stub src.tools_auth with an arg-tolerant no-op guard; the guard's real behavior remains covered by test_tools_auth.py. Failure-Class: FC-fixture-mock-signature-drift Verification: reproduced the identical ModuleNotFoundError at the base SHA; after the fix test_omi_api_route.py runs 7 tests OK and test_tools_auth.py runs 7 tests OK.
Git-on-my-level
added a commit
that referenced
this pull request
Sep 20, 2026
…#15095) fix(composio): stub src.tools_auth in the hermetic route-test harness ## Summary - #14700 added `from .tools_auth import require_composio_tools_auth` to `plugins/composio/src/omi_api.py`, but `test_omi_api_route.py`'s hermetic module loader stubs only `src.db`. The import crashed with `ModuleNotFoundError: No module named 'src.tools_auth'`, failing the `composio-memory-route-tests` manifest check and the first-attempt `Release Eligibility` push run on main (42cc024, run 35450082746). Mobile release-tag admission requires a green `Release Eligibility`, so the red main also blocks all new mobile release tags until a newer green main lands. - Fix: add a `src.tools_auth` stub module to the harness with an arg-tolerant no-op `require_composio_tools_auth`. The guard's real behavior stays covered by `plugins/composio/test_tools_auth.py` (manifest id `composio-backend-route-auth-tests`), which passes unchanged. ## Failure-Class Failure-Class: FC-fixture-mock-signature-drift ## Verification - Reproduced at the base SHA before the fix: `python3 plugins/composio/test_omi_api_route.py` → `ModuleNotFoundError: No module named 'src.tools_auth'` (identical traceback to the CI failure in run 35450082746). - After the fix: `python3 plugins/composio/test_omi_api_route.py` → `Ran 7 tests ... OK`; `python3 plugins/composio/test_tools_auth.py` → `Ran 7 tests ... OK`. <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/15095?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
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.
Four backend routes in the Composio app take
uidfrom the request and act on that user's data with no caller authentication:POST /api/omi/facts?uid=<uid>andPOST /api/omi/facts/batch(uid in body) create memories in Omi for that uid using the app's own integration key (OMI_APP_ID/OMI_API_KEY).POST /api/notion/blocks/{block_id}(uid in body) andGET /api/notion/page/{page_id}?uid=read the user's Notion workspace with that user's stored OAuth token.Any caller can inject memories into an arbitrary user's Omi account (assistant memory poisoning) or read the Notion content of any user who has connected the integration, without knowing anything but the uid.
Fix
Adds
composio_tools_auth.py— the same shared-secret guard idiom as the reviewed #14561 fixes — and applies it viaDepends()to the four routes:Authorization: Bearer <COMPOSIO_TOOLS_SECRET>orcomposio_tools_tokenquery param,hmac.compare_digest, fail-closed 503 when the secret is unset, 401 otherwise. No route logic changes.Scope: browser-called settings routes (
/search,/extract-memories,/process-pending-memories,/memories) are deliberately left untouched — same boundary as #14446/#14561, since those share the fleet-wide uid model tracked by #13463.Tests
plugins/composio/test_tools_auth.py— 7 hermetic tests (fastapi stubbed, no third-party deps): 503 unconfigured/blank, 401 missing/wrong/non-bearer token, bearer + query token accepted. Registered in.github/checks-manifest.yaml.