Repository navigation
fix(slack-app): prevent internal exception text from leaking into HTTP responses - #15469
Merged
kodjima33 merged 1 commit intoSep 21, 2026
Merged
Conversation
…P responses - Hide raw str(e) from OAuth initialization HTTPException detail - Replace raw exception text in /update-channel, /refresh-channels, and /logout with generic stable client messages - Sanitize /webhook JSON parsing HTTPException detail - Return generic 'Internal server error' on unexpected failures across send_message, search_messages, and search_channels tool endpoints - Catch WebClient initialization exceptions in SlackClient methods without leaking raw traceback details - Add hermetic stdlib-only unit test suite test_error_handling.py and register in .github/checks-manifest.yaml Failure-Class: none
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.
Well-scoped fix: replaces raw exception string leakage with generic client-facing messages while preserving server-side logging, across all 8 endpoints named in issue #15471. Comprehensive hermetic test suite added. Confidence 5/5.
This was referenced Sep 21, 2026
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. -->
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.
Summary
Remediates sensitive exception leakage across HTTP response boundaries in
plugins/omi-slack-app:/auth): Internal exceptions during OAuth initialization now raiseHTTPException(status_code=500, detail="OAuth initialization failed")instead of reflecting rawstr(e)details to the client./update-channel,/refresh-channels, and/logoutmap unexpected internal exceptions to stable, user-facing error messages while maintaining server-side error logging./webhook): Malformed JSON parsing errors return cleanHTTPException(status_code=400, detail="Invalid JSON payload")./api/send_message,/api/search_messages,/api/search_channels): Unhandled exceptions now return generic{"error": "Internal server error"}at HTTP 500 rather than leaking raw exception strings.send_message,get_channel_history, andsearch_messages, ensuring connection/credential exceptions do not escape unhandled.test_error_handling.pycovering all 8 endpoints/methods with sensitive trace injection assertions, registered in.github/checks-manifest.yaml.Verification
python plugins/omi-slack-app/test_error_handling.py: 9/9 passing.test_channel_resolution.py,test_segments.py,test_slack_search.py,test_settings_page.py,test_error_handling.py).test_run_checks.pypassing (53 tests passed, 0 failures).Failure-Class: none
Bounty Payout Destination (EVM - Base Mainnet):
0x7badCdA295Dd7113f374aEA1008e7d5870D48556