Skip to content

fix: don't leak raw exception text from omi-clickup-app's HTTP handlers - #15360

Merged
kodjima33 merged 1 commit into
BasedHardware:mainfrom
Abhist17:fix/clickup-app-exception-leak
Sep 21, 2026
Merged

kodjima33 merged 1 commit into
BasedHardware:mainfrom
Abhist17:fix/clickup-app-exception-leak

Conversation

@Abhist17

@Abhist17 Abhist17 commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Description

/update-list, /update-timezone, /refresh-lists and /logout in plugins/omi-clickup-app/main.py each 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 log type(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:

Testing performed

  • New 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.
  • Registered in .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.
  • Full suite for this app: 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.
  • Formatter: the untouched origin/main copy of main.py already fails scripts/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/-4 in main.py.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

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 let str(e) reach the caller" rule this class already covers.

Fixes #15361

/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

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

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.

@kodjima33
kodjima33 merged commit 2e65ff2 into BasedHardware:main Sep 21, 2026
41 of 42 checks passed
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. -->
@Abhist17

Copy link
Copy Markdown
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.
cc @kodjima33 @josancamon19

Payout — crypto is easiest for me, USDC/USDT on either chain:

  • EVM (Ethereum / Base / Polygon / Arbitrum): 0x49A441f63f00b1978Aa4DD4ff52C237a4A7FdF82
  • Solana: FQetSNNrMouXQ1W3hzCunkd3V5kyvvBtKxQZ2mWfksxV

Happy to use whatever method is simplest on your side. Thanks!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bounty proposal] fix(clickup-app): exception text leaks into HTTP responses on 4 endpoints ($35 proposed)

2 participants