[codex] Sanitize Bitbucket API failures#3430
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
8e96105 to
8995244
Compare
Co-authored-by: codex <codex@users.noreply.github.com>
8995244 to
d0debd7
Compare
ApprovabilityVerdict: Needs human review This PR modifies security-sensitive error handling to prevent credential leakage in Bitbucket API error messages. While the change appears to be a security improvement, modifications affecting how sensitive data is handled in error paths warrant human verification. You can customize Macroscope's approvability policy. Learn more. |
Summary
Verification
Note
Low Risk
Narrow change to error formatting in the Bitbucket client; reduces credential leakage risk with a small behavioral change for anyone relying on body text in error detail.
Overview
Bitbucket HTTP error handling no longer surfaces raw response bodies in
BitbucketApiErrormessages ordetail, so API error payloads (which may contain secrets) are not leaked into logs or UI.responseErrornow sets a genericdetail(Bitbucket returned HTTP <status>.) and optionalresponseBodyLengthinstead of appending the body text.BitbucketApiErrorgains that structured field. When reading the error body fails, the failure is a dedicatedBitbucketApiErrorwith a stable detail string and the read error oncause, replacing the previous silent empty-body fallback.New tests assert secrets stay out of
messagefor both a 403 body and a failing response stream.Reviewed by Cursor Bugbot for commit d0debd7. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Sanitize Bitbucket API error responses to exclude response body content from diagnostics
responseErrorin BitbucketApi.ts no longer includes the raw response body inBitbucketApiError.detail; instead it logs a generic"Bitbucket returned HTTP <status>."message and recordsresponseBodyLength."Failed to read the Bitbucket error response body."as the detail with the underlying cause attached, rather than silently falling back to an empty string.Macroscope summarized d0debd7.