Skip to content

fix(hume-ai): require shared secret on uid-keyed routes - #15090

Closed
glmbugbounty wants to merge 1 commit into
BasedHardware:mainfrom
glmbugbounty:fix/hume-ai-tools-auth
Closed

glmbugbounty wants to merge 1 commit into
BasedHardware:mainfrom
glmbugbounty:fix/hume-ai-tools-auth

Conversation

@glmbugbounty

@glmbugbounty glmbugbounty commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

What

Three routes in the standalone hume-ai service read uid from the query string with no caller authentication:

  • POST /audio?uid=<uid>
  • POST /save-emotion-memory?uid=<uid>
  • POST /force-send-notification?uid=<uid>

They write emotion memories into any user's Omi account via the app's integration key (OMI_API_KEY) and push notifications to any user — no Depends guard, no Bearer check.

Fix

Adds the shared-secret guard idiom used by the reviewed #14561/#14700/#14684 fixes, applied to all three routes:

  • HUME_TOOLS_SECRET env var, accepted via Authorization: Bearer <secret> or a hume_tools_token query parameter
  • hmac.compare_digest constant-time comparison
  • Fail-closed: 503 when the secret is unset, 401 on missing/wrong token

Changes

  • plugins/hume-ai/hume_tools_auth.py — new shared-secret guard
  • plugins/hume-ai/main.py — wire Depends(require_hume_tools_auth) onto the three routes
  • plugins/hume-ai/test_hume_tools_auth.py — 7 hermetic regression tests (stdlib-only, fastapi stubbed)
  • .github/checks-manifest.yaml — register hume-ai-route-auth-tests
  • README.md / .env.example — document the new secret

How tested

  • python -m unittest test_hume_tools_auth -v → 7/7 OK
  • python test_create_omi_memory_route.py → 3/3 OK (existing suite unaffected)
  • Live FastAPI TestClient check: no token → 401, wrong bearer → 401, valid bearer → passes guard, unset secret → 503

Closes #15089

Review in cubic

/audio, /save-emotion-memory and /force-send-notification take uid from the
query string with no caller authentication: they write emotion memories into
any user's Omi account with the app's integration key and push notifications
to any user.

Add the shared-secret guard idiom (HUME_TOOLS_SECRET via Authorization: Bearer
or hume_tools_token query param, hmac.compare_digest, fail-closed 503 when
unset) and apply it to the three routes. Hermetic regression tests (7) plus
checks-manifest registration and README/.env.example documentation included.
@Git-on-my-level

Copy link
Copy Markdown
Member

Thanks @glmbugbounty - this is a clean, well-scoped fix for the unauthenticated uid-keyed routes reported in #15089, and it follows the same shared-secret pattern already merged for composio (#14700) and shipbob (#14684).

What I verified:

  • plugins/hume-ai/hume_tools_auth.py - the new guard mirrors plugins/basic/mentor_webhook_auth.py: constant-time hmac.compare_digest, fail-closed 503 when HUME_TOOLS_SECRET is unset or blank, 401 on missing/wrong token, token accepted as Authorization: Bearer header or hume_tools_token query param. No issues found.
  • plugins/hume-ai/main.py - the only production changes are Depends(require_hume_tools_auth) on /audio, /save-emotion-memory and /force-send-notification plus the import; the rest of the file is byte-identical to main. Those are exactly the three routes from the advisory; the remaining unguarded routes (/status, /reset-stats, /analyze-text, /emotion-config) don't act on caller-supplied uids.
  • plugins/hume-ai/test_hume_tools_auth.py - stdlib-only suite (fastapi stubbed, no network); I ran it locally: 7/7 pass, covering 503 unconfigured/blank secret, 401 missing/wrong/non-bearer token, and both accepted token channels.
  • .github/checks-manifest.yaml - the hume-ai-route-auth-tests entry is well-formed (same keys as the composio entry, no id collision, correct triggers). Note it has not actually executed in CI yet: Hygiene aborts on the preflight failure below before manifest checks run, so the local run above is the real validation so far.
  • plugins/hume-ai/README.md and .env.example - accurately describe the 401/503 behavior and both presentation channels. Tiny nit: the backticks around the Authorization: Bearer header in the README and module docstring are unbalanced and render oddly; feel free to fix in passing.

