GLM-5.3 Flash · Balanced
github-oauth-security-enhancement-sentry
Sentry · Python · M · 100–299 lines · 2 files
The normal review, with one generalist agent. Judge: Claude Opus 5.5.
- Gold bugs found
- 3 of 7
- Comments published
- 4
- Comments matching a bug
- 3
- Comments not matching
- 1
- Cost of this PR
- $0.072
Published comments (4)
KeyError on missing metadata["sender"] in GitHub install check — Integrations built by the install pipeline never get a sender, so the whole install flow turns into a 500; installation.py already treats the key as optional. Switch to `integration.metadata.get("sender", {}).get("login")` so a missing sender lands on the error page.
Token exchange omits redirect_uri sent in authorize request — GitHub requires the token-step redirect_uri to match the authorize-step value, so real installations can fail at the exchange while tests pass because the endpoint is mocked in `_stub_github`. Add the same `absolute_uri` value the authorize leg builds to `data`.
CSRF state uses predictable pipeline signature instead of per-flow nonce — Because `pipeline.signature` is a deterministic md5 of class names, identical for every flow and derivable from source, this gate verifies nothing — any caller can supply the constant. Generate a random nonce, bind it with `pipeline.bind_state`, and compare against `pipeline.fetch_state`, as identity/oauth2.py does.
Unwrapped get_user_info call raises unhandled exception on GitHub API errors — A rate limit or transient 5xx makes `get_user_info` raise through `resp.raise_for_status()`, showing a 500 in the install dialog, unlike the guarded token exchange just above. Wrap it in try/except and return `error(request, self.active_organization)`.