Repository navigation
fix(hume-ai): require shared-secret auth on uid-keyed routes - #15091
harmonygemini8-collab wants to merge 3 commits into
Conversation
/save-emotion-memory, /force-send-notification and /audio take uid from the query string and act on that uid with the app's integration key (write an emotion memory into that user's Omi account, push that user a notification, attribute posted audio to that uid's stats) with no caller authentication. Add the HUME_TOOLS_SECRET shared-secret guard (Authorization: Bearer or hume_tools_token query param, hmac.compare_digest, fail-closed 503 when unset) via Depends() on all three routes, same idiom as the reviewed mentor webhook guard and the composio backend-route guard. Hermetic tests + checks-manifest registration included. Bounty filing: BasedHardware#15089
|
Thanks @harmonygemini8-collab — verified end to end. The guard faithfully follows the composio (#14700) / ms365 (#14686) idiom, and the analysis in #15089 checks out against the code. What I verified on head a9c628e:
Two non-blocking notes:
The one thing needing a maintainer call before merge: 🤖 Automated review on behalf of the maintainers. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
Per review note on BasedHardware#15091: a discoverable entry helps deployments learn about the shared secret before the fail-closed 503 makes it loud; the comment spells out the deploy-window pairing with the /audio caller.
|
Thanks @Git-on-my-level for the thorough end-to-end pass — and for catching the scope question on the unguarded routes (/analyze-text, /emotion-config, /reset-stats), which matches the filing's threat model: only uid-keyed state is guarded. On the two notes:
On the merge precondition: agreed — the PR description and the new .env.example comment both call out that merging should be paired with setting |
main.py imports tools_auth at module scope, but the runner stage only copied main.py/app.py/emotion_config.json/templates — Docker deploys crashed at startup with ModuleNotFoundError. Copy the module alongside the app code. render.yaml gains a sync:false HUME_TOOLS_SECRET entry so a Render deploy created from the blueprint surfaces the fail-closed 503 state at setup time instead of after boot.
|
Two fixes prompted by the review pass on the sibling PRs (#15090/#15092), which apply identically here — pushed in 1a9befa:
Also added the |
|
Hey @harmonygemini8-collab 👋 Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request. After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:
Before your next PR, please skim:
If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing. Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out. Thank you for being part of the Omi community! |
Per review note on BasedHardware#15091: a discoverable entry helps deployments learn about the shared secret before the fail-closed 503 makes it loud; the comment spells out the deploy-window pairing with the /audio caller.
Summary
Three routes in the standalone hume-ai service take
uidstraight from the query string with no caller authentication and act on that uid with the app's integration key:POST /save-emotion-memory?uid=<uid>(main.py) →save_emotion_memory(uid)→create_omi_memory→POST api.omi.me/v2/integrations/{app_id}/user/memories?uid=<uid>— writes an emotion-summary memory into any user's Omi account.POST /force-send-notification?uid=<uid>(main.py) →send_omi_notification(uid, message)— pushes a notification to any user, cooldown bypass by design.POST /audio?uid=<uid>(main.py) — ingestion keyed by raw uid; attacker audio is attributed to the victim's emotion stats and can trigger that user's notifications.Same defect class as the already-reviewed guards (mentor webhook, composio backend routes #14700, ms365 dispatch #14686).
Fix
Shared-secret guard, same idiom as the reviewed precedents:
plugins/hume-ai/tools_auth.py—require_hume_tools_auth: secret fromHUME_TOOLS_SECRET, presented viaAuthorization: Bearer <secret>or thehume_tools_tokenquery param, checked withhmac.compare_digest; fail-closed 503 when the secret is unset/blank so the surface is never silently unauthenticated in production.Depends()to all three routes inplugins/hume-ai/main.py.plugins/hume-ai/test_tools_auth.py— 9 hermetic tests (fastapi stubbed, stdlib only): 503 unconfigured/blank, 401 missing/wrong/non-bearer/blank-token, bearer + query accepted, bearer preferred over query..github/checks-manifest.yaml— registered ashume-tools-auth-tests(local + ci lanes).Deployment note
/audiois the device/bridge ingestion path: callers must now present the shared secret (header or query param) — the caller update needs to ship withHUME_TOOLS_SECRETin the deploy env, in the same window as this merge, or ingestion will 503 until configured. The two management routes have no automated callers.Bounty filing: #15089
cc @kodjima33 @josancamon19
Failure-Class: none