One thing blocking CI (not the code): the commit subject starts with fix:, so PR Metadata Preflight and Hygiene fail with missing_declaration - the PR body needs a Failure-Class: declaration line (accepted forms are listed in the check log: Failure-Class: FC-<slug>, Failure-Class: new, or Failure-Class: none). The Hygiene annotation about handle_audio_stream being 168 lines is advisory and pre-existing (that function is unchanged here), so nothing to do for it.

Heads-up for maintainers on rollout: this fails closed by design - once deployed, the service returns 503 on these routes until HUME_TOOLS_SECRET is provisioned, and any existing callers must start presenting the token. That deployment step needs maintainer sign-off 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 need human response.

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed real unauthenticated uid-keyed routes in hume-ai plugin, fix follows established shared-secret pattern from #14561/#14700/#14684, tests included. Approve only: PR Metadata Preflight is failing (missing required Failure-Class declaration in body for a fix: commit) -- author needs to add Failure-Class: none/new/FC-.

@aryanorastar aryanorastar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified on 6166615.

/audio, /save-emotion-memory, and /force-send-notification now take Depends(require_hume_tools_auth). Unconfigured secret is 503; missing/wrong token is 401 (hmac.compare_digest). Bearer and hume_tools_token both accepted. hume-ai-route-auth-tests is registered. Suite covers fail-closed and reject/accept.

Branch is CONFLICTING. Hygiene/preflight red are not the required merge gate. kodjima APPROVE is size-gate. I am not merging.

@harmonygemini8-collab

Copy link
Copy Markdown

Heads-up from the closed #15091 (later duplicate — first-vehicle rule, understood): the current branch carries three deploy-path items that the sibling reviews surfaced:

  1. the Failure-Class: declaration line the metadata preflight requires — CI stays red until it's in the PR body;
  2. the Dockerfile gap: the runner stage doesn't COPY hume_tools_auth.py, so the README-documented docker build path crashes at startup with ModuleNotFoundError (reference fix in fix(hume-ai): require shared-secret auth on uid-keyed routes #15091's 1a9befa);
  3. render.yaml has no HUME_TOOLS_SECRET entry — a blueprint deploy boots straight into 503s with no discoverable cause.

No rivalry intended — handing over what the sibling reviews caught so the landed fix deploys clean.

@Git-on-my-level

Copy link
Copy Markdown
Member

Follow-up verification on 6166615a — the guard itself re-checked clean, but two deploy-path issues are now confirmed on this head, and both are introduced by this change.

Re-verified, no new concerns:

  • plugins/hume-ai/hume_tools_auth.py — mirrors the merged plugins/basic/mentor_webhook_auth.py idiom exactly: fail-closed 503 on unset/blank HUME_TOOLS_SECRET, 401 on missing/wrong/non-bearer token, hmac.compare_digest for the compare.
  • plugins/hume-ai/main.py — delta vs main is only the Depends import, the guard import, and the decorators on the three advisory routes (/audio, /save-emotion-memory, /force-send-notification).
  • plugins/hume-ai/test_hume_tools_auth.py — 7/7 pass in a clean environment; genuinely stdlib-only.
  • .github/checks-manifest.yaml — hume-ai-route-auth-tests entry well-formed, no id collision among the 253 entries.

New, verified on the current head:

  1. Dockerfile breaks at startup. The runner stage (lines 20–23) copies main.py, app.py, emotion_config.json, and templates/, but not the new hume_tools_auth.py — while main.py:56 imports it at module scope. The README's "Option C" Docker path now crashes with ModuleNotFoundError on every container start. Fix is one line: COPY hume_tools_auth.py .
  2. render.yaml has no HUME_TOOLS_SECRET entry. A blueprint deploy provisions none of the guarded routes' secret, so it boots straight into fail-closed 503s with nothing in the config hinting why. Adding the sync: false entry alongside HUME_API_KEY makes the cause discoverable at deploy time.

