Claude Sonnet 5.5 · Balanced
github-oauth-security-enhancement-sentry
Sentry · Python · M · 100–299 lines · 2 files
The normal review, with one generalist agent. Judge: Claude Haiku 5.5.
- Gold bugs found
- 0 of 1
- Comments published
- 4
- Comments matching a bug
- 0
- Comments not matching
- 4
- Cost of this PR
- $0.497
Published comments (4)
OAuth `state` is the constant `pipeline.signature`, giving no CSRF protection — Because `pipeline.signature` is identical for every user and session, an attacker can send a victim a setup URL with the attacker's own `code`, binding the attacker's login and defeating the new user-match check. Generate a random per-flow nonce, store it in the pipeline state, and compare against it instead of `pipeline.signature`.
KeyError when integration metadata lacks sender login — Existing integrations without `sender` metadata raise `KeyError` on `integration.metadata["sender"]["login"]`, returning a 500 instead of the error page. Use `.get("sender", {}).get("login")` and return `error(...)` when it is missing.
Installer verification skipped when no Integration row exists yet — When no `Integration` row exists yet, `pipeline.next_step()` runs without the user-match check, so racing the installation webhook bypasses verification. Fail closed in the `Integration.DoesNotExist` branch, or verify the installer through the GitHub API.
Network errors in GitHub OAuth token exchange and user lookup cause unhandled 500 — `safe_urlopen` and `get_user_info` run outside the try/except, so network errors, timeouts or `ApiError` from GitHub surface as an unhandled 500 mid-pipeline. Wrap both calls and return `error(request, self.active_organization)` on failure.
Gold bugs found (0)
None.