Repository navigation
fix: don't leak raw exception text from omi-clickup-app's HTTP handlers - #15360
Merged
kodjima33 merged 1 commit intoSep 21, 2026
Merged
Conversation
/update-list, /update-timezone, /refresh-lists and /logout each returned
{"success": False, "error": str(e)} on any unhandled exception, putting
the raw exception message straight into the HTTP response. This file
already logs type(e).__name__ only in several other handlers
(get_workspaces, get_lists, oauth callback, webhook signature checks);
these four were the exceptions to that convention, not a deliberate
choice. Now they log the real exception server-side and return a fixed,
generic message, matching the rest of the file.
Left the /webhook JSON-parse HTTPException and the plain server-log-only
str(e) prints in simple_storage.py/clickup_client.py untouched -- those
are either the caller's own malformed input surfaced back to itself, or
local log lines with no response boundary, and touching them would
widen this diff for no safety gain.
Tested: new test_error_messages_dont_leak.py drives all four handlers
through a failing dependency and asserts the response contains neither
the exception text nor its detail; registered in checks-manifest.yaml
and confirmed discovered via
`python3 .github/scripts/run_checks.py --check-id clickup-app-error-messages-dont-leak-tests --lane local`.
Full plugins/omi-clickup-app suite: 46/46 passing. Full local preflight
lane: 17/17 checks passing.
Failure-Class: FC-secret-printed-to-plugin-logs
This was referenced Sep 21, 2026
Merged
kodjima33
approved these changes
Sep 21, 2026
kodjima33
left a comment
Collaborator
There was a problem hiding this comment.
Genuine, well-scoped fix: generic error messages for the 4 clickup-app HTTP handlers that were leaking raw exception text, with server-side type(e).name logging, new regression tests, and a registered check. CI green. Matches issue #15361.
This was referenced Sep 21, 2026
This was referenced Sep 21, 2026
aryanorastar
added a commit
that referenced
this pull request
Sep 22, 2026
…chat tool responses (#15484) ## Summary `plugins/omi-shopify-app` returned raw exception text to its callers. The shared `shopify_api_request` helper answered any `requests` failure with `f"Request failed: {str(e)}"`, and all six chat-tool handlers answered any unhandled exception with `f"...: {str(e)}"`. ## Impact Whatever internal detail the exception carried — provider/socket errors, filesystem paths, connection details — was reflected back into the chat-tool response the OMI backend hands to the model/client. Same failure class as the recent ClickUp app (#15361 / #15360), Slack app (#15471 / #15469), Whoop app (#15477 / #15476) and GitHub app (#13912) hardening. ## Fix - `shopify_api_request`: logs `❌ Shopify API request failed: {e}` server-side and returns `{"error": "Shopify API request failed"}`. - `tool_get_analytics`, `tool_get_orders`, `tool_get_order_details`, `tool_create_order` (outer handler and the token-auth block), `tool_get_customers`, `tool_create_customer`: log the exception detail server-side and answer with a fixed, non-reflective message. No behavior changes other than the error text; success paths are untouched. ## Tests `plugins/omi-shopify-app/test_error_handling.py` (new, stdlib-only: `main.py` is loaded against stub `fastapi`/`requests`/`db`/`models` modules and the real handlers are driven against raising seams). It asserts a sentinel trace (`/srv/app/.secrets/shopify_token_store.json`, the exception class name, `Traceback`) never reaches a response for the API helper and each of the six tool endpoints, and pins that no `str(e)`/`str(exc)` response interpolation remains in `main.py`. Registered as `shopify-error-handling-tests` in `.github/checks-manifest.yaml`. ## Verification ``` python3 plugins/omi-shopify-app/test_error_handling.py # 8 passed python3 plugins/omi-shopify-app/test_limit_inputs.py # ok python3 plugins/omi-shopify-app/test_create_order_disambiguation.py # ok python3 plugins/omi-shopify-app/test_create_order_pagination.py # ok python3 plugins/omi-shopify-app/test_oauth_callback_auth.py # ok ``` Against `origin/main` `main.py` the new suite fails 8/8 (each response contains the sentinel trace). Failure-Class: none <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/15484?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. -->
Contributor
Author
|
Following up on payment for this one — merged 2026-09-21. I've emailed [email protected] with the full list of my merged bounty PRs, as the contribution guide asks under Paid Bounties ("claiming payment"). Leaving a note here too so it's on the thread rather than only in a mailbox. Bounty: $35 — proposal #15361. Payout — crypto is easiest for me, USDC/USDT on either chain:
Happy to use whatever method is simplest on your side. Thanks! |
This was referenced Oct 21, 2026
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.
Description
/update-list,/update-timezone,/refresh-listsand/logoutinplugins/omi-clickup-app/main.pyeach returned{"success": False, "error": str(e)}on any unhandled exception -- the raw exception message went straight into the HTTP response body. This file already establishes a safe convention elsewhere (get_workspaces,get_lists, the OAuth callback and the webhook signature check all logtype(e).__name__only); these four handlers were the exceptions to that convention, not a deliberate choice.The fix
All four now log the real exception server-side (
type(e).__name__) and return a fixed, generic message instead:/update-list→"Failed to update default list."/update-timezone→"Failed to update timezone."/refresh-lists→"Failed to refresh lists from ClickUp."/logout→"Failed to log out."Left two things deliberately untouched, to keep the diff scoped to the actual leak:
/webhook'sHTTPException(..., detail=f"Invalid JSON payload: {str(e)}")-- this reflects the caller's own malformed input back to itself, not an internal detail.str(e)prints already insimple_storage.py/clickup_client.py-- local server-log lines with no response boundary, same reasoning that kept the hive-app fix (fix(hive-app): search_tasks scans every project, not just the 50 most recent workspace actions #15297) scoped.Testing performed
test_error_messages_dont_leak.py: drives all four handlers through a failing dependency (storage or ClickUp client raising with a sensitive-looking message) and asserts the response is the fixed generic string, containing neither the exception text nor any fragment of it..github/checks-manifest.yaml(clickup-app-error-messages-dont-leak-tests) and confirmed it's actually discovered:python3 .github/scripts/run_checks.py --check-id clickup-app-error-messages-dont-leak-tests --lane local.python3 -m unittest discover -s plugins/omi-clickup-app -p "test_*.py"-- 46/46 passing.python3 .github/scripts/run_checks.py --lane local --base origin/main-- 17/17 selected checks passing.origin/maincopy ofmain.pyalready failsscripts/backend-python-format --check(pre-existing repo debt), so per the precedent set on fix(hive-app): search_tasks scans every project, not just the 50 most recent workspace actions #15297 this PR does not run the formatter across the whole file -- only the touched lines were hand-matched to the file's existing style. Diff is+8/-4inmain.py.Type of Change
Product invariants affected
none
Failure class (fixes)
Failure-Class: FC-secret-printed-to-plugin-logs
Same contract as #15297's
hive_*fix: an internal exception string reaching a user-visible surface. There the leak was a chat-tool response; here it's an HTTP JSON response, but it's the same "never letstr(e)reach the caller" rule this class already covers.Fixes #15361