Neither invalidates the approvals — the security fix is correct and closes an open unauthenticated-write advisory (#15089), so it shouldn't wait long. But the decision of whether these two deploy fixes land here or as an immediate follow-up before the fail-closed behavior is deployed needs maintainer sign-off, since both approvals predate these findings. Also still outstanding: the Failure-Class: declaration line in the PR body, without which PR Metadata Preflight stays red and the manifest checks (including this PR's own test entry) never run in CI.

🤖 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 need human response.

@aryanorastar

Copy link
Copy Markdown
Collaborator

Approval on 6166615ab7ae still stands for the guard itself — /audio, /save-emotion-memory, and /force-send-notification take Depends(require_hume_tools_auth), unset secret is 503, missing/wrong token is 401.

Not merging this SHA:

  • GitHub is CONFLICTING on .github/checks-manifest.yaml.
  • PR Metadata Preflight is red: the body has no Failure-Class: line (none / new / FC-…).
  • The runner Dockerfile copies main.py but not hume_tools_auth.py, so the documented Docker path dies at from hume_tools_auth import require_hume_tools_auth. One line: COPY hume_tools_auth.py . (closed fix(hume-ai): require shared-secret auth on uid-keyed routes #15091 already had it).
  • render.yaml still has no HUME_TOOLS_SECRET entry, so a blueprint deploy boots into fail-closed 503s with no config hint.

Rebase, add Failure-Class: none, and COPY the new module. I'll re-review that head. Not merging DIRTY.

@aryanorastar

Copy link
Copy Markdown
Collaborator

Hume POST /audio, /save-emotion-memory, and /force-send-notification on main take a query uid and no caller auth. This head fail-closes those three routes. 6166615ab7 conflicts and preflight failed, so this stays open and unapproved.

— Astar, on behalf of @aryanorastar

@harmonygemini8-collab

Copy link
Copy Markdown

Noting for the maintainers, since the review noted this advisory shouldn't wait long: this head hasn't moved since 6166615 (09-20), and the four items from the 09-21 review are all still open.

The closed #15091 branch already carries three of them — the Dockerfile COPY and render.yaml secret entry (1a9befa) and the Failure-Class: none declaration in its PR body — and plugins/hume-ai/** is unchanged on main since 09-20, so a rebase only needs to re-apply its manifest entry (verified against today's main: 259 ids, clean YAML).

If the author is unavailable, say the word and I'll reopen it with a rebased head within the hour. Otherwise happy to keep standing by — just don't want the unauthenticated-write window to stay open longer than it needs to.

@aryanorastar

Copy link
Copy Markdown
Collaborator

Keeping this open. Not approving 6166615ab7ae. origin/main plugins/hume-ai/main.py /audio, /save-emotion-memory, and /force-send-notification take uid with no shared secret. This sha adds require_hume_tools_auth (fail-closed when unset). DIRTY and Hygiene FAILURE, so not this sha. mergeable: CONFLICTING/DIRTY

— Astar, on behalf of @aryanorastar

@aryanorastar aryanorastar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On 6166615, plugins/hume-ai/main.py reset_stats raises HTTPException(status_code=500, detail=str(e)). Return a fixed detail.

@aryanorastar

Copy link
Copy Markdown
Collaborator

Shared-secret auth on the Hume uid routes is already on main from #15089 (d57fbc8770). This head restates that module. reset_stats still returns detail=str(e) here and on main, so there is no separate leftover. Closing it.

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Hey @glmbugbounty 👋

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:

  • Project standards — Ensuring consistency across the codebase
  • User needs — Making sure changes align with what our users need
  • Code best practices — Maintaining code quality and maintainability
  • Project direction — Keeping aligned with our product principles and locked invariants

Before your next PR, please skim:

  • PRODUCT.md — product north star
  • Product invariants — locked rules (shared chat, memory tiers, agent control plane, integrations, brand)

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!

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

Labels

python security-review Touches auth, provider routing, secrets, or security-sensitive surfaces

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bounty $150] security: hume-ai — unauthenticated uid-keyed routes write memories into any Omi account and push notifications to any user

5 participants