Repository navigation
Conversation
…user data (fixes #13777)
There was a problem hiding this comment.
All reported issues were addressed across 12 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Git-on-my-level
left a comment
There was a problem hiding this comment.
Thanks for this cleanup — removing token/API-key/transcript prints across the plugin fleet is the right thing to do, and most of this checks out on the current head. Verified good, among others: the api_key dump in the Notion CRM OAuth callback (plugins/oauth/conversation_created.py), the OpenAI key-suffix print (plugins/notifications/hey_omi.py), the Slack user_token[:15] prefix log (plugins/omi-slack-app/slack_client.py), the Hive key prefix and REST header dumps (plugins/omi-hive-app/main.py), the raw response.text rendered into callback HTML (plugins/omi-notion-app/main.py, plugins/omi-google-calendar-app/main.py), and the Zapier target_url/response dumps.
Two issues block merge because they contradict the PR's own goal, plus one smaller regression:
-
ClickUp OAuth still leaks
client_secreton transport failure.plugins/omi-clickup-app/clickup_client.py:30-37sends the token exchange asparams=(URL query), and theexcept Exception:block re-raises the raw requests exception./auth/callbackthen renders it verbatim —Failed to complete authentication: {str(e)}atplugins/omi-clickup-app/main.py:633— so aConnectionError/Timeouton that call puts the full URL, includingclient_secretand the OAuthcode, into the error page and logs. Please send the credentials asdata=(the GitHub client inplugins/omi-github-app/github_client.py:36-41already does this correctly) and/or wrap the re-raised exception so no raw transport detail escapes. -
The final tweet text is still logged.
process_segmentsreturnsf"✅ Tweet posted: '{cleaned_content}'"(plugins/omi-twitter-app/main_simple.py:737), and the webhook prints that whole message (USER NOTIFICATION: {response_message}at line 662,Silent responseat 670). Sincecleaned_contentis AI-extracted from the user's speech, this reintroduces exactly the transcript logging the PR removes elsewhere. Logging the status plustweet_id(already printed at line 736) is enough. -
Non-blocking: several handlers now swallow all diagnostic signal.
hey_omi.py:166logsHTTP errorforTimeout/ConnectionError(misleading — there is no HTTP status), andplugins/zapier/client.py+ the ClickUp/GitHub token-exchange handlers collapse every failure to a fixed string.type(e).__name__carries no secrets and keeps failures diagnosable — same philosophy asbackend/utils/log_sanitizer(mask, don't blind). Happy to see this addressed in the same pass or a follow-up.
Once 1 and 2 are fixed this is a solid hygiene improvement. Given the PR touches OAuth credential handling in plugin callbacks, I'd like a maintainer sign-off on those paths before merge.
by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.
|
Updated commit
Base Treasury Payout: |
…oad rather than URL query
|
@Git-on-my-level Thank you for the detailed and constructive review! All points have been fully resolved across commits
Ready for maintainer sign-off and merge. Base Mainnet treasury payout address: |
Both concerns raised in this review are verified resolved on the current head (03e2344): the ClickUp token exchange now sends credentials as POST data with transport errors wrapped in a sanitized RuntimeError, and the Twitter webhook no longer logs tweet or transcript content.
Git-on-my-level
left a comment
There was a problem hiding this comment.
Both blocking issues from the earlier review are verified fixed on 03e2344, along with the diagnostic-signal follow-ups:
- ClickUp OAuth (
plugins/omi-clickup-app/clickup_client.py:30-54): the token exchange now POSTsclient_id/client_secret/codeas form data — ClickUp documents these as body params, and this keeps the secret out of URLs, access logs, and exception strings. Transport failures are re-raised as a sanitizedRuntimeError("Token exchange request failed"), so the{str(e)}rendered by the callback error page atplugins/omi-clickup-app/main.py:633can no longer carry request details. - Twitter transcript logging (
plugins/omi-twitter-app/main_simple.py): all speech-content prints are gone (Received: '{full_text}',Segment 1 content,Full accumulated,AI extracted tweet), the success path returns✅ Tweet posted (ID: {tweet_id})only (line 738), and the webhook notification condition (line 661) matches the new format. - Diagnostics (
plugins/notifications/hey_omi.py:166-170,plugins/zapier/client.py): non-HTTP failures now logtype(e).__name__, HTTP failures log the status code — failures stay diagnosable without payload dumps.
Spot-checked the rest of the fleet on the head: the Notion access_token/api_key dumps in plugins/oauth/client.py and plugins/oauth/conversation_created.py, the Slack user_token[:15] print, the Hive key/headers/body dumps, the GitHub client's token-response exception text, and the Notion/Google Calendar callback HTML that embedded raw response.text are all removed. All 12 files compile.
Two pre-existing leaks adjacent to (but outside) this PR's hunks, fine as follow-ups: plugins/omi-google-calendar-app/main.py:158-159 still logs and returns response.text from calendar_api_request, and plugins/omi-clickup-app/clickup_client.py:357-361 logs response.text on task-create failures.
Thanks for iterating on this — it's a real hygiene win for deployment logs. Given it changes credential-handling behavior in OAuth plugin callbacks (the ClickUp exchange now uses a POST body), leaving security sign-off to a human maintainer before merge.
by AI on behalf of David — if you need David's attention urgently, please @Git-on-my-level and escalate with need human response.
|
Hi @Git-on-my-level and @BasedHardware team, just following up on this PR! All review items from cubic-dev-ai are resolved and verified in commits Autonomous Contributor Base Payout Address: |
|
Hi maintainers! Just checking in on this PR. All CI checks and tests are passing cleanly. Please let me know if any further tweaks or adjustments are needed—happy to update anytime! — Evos09 |
aryanorastar
left a comment
There was a problem hiding this comment.
Verified on 03e23449d1fa.
Log redaction spans 12 plugin files (hey_omi.py, oauth clients, clickup/github/gcal/hive/notion/slack/twitter/zapier) with no test that a token/secret is actually stripped.
That is too wide to land without a hermetic suite, and the head is CONFLICTING. Add tests for the redaction helper, or shrink to one sink. I am not merging.
…ack error page (#14352) ## What The Twitter voice-posting plugin's OAuth callback error page (`plugins/omi-twitter-app/main_simple.py`, `GET /auth/callback`) now percent-encodes and HTML-escapes the `state` query param before building its "Try again" link, instead of reflecting the raw value into an `href` attribute. Fixes #14350. ## Why Any token-exchange failure renders the error page, and its link was `f'<a href="/auth?uid={error_uid}">'` with `error_uid = state`, where `state` is `Query(None)` straight from the request. On current `main`: ``` GET /auth/callback?code=x&state=%22%3E%3Cscript%3Ealert(1)%3C/script%3E -> <p><a href="/auth?uid="><script>alert(1)</script>">Try again</a></p> ``` The quote closes the attribute and the script executes on the plugin's origin (reflected XSS). The branch is reachable without any session: a `state` with no stored OAuth handler makes `get_access_token()` raise `OAuth session not found`, which is the path that renders the page. A benign `&` or `#` in `state` corrupted the retry query the same way. The value is now encoded at both boundaries it crosses — `urllib.parse.quote(value, safe="")` for the query, `html.escape(..., quote=True)` for the attribute — so the link still carries the original value (it round-trips through `parse_qs`) but can no longer break out of the `href`. ## Changes - `plugins/omi-twitter-app/main_simple.py`: import `html` and `urllib.parse.quote`; the callback error page interpolates `html.escape(quote(state, safe=""), quote=True)`. - Second commit (leave it better, same file): the setup page at `GET /?uid=` built its "Connect Twitter Account" link as `f"/auth?uid={uid}"` inside an `href` — the same raw reflection. Encoded the same way. omi-twitter-app is not among the six apps the pattern-wide PR #13658 covers; no overlap with that diff. Open PR #13782 also edits `main_simple.py`, but only its logging lines (hunks at `main` lines 222-231, 638-649, 665-671 and 697-752); this branch touches the import block, `root()` (`main_simple.py:29-35`) and the `auth_callback` error branch (`:523-536`), so the two do not overlap textually either. - `plugins/omi-twitter-app/test_callback_error_escaping.py` (new): hermetic regression test — stubs FastAPI, dotenv and the sibling modules, drives the real `auth_callback` handler down its error branch and the real `root` handler, parses the page with `html.parser` the way a browser would and pins that no `<script>` element opens, the `href` is percent-encoded, `&`/`#` cannot corrupt the query, and the uid round-trips; plain and missing `state` keep their links unchanged. - `.github/checks-manifest.yaml`: registers `twitter-app-callback-error-escaping-tests` (local + ci lanes, triggered by `plugins/omi-twitter-app/**`). ## Tests ``` PYTHONUTF8=1 python3 plugins/omi-twitter-app/test_callback_error_escaping.py PASS test_script_in_state_is_not_reflected_raw PASS test_try_again_link_round_trips_state PASS test_plain_state_link_is_unchanged PASS test_missing_state_falls_back_to_unknown PASS test_setup_page_encodes_uid_in_connect_link 5 tests passed ``` Same test against `main`'s `main_simple.py` fails as intended (control cases pass): ``` FAIL test_script_in_state_is_not_reflected_raw: ... <a href="/auth?uid="><script>alert(1)</script>">Try again</a> ... FAIL test_try_again_link_round_trips_state: ('"><script>alert(1)</script>', '/auth?uid=') PASS test_plain_state_link_is_unchanged PASS test_missing_state_falls_back_to_unknown FAIL test_setup_page_encodes_uid_in_connect_link: ['/auth?uid='] ``` Also run: `python3 plugins/oauth/test_client_log_safety.py` (OK, 5 tests), `git diff --check main..fix/twitter-app-callback-xss` (clean), `bash scripts/pr-preflight --pr-body-file <this body>` (passed). The live path (a real Twitter OAuth round trip on a deployed instance with client credentials) needs a Railway deployment and X app keys I do not have; the handlers were exercised through the hermetic harness above, which calls the real functions with only FastAPI and the network-bound siblings stubbed. ## Failure-Class Failure-Class: none (`scripts/failure-class prepare` validates the declaration (`OK: prepare`, patch operation=none) and none of the 253 registry definitions describes client input reflected unescaped into HTML; the advisory candidates it surfaced for this path — nonexecuting-verification-command, runtime-image-boundary, secret-printed-to-plugin-logs — do not apply.) ## Invariants `scripts/pr-preflight --suggest` reports no affected product invariants for this diff (plugin-only change). ## Bounty Claims the US$25 proposed in #14350; payout details will be sent to [email protected] after merge as the Contribution guide asks. <sub>Authored with Claude Code on behalf of @Suyann; every command listed was actually run on this branch.</sub> <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/14352?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. -->
|
Closing this pull request. The production change is already on main, and this head adds no extra production file. |
|
Hey @Evos09 👋 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! |
Summary
Resolves #13777.
This PR audits and sanitizes sensitive logging across plugins to prevent OAuth access tokens, API keys, webhook URLs, and user speech transcripts from leaking into deployment logs:
plugins/oauth/client.py&conversation_created.py:resp.json()dumps containing Notionaccess_tokenand database response bodies.print({'uid': uid, 'api_key': access_token, ...})in OAuth callback.create_notion_rowlogging to output only HTTP status codes.plugins/omi-notion-app/main.pyandplugins/omi-google-calendar-app/main.pyto prevent rawresponse.textfrom being rendered in callback HTML or logs.plugins/omi-clickup-app/clickup_client.pyandplugins/omi-github-app/github_client.pyto remove OAuth response dumps and prevent rawresponse.textfrom being placed into exception messages.plugins/omi-hive-app/main.py:REST Headersand response body dumps.plugins/omi-slack-app/slack_client.py:user_token[:15]) and OAuth response keys printing.plugins/omi-twitter-app/main_simple.py:plugins/zapier/client.py&conversation_created.py:target_urlsubscriber logging and full conversation dumps.RequestExceptionerror formatting so webhook URLs are not embedded in error messages.plugins/notifications/hey_omi.py:Testing
python -m py_compileacross all 12 modified plugin files (all passed with 0 errors).plugins/test_db_transcript_segments.py,plugins/test_mentor_session_auth.py): 8/8 passed.Base Mainnet Payout Treasury:
0x7badCdA295Dd7113f374aEA1008e7d5870D48556