DeepSeek V4 Pro · Heavy
github-oauth-security-enhancement-sentry
Sentry · Python · M · 100–299 lines · 2 files
The generalist plus 9 specialist lens agents in parallel, then the same verify and dedup steps. Judge: Claude Opus 5.5.
- Gold bugs found
- 4 of 7
- Comments published
- 5
- Comments matching a bug
- 4
- Comments not matching
- 1
- Cost of this PR
- $1.086
Published comments (5)
GitHub OAuth state uses constant signature instead of per-session CSRF token — A constant signature means the state check can be precomputed and reused by an attacker, defeating the CSRF protection it is meant to provide. Generate a per-request random token with `secrets.token_hex()` and validate it via `pipeline.fetch_state("state")` as `OAuth2LoginView`/`OAuth2CallbackView` do.
GitHub OAuth token exchange missing redirect_uri — Omitting `redirect_uri` from the token exchange causes GitHub to reject it with `error=redirect_uri_mismatch`, so every installation fails with a generic error page. Include the same `redirect_uri` used in the authorize URL, plus `grant_type`.
Unhandled GitHub OAuth callback network exceptions return 500 — A transient network or HTTP failure in `safe_urlopen` or `get_user_info` escapes as an unhandled 500 instead of the intended error page. Wrap both calls in the try block and return `error(request, self.active_organization)`.
test_installation_not_found uses invalid state and does not test missing installation — The hardcoded `state` is rejected by `OAuthLoginView` before `GitHubInstallation.dispatch` runs, so this test no longer covers its namesake scenario. Use the valid pipeline signature and assert the actual missing-installation outcome, or rename the test to match what it checks.
KeyError when GitHub integration metadata lacks sender key — Integrations without a `sender` key exist, as `installation.py:44` guards against them; accessing it directly raises `KeyError` and returns a 500. Use `integration.metadata.get("sender", {}).get("login")` or guard the missing case.