Skip to content

fix: stop plugins printing OAuth tokens, API keys, webhook URLs, and transcripts to logs - #13778

Merged
kodjima33 merged 6 commits into
BasedHardware:mainfrom
ajanraj:fix/plugin-oauth-log-secrets
Sep 15, 2026
Merged

kodjima33 merged 6 commits into
BasedHardware:mainfrom
ajanraj:fix/plugin-oauth-log-secrets

Conversation

@ajanraj

@ajanraj ajanraj commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #13777

Summary

Plugin code prints credentials and user data to stdout, and plugin stdout lands in broadly visible deployment logs.

  • OAuth token endpoints: the Notion token-exchange handler printed the raw response body on every connect (plugins/oauth/client.py, plugins/oauth/conversation_created.py); that body contains the user's fresh access_token. Token-exchange/refresh failure paths in ClickUp, GitHub, Notion, Whoop, Google Calendar, and Twitter embedded raw response.text in exceptions and log lines; several are rendered into the OAuth callback HTML returned to the user's browser.
  • Stored credentials: conversation_created.py printed the stored Notion access_token alongside uid; Slack logged user-token prefixes; Hive logged an API-key prefix on one line and the full api_key inside a headers dict a few lines later.
  • Webhook bearer URLs: plugins/zapier printed target_url on subscribe/unsubscribe, dumped Conversation models via print(ok)/print(result), and RequestException str(e) embedded the full hook URL in returned error dicts.
  • Transcript PII: the Twitter, Slack, and ClickUp webhook handlers printed raw transcript segments and accumulated text; the same text re-leaked through simple_storage.update_session, which printed all update kwargs; hey_omi logged the full webhook payload, question text, OpenAI prompts/answers, the OpenAI key suffix, and exception strings whose URLs carry ?uid=...&message=<user text>.
  • Error dicts: whoop, google-calendar, notion-app, clickup, hive, and github copied response.text into returned {"error": ...} dicts that callers print or render. composio, omi_notifications, claude_coder, chatgpt, and manual-import had the same response-body/str(e) leaks.

Fix

