Skip to content

Stop exposing exception details in HTTP responses#5903

Merged
bjester merged 1 commit into
hotfixesfrom
no_exceptions!
May 13, 2026
Merged

Stop exposing exception details in HTTP responses#5903
bjester merged 1 commit into
hotfixesfrom
no_exceptions!

Conversation

@rtibbles
Copy link
Copy Markdown
Member

Summary

Replaces str(exception) in HTTP error responses with generic messages and switches the corresponding logger.error calls to logger.exception so the traceback is still captured by Sentry. Addresses three CodeQL "Information exposure through an exception" findings flagged on PR #5902:

  • views/subscription.py:84 (Stripe checkout session)
  • views/subscription.py:110 (Stripe customer portal session)
  • viewsets/channel.py:472 (channel IntegrityError on create)

References

Reviewer guidance

  • Frontend (useSubscription.js) only checks error truthiness, so the generic responses don't change user-facing UX.

AI usage

Used Claude Code to identify the three CodeQL findings, apply the fixes, and verify the frontend doesn't depend on the exception text in the response body.

Addresses CodeQL "Information exposure through an exception" findings in
views/subscription.py and viewsets/channel.py. Logs the traceback server
side via logger.exception so Sentry still captures it.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@rtibbles rtibbles marked this pull request as ready for review May 13, 2026 20:18
Copy link
Copy Markdown
Member

@marcellamaki marcellamaki left a comment

Choose a reason for hiding this comment

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

This seems to match the recommendation from the CodeQL checks on the release PR

Copy link
Copy Markdown
Member

@bjester bjester left a comment

Choose a reason for hiding this comment

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

LGTM

@bjester bjester merged commit d39e5ca into hotfixes May 13, 2026
24 checks passed
@rtibbles rtibbles deleted the no_exceptions! branch May 13, 2026 20:44
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.

3 participants