Remove secret-bearing prints and sanitize error paths to status codes, presence booleans (received/missing), extracted provider message fields (e.g. GitHub's message), and exception type names. Composed outgoing messages (tweets, Slack messages) remain logged because that content is posted to the destination anyway. No functional behavior changes.

Guard

New hermetic check plugin-oauth-client-log-safety-tests (registered in .github/checks-manifest.yaml):

  • Behavioral: stubs requests, drives the Notion token-exchange/database success paths, asserts token and response content never reach stdout, asserts error path logs status only. Three of these assertions fail on the pre-fix code.
  • Static tripwire: scans every plugins/**/*.py file for log calls naming credential variables, response bodies, webhook URLs, transcript buffers, or str(e) (request exception strings embed URLs). Manifest trigger covers plugins/**/*.py, so any plugin change re-runs it. It caught four additional real leaks during development.

New failure class FC-secret-printed-to-plugin-logs definition included.

Verification

  • python3 plugins/oauth/test_client_log_safety.py: 5 tests pass (3 fail pre-fix); tripwire scans clean across the whole plugin tree
  • python3 plugins/omi-slack-app/test_slack_search.py / test_segments.py: 13 pass
  • python3 plugins/omi-notion-app/test_main.py: 19 pass
  • python3 plugins/notifications/test_hey_omi_extraction.py: pass
  • python3 -m py_compile on all touched files
  • make preflight + scripts/failure-class validate: clean
  • plugins/omi-github-app/test_github_client.py not run locally: requests not installed in this env (pre-existing; test stubs requests post-import, runs in CI)

Failure-Class: new

…n logs

OAuth success paths dumped raw provider responses to stdout. The Notion
token-exchange body contains the user's fresh access_token; ClickUp
logged its full OAuth response; Slack/Hive/Twitter logged token prefixes
and the Notion conversation handler printed the stored access token as
api_key. Deployed plugin logs are broadly visible, so these secrets were
recoverable from log output.

Remove the secret-bearing prints entirely; keep status-only diagnostics
(HTTP status, token received/missing, token type). Add a hermetic
regression test asserting token-exchange and database responses never
reach stdout.

Verified: python3 plugins/oauth/test_client_log_safety.py (4 tests,
3 fail pre-fix), py_compile on all touched files, slack manifest tests
(13 pass).

Failure-Class: new
Same defect class across the OAuth surface the first commit missed:
- omi-hive-app: full api_key printed via REST headers dict, plus GraphQL
  response bodies and user data dumps in verify_api_key
- token-exchange failure paths (clickup, github, notion-app, whoop,
  google-calendar, twitter refresh): raw response.text moved into
  exceptions and log lines, then rendered into callback HTML; now
  status-code only
- zapier: print({'uid', target_url}) leaked the bearer webhook URL on
  subscribe/unsubscribe; print(ok)/print(result) dumped conversation
  models; RequestException str(e) embedded the hook URL in the error dict
- hey_omi: OpenAI key suffix print; notification message text and
  exception str(e) (URL carries uid+message params) in logs
- omi-twitter-app: transcript segment text, accumulated buffer, and
  extracted content prints trimmed to counts/status
- _multion: request payload, API response, and error-body prints removed
- oauth error paths: print status only, not the raw error body

Extend the log-safety test into a static tripwire scanning every touched
plugin file for log calls naming credential variables, response bodies,
webhook URLs, or transcript buffers; add FC-secret-printed-to-plugin-logs.

Verified: python3 plugins/oauth/test_client_log_safety.py (5 tests).

Failure-Class: FC-secret-printed-to-plugin-logs
Same class as the oauth cleanup: raw transcript segments, accumulated
text, and extracted trigger content printed verbatim. Trim to counts
and presence booleans; composed outgoing messages still logged (they
are posted to the destination anyway). Extend the static tripwire to
cover both files.

Verified: python3 plugins/oauth/test_client_log_safety.py (5 tests).

Failure-Class: FC-secret-printed-to-plugin-logs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Critical provider-response and transcript/PII logging paths remain unresolved, along with gaps in the safety checks.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

This PR reduces credential, webhook, provider-response, and transcript data exposure in plugin logs, with added regression checks and failure-class metadata.

Changes:

  • Removes direct secret and transcript logging.
  • Sanitizes OAuth and HTTP error handling.
  • Adds safety tests, CI registration, and a failure-class definition.
File summaries
File Review summary
plugins/zapier/conversation_created.py Removes webhook and conversation-model logging.
plugins/zapier/client.py Critical (1 vote): The HTTPError path still builds and prints errors from resp.text(); the same issue appears on line 259.
plugins/omi-whoop-app/main.py Critical (3 votes): whoop_api_request still logs and returns response.text on API errors.
plugins/omi-twitter-app/twitter_client.py Removes token-prefix logging.
plugins/omi-twitter-app/main_simple.py Critical (1 vote): accumulated_text reaches storage that prints update kwargs. Moderate (1 vote): auth_callback still interpolates str(e) into failure HTML.
plugins/omi-slack-app/slack_client.py Removes Slack token-prefix logging.
plugins/omi-slack-app/main.py Critical (1 vote): Transcript text still reaches storage diagnostics. Moderate (1 vote): The timeout path logs message[:50].
plugins/omi-notion-app/main.py Sanitizes OAuth callback errors.
plugins/omi-hive-app/main.py Critical (3 votes): Provider response text still enters returned errors and is printed by API-key verification and REST-helper paths.
plugins/omi-google-calendar-app/main.py Critical (3 votes): Calendar API errors still log and return response.text.
plugins/omi-github-app/github_client.py Critical (2 votes): Several error paths still log raw provider bodies through error_msg.
plugins/omi-clickup-app/main.py Critical (1 vote): Transcript text still reaches storage diagnostics through update_session.
plugins/omi-clickup-app/clickup_client.py Critical (2 votes): create_task still prints an error built from response.text.
plugins/oauth/test_client_log_safety.py Moderate (1 vote): The hard-coded scan list can omit future plugin files. Moderate (3 votes): The tripwire misses logging wrappers, indirect values, and response text propagated through returned dictionaries.
plugins/oauth/conversation_created.py Removes stored-token and response logging.
plugins/oauth/client.py Critical (1 vote): Returned errors still copy provider messages, and conversation_created.py prints them on error paths; the issue also appears on line 153.
plugins/notifications/hey_omi.py Critical (2 votes): The plugin still logs request data, transcript segments, collected question text, and OpenAI prompt/response content.
plugins/_multion/router.py Sanitizes Multion API error logging.
.github/failure-classes/FC-secret-printed-to-plugin-logs.json Defines the new secret-logging failure class.
.github/checks-manifest.yaml Registers the log-safety check.
Review details

Suppressed comments (5)

plugins/oauth/client.py:153

  • The client now logs only the status, but the returned error still copies the provider's message from resp_json; plugins/oauth/conversation_created.py prints that error dict on the callback path. The new test captures the client in isolation, so the real callback can still emit provider response content; sanitize the returned/logged error consistently.
            print(f"Error: HTTP_{resp.status_code}")

plugins/oauth/test_client_log_safety.py:127

  • The manifest selects this check for every plugins/omi-*/** change, but SCAN_FILES is a hard-coded list of only the files touched by this PR. A future plugin file can therefore trigger the check without being scanned, allowing a new secret-bearing log to pass; derive the scan set from the plugin tree or scan all plugin files.
    SCAN_FILES = [
        "plugins/oauth/client.py",
        "plugins/oauth/conversation_created.py",
        "plugins/omi-clickup-app/clickup_client.py",

plugins/omi-slack-app/main.py:749

  • The webhook's direct segment logs are removed, but the timeout-monitor branch still logs message[:50] when the message is not sent at line 116. That value is extracted from the accumulated transcript and is precisely unsent user content; keep this path status-only too.
        print(f"   Content extracted: {'yes' if message_content else 'no'}", flush=True)

plugins/omi-twitter-app/main_simple.py:229

  • These success logs no longer expose token prefixes, but auth_callback still interpolates str(e) into its failure HTML at line 532. fetch_token errors can carry the OAuth provider response, so a failed exchange still exposes response data to the browser; return a fixed error and log only the exception type.
        access_status = 'received' if access_token else 'missing'
        refresh_status = 'received' if refresh_token else 'missing'
        print(f"🔑 Token data received:", flush=True)
        print(f"   Access token: {access_status}", flush=True)
        print(f"   Refresh token: {refresh_status}", flush=True)

plugins/zapier/client.py:259

  • The changed RequestException branch is status-safe, but the HTTPError branch above still builds its error from resp.text() and then prints err. That leaves provider response content in logs (and Response.text is a property, not a callable); sanitize this branch too.
                    "message": f"RequestException {type(e).__name__}",
  • Files reviewed: 20/20 changed files
  • Comments generated: 12
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

params = {"uid": uid, "message": message}

logger.info(f"Sending notification to OMI for uid {uid}: {message}")
logger.info(f"Sending notification to OMI for uid {uid}")
Comment thread plugins/oauth/client.py
if resp.status_code != 200:
resp_json = resp.json()
print(f"Error: HTTP_{resp.status_code} {resp_json}")
print(f"Error: HTTP_{resp.status_code}")
}
else:
raise Exception(f"Token exchange failed: {response.status_code} - {response.text}")
raise Exception(f"Token exchange failed: {response.status_code}")

print(f"📝 Segment {segments_count}/5: '{full_text}'", flush=True)
print(f"📚 Full accumulated: '{accumulated[:150]}...'", flush=True)
print(f"📝 Segment {segments_count}/5 received", flush=True)
raise Exception("No access token in token exchange response")
else:
raise Exception(f"Token exchange failed: {response.status_code} - {response.text}")
raise Exception(f"Token exchange failed: {response.status_code}")

print(f"📝 Segment {segments_count}/5: '{full_text}'", flush=True)
print(f"📚 Full accumulated: '{accumulated[:150]}...'", flush=True)
print(f"📝 Segment {segments_count}/5 received", flush=True)

print(f"📝 Segment {segments_count}/3: '{full_text}'", flush=True)
print(f"📚 Full accumulated: '{accumulated[:150]}...'", flush=True)
print(f"📝 Segment {segments_count}/3 received", flush=True)
return response.json()
else:
log(f"Token refresh failed: {response.status_code} - {response.text}")
log(f"Token refresh failed: {response.status_code}")
Comment thread plugins/zapier/client.py
err = {
"error": {
"message": f"RequestException {e}",
"message": f"RequestException {type(e).__name__}",
Comment thread plugins/oauth/test_client_log_safety.py Outdated
]

def test_no_log_call_emits_secrets_or_response_bodies(self):
log_line = re.compile(r"(?:print|logger\.(?:info|warning|error|debug))\((.*)")

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found across 20 files

Confidence score: 5/5

  • In plugins/zapier/conversation_created.py, removing print(result) leaves result = ok["result"] unused; clean up the dead assignment to avoid unnecessary code.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="plugins/zapier/conversation_created.py">

<violation number="1" location="plugins/zapier/conversation_created.py:244">
P3: Removing `print(result)` makes the `result = ok["result"]` assignment dead code. Delete that line too, since nothing reads `result` anymore.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread plugins/oauth/test_client_log_safety.py Resolved
Comment thread plugins/omi-notion-app/main.py Resolved
Comment thread .github/checks-manifest.yaml Resolved
raise HTTPException(status_code=err["status"] if "status" in err else 500, detail='Can not create memory')
return
result = ok["result"]
print(result)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: Removing print(result) makes the result = ok["result"] assignment dead code. Delete that line too, since nothing reads result anymore.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At plugins/zapier/conversation_created.py, line 244:

<comment>Removing `print(result)` makes the `result = ok["result"]` assignment dead code. Delete that line too, since nothing reads `result` anymore.</comment>

<file context>
@@ -92,7 +92,6 @@ async def subscribe_zapier_trigger(subscriber: ZapierSubcribeModel, uid: str):
     if status != "enabled":
         raise HTTPException(status_code=401, detail="Unauthorized")
 
-    print({'uid': uid, 'target_url': subscriber.target_url})
     store_zapier_subscribes(uid, subscriber.target_url)
     return {}
 
@@ -114,7 +113,6 @@ async def unsubscribe_zapier_trigger(subscriber: ZapierSubcribeModel, uid: str):
     if status != "enabled":
</file context>

@Git-on-my-level Git-on-my-level left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @ajanraj - this is a genuinely valuable security cleanup, and the direction is right: every changed line strictly reduces what reaches plugin stdout. I ran python3 plugins/oauth/test_client_log_safety.py from the repo root and it passes 5/5, and the hermetic stdout-capture pattern on the Notion token-exchange path is a nice piece of work. The changes requested below are about completeness of the sweep and the new guard's coverage, not the approach.

What's solid, file by file:

  • plugins/oauth/client.py - success-path print(resp.json()) gone at all three sites; token-exchange bodies no longer reach stdout.
  • plugins/oauth/conversation_created.py - removing the {'uid', 'api_key', 'database_id'} print is the single most important line in this PR.
  • plugins/notifications/hey_omi.py - OpenAI key-suffix print and exception strings carrying ?uid=...&message= are gone.
  • plugins/_multion/router.py - good catch that RequestError str(e) embeds the full URL; type-name-only logging is the right call.
  • plugins/zapier/conversation_created.py - target_url (bearer-capable webhook URLs) prints removed on subscribe/unsubscribe.
  • plugins/omi-slack-app/slack_client.py, plugins/omi-twitter-app/twitter_client.py, plugins/omi-twitter-app/main_simple.py - token-prefix logging replaced with type/presence booleans; the webhook transcript-segment dumps are gone from the three segment-collector apps.

Three things I'd like addressed before merge, all verified on the current head:

  1. The new tripwire passes green while its own contract is violated. test_client_log_safety.py's regex only sees print(/logger.<level>( on the opening line, but whoop, google-calendar, and notion-app log through a module-local def log() helper. Inside files already in SCAN_FILES, with response.text already in BANNED_TOKENS:

    • plugins/omi-whoop-app/main.py:150 - log(f"Whoop API error: {response.status_code} - {response.text}")
    • plugins/omi-google-calendar-app/main.py:158 - log(f"Calendar API error: {response.status_code} - {response.text}")
    • plugins/omi-notion-app/main.py:1115-1117 - log(f"OAuth error: {e}") plus traceback.print_exc()
      Parsing each file with ast and scanning the full span of every log call would also close the multi-line gap (plugins/zapier/conversation_created.py:178 already has a multi-line print().
  2. Check scope vs trigger scope. The manifest trigger covers plugins/omi-*/** (~30 plugin dirs) but SCAN_FILES scans 17 files. A future change to any of the other ~22 plugins - including omi-dropbox-app, which your own scope note says still prints user content - selects and passes this check without being scanned. Please derive the scan set from the plugin tree (my preference) or narrow the triggers to match the list.

  3. The sweep is incomplete in this PR's own touched files:

    • plugins/omi-hive-app/main.py:100,168,173 - response.text still returned in error dicts and printed downstream via the GraphQL error path.
    • plugins/omi-github-app/github_client.py:192-196,331-335 - error_msg = response.json().get("message", response.text) printed and returned.
    • plugins/omi-clickup-app/clickup_client.py:354 - create_task still builds its error from response.text.
    • plugins/zapier/client.py:182,237 - the HTTPError branch still builds errors from resp.text() and then print(err) fires; note Response.text is a property, so resp.text() raises when this branch actually executes.
    • plugins/oauth/client.py:122,158,186 + plugins/oauth/conversation_created.py:54,72 - returned error dicts still copy resp_json["message"], which the callback path re-prints.
    • plugins/notifications/hey_omi.py:173 - logger.info(f"Received data: {request.dict()}") logs the full incoming webhook payload (transcripts); also 214/233/274/290 (text, question_part, full_question) and 144/292 (OpenAI responses). These are incoming transcripts, not the composed outgoing messages your carve-out covers, and transcripts are in the PR title.
    • plugins/omi-twitter-app/main_simple.py:532 - str(e) still rendered into the failure HTML; fetch_token errors can carry the provider response.
    • plugins/omi-slack-app/main.py:116 - message[:50] of unsent transcript content on the insufficient-content path.

Items 1 and 2 matter most: landing the failure-class contract and manifest entry on top of a checker with these blind spots would give future PRs a green light that doesn't mean anything, which is worse than no check. Either sweep the lines above the same way you did their siblings, or narrow the PR's claims to match what's actually enforced.

The core work here is real and welcome - fixing the guard and finishing the sweep should make this an easy merge. Since it changes credential-logging behavior across OAuth flows in a dozen plugins and installs a repo-wide check, it needs maintainer sign-off before merge even after these are addressed.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@Git-on-my-level Git-on-my-level added security-review Touches auth, provider routing, secrets, or security-sensitive surfaces python labels Sep 14, 2026
Second ring found by adversarial review of the first commits:

- simple_storage (twitter/slack/clickup): update_session printed kwargs,
  which carried accumulated_text — transcript content leaked through the
  storage layer; log only the updated keys
- hey_omi: question text, OpenAI prompts/answers, full webhook payload,
  and buffer contents were logged on every request; keep flow markers
  and lengths only
- API error paths (whoop, google-calendar, notion-app, clickup, hive,
  github): response.text copied into returned error dicts and logs;
  return status codes / extracted provider message fields only
- composio omi_api, omi_notifications, claude_coder, chatgpt,
  manual-import: same-class response-body and str(e) leaks (request
  exception strings embed request URLs carrying uid/message params)

The static tripwire now scans every plugins/**/*.py file (not just the
files this PR touched) for log calls naming credential variables,
response bodies, webhook URLs, transcript buffers, or str(e), and the
manifest trigger covers plugins/**/*.py so any plugin change re-runs it.

Verified: python3 plugins/oauth/test_client_log_safety.py (5 tests —
tripwire scans clean repo-wide), slack/notion/hey_omi suites pass.

Failure-Class: FC-secret-printed-to-plugin-logs
@ajanraj

ajanraj commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the review — the residual leaks were real. Second sweep now covers:

  • simple_storage.py (all three apps): update_session printed kwargs including accumulated_text — now logs only the updated keys. This was the worst miss: transcript text leaking through the storage layer after the handler prints were trimmed.
  • hey_omi.py: question text, OpenAI prompt/answer, full webhook payload, and buffer contents all sanitized to flow markers + lengths.
  • Error dicts: response.text removed from returned {"error"} payloads and logs across whoop, google-calendar, notion-app, clickup, hive, github (extracted message field kept where the provider supplies one — e.g. GitHub's structured error message).
  • composio/omi_api, omi_notifications, claude_coder, chatgpt, manual-import: same-class response.text/str(e) leaks closed.

The tripwire now scans all of plugins/**/*.py (not a hard-coded file list) and bans str(e) in log calls, since request exception strings embed URLs. Repo-wide scan is clean; 5/5 tests pass; preflight green.

@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.

Security fix (stop plugins logging OAuth tokens/credentials/transcripts) — right direction and broadest sweep of the two duplicate PRs for #13777, includes regression test + failure-class + CI guard. Approve only, not merging: independent reviews (cubic 3/5, Git-on-my-level) found multiple still-unresolved critical leaks (whoop/google-calendar/notion/hive/github/clickup response.text, hey_omi transcript logging, twitter auth_callback str(e)) plus blind spots in the new test's tripwire (multiline logs, log() wrapper). Below the 4/5 confidence bar; needs another pass before merge.

- zapier HTTPError branches built errors from resp.text() — a property,
  so the branch would raise TypeError when reached; now returns
  HTTP_<status>
- notion-app OAuth error path logged the exception and dumped
  traceback; HTML now returns a generic message
- twitter/slack auth callback failure pages rendered str(e) to the
  user's browser; now a generic message
- oauth error-path print(err) emitted the provider message dict on the
  callback path; prints status only
- shipbob and twitter-chat-tools had the same token-endpoint
  response.text logs the tripwire now catches
- tripwire rewritten on ast: covers module-local log() helpers and
  multi-line call spans, scanning all of plugins/**/*.py

Verified: python3 plugins/oauth/test_client_log_safety.py (5 tests,
repo-wide AST scan clean).

Failure-Class: FC-secret-printed-to-plugin-logs
@ajan-raj

Copy link
Copy Markdown

@Git-on-my-level all three items addressed:

  1. Tripwire rewritten on ast — covers module-local log() helpers and multi-line call spans via get_source_segment, scanning all of plugins/**/*.py. It immediately caught six response.text sites the line-regex had missed (shipbob :136/:174/:410, twitter-chat-tools :136/:170/:1135) — all now fixed.

  2. Trigger scope matches scan scope — manifest trigger is plugins/**/*.py; the scan is the full plugin tree, currently zero hits.

  3. Sweep completed on the listed sites:

    • zapier/client.py HTTPError branch — note it called resp.text() (a property), so that branch would have raised TypeError when reached; now returns HTTP_<status>
    • notion-app OAuth error path — log(f"...{e}"), traceback.print_exc(), and str(e) in the 500 HTML all removed
    • twitter/slack auth callback failure pages — generic message instead of str(e)
    • oauth/conversation_created.py print(err) sites — status only
    • hive error dicts, slack message[:50], and the remaining whoop/gcal response.text returns — status only
    • Provider-extracted message fields (github's .get("message"), notion's error dict) kept — structured error info the plugin surfaces to its own caller, not raw bodies

Kept intentionally: composed outgoing messages (posted to the destination anyway), uid identifiers, and the ~160 generic {e} exception logs elsewhere in the tree — those are non-request exceptions (JSON parse, date format, Redis fallback) that don't embed URLs; a policy sweep of generic exception logging is a separate PR if you want it.

Verified: python3 plugins/oauth/test_client_log_safety.py 5/5 (AST scan clean repo-wide), slack/notion/hey_omi suites green, make preflight clean.

…fication prints

- clickup token exchange: params= -> data= so client_secret/code stay out of
  the URL; transport errors re-raise as type name only (matches github_client)
- clickup/slack/twitter webhook handlers: response_message no longer printed
  (carries AI-extracted speech); status/length logged instead
- twitter_client.post_tweet: drop traceback.print_exc and str(e) returns
- clickup client: sanitize remaining {e} prints and traceback dumps
- tripwire: ban response_message/cleaned_content in log calls

Failure-Class: FC-secret-printed-to-plugin-logs
@ajan-raj

Copy link
Copy Markdown

Cross-checked the review on the parallel PR for this issue and closed the same two residuals on this head:

  • ClickUp client_secret in URL: the token exchange sent client_secret/code via params=, so a transport error put the full URL into the raised exception and the callback HTML. Now sends credentials as data= (same as github_client.py), and RequestExceptions re-raise as type name only.
  • Transcript-derived notification prints: USER NOTIFICATION/Silent response in the clickup/slack/twitter webhook handlers printed response_message, which carries AI-extracted speech. Now status/length only; the user-facing payload is unchanged.

Also sanitized the remaining {e}/traceback.print_exc()/str(e) paths in the touched ClickUp and Twitter clients, and added response_message/cleaned_content to the static tripwire's banned tokens.

@Git-on-my-level Git-on-my-level added the positive-signal Automation verified a genuine fix/quality contribution label Sep 15, 2026
@Git-on-my-level
Git-on-my-level dismissed their stale review September 15, 2026 04:52

Dismissing this automated changes-requested review: all three concerns (AST-blind tripwire, scan-vs-trigger scope mismatch, and the named residual response.text/str(e) leak sites in whoop/gcal/notion/hive/github/clickup/zapier/twitter/slack/hey_omi) are verified resolved on head ab06d02 — the rewritten AST tripwire passes 5/5 with zero hits tree-wide and each cited line was re-checked against the head files.

@Git-on-my-level

Copy link
Copy Markdown
Member

Follow-up verification on ab06d02 — all three items from the earlier review are confirmed resolved, checked against the tree at this head:

  1. Tripwire: plugins/oauth/test_client_log_safety.py is now AST-based (ast.get_source_segment over full call spans), recognizes module-local log() wrappers, and scans every plugins/**/*.py; the .github/checks-manifest.yaml trigger covers plugins/**/*.py, so trigger scope matches scan scope. I ran it from the repo root: 5/5 pass, zero hits tree-wide.
  2. Sweep of the cited sites: whoop/google-calendar/notion-app log lines are status-only; hive error dicts and the GitHub error_msg paths are status-or-extracted-message; zapier's HTTPError branch now returns HTTP_<status> (also fixing the latent resp.text() property-call crash on that path); twitter/slack callback failure pages are generic; slack's message[:50] unsent-content print is gone; hey_omi.py now logs lengths, counts, and exception type names only. Stored-credential prints (the uid+api_key dict in oauth/conversation_created.py, Slack/Hive token prefixes) are gone.
  3. The hermetic stdout-capture tests still pass and the failure-class/manifest entries are consistent with what's actually enforced now.

Three additive notes, none blocking:

  • plugins/omi-clickup-app/clickup_client.py changes the token exchange from params= to data=, moving client_secret out of the URL query string. That matches ClickUp's documented request-body contract and is the right call, but it is a wire-format change on an OAuth flow — the PR body's "No functional behavior changes" should be amended, and the exchange deserves one live verification in staging before this ships.
  • Returned error dicts still carry raw response.text in plugins/omi-shipbob-app/main.py (make_shipbob_request, plus the setup.html error render in the callback) and plugins/omi-twitter-chat-tools-app/main.py (twitter_api_request, callback HTML). These surface to the initiating user's own browser or tool response rather than to shared logs, so they don't violate the failure-class contract — but whoop/google-calendar/notion-app got the plain HTTP <status> treatment, and a small follow-up would make this uniform.
  • The tripwire's str(e) token doesn't catch f-string {e} interpolation, which is the same leak path. Most of the ~160 {e} sites are benign non-request exceptions, but requests exception strings do embed the full URL; worth adding {e} to BANNED_TOKENS in a follow-up with the same benign-exception triage this PR applied.

Thanks @ajanraj — rewriting the checker on AST after its blind spots were pointed out, then sweeping the six sites it immediately caught, is exactly the right loop. This removes a real credential-exposure class from the plugin fleet. Since it rewrites credential-adjacent logging across a dozen OAuth flows, final merge sign-off on this head belongs to a human maintainer; the items above are non-blocking follow-ups.


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.

Legitimate security-hardening fix, not an abuse signal: removes prints/logs of OAuth token-exchange bodies, stored access tokens, API key fragments, webhook bearer URLs, and raw transcript text across ~30 plugin files — no new credential handling added, no auth checks weakened, doesn't touch backend/auth/. Adds a hermetic stdout-capture test plus a static tripwire scanning plugins/**/*.py for credential-bearing log calls, registered in checks-manifest.yaml. fixes #13777, CI green. Large diff (528 lines/31 files) but mechanical/systematic in nature.

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

Labels

positive-signal Automation verified a genuine fix/quality contribution 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.

Plugins print OAuth tokens, API keys, webhook URLs, and transcript text to stdout logs (US$200 bounty proposal)

5 participants