Skip to content

fix(security): warn on non-RevenueCat API host; protect Authorization from RC_HEADERS - #153

Merged
joshdholtz merged 1 commit into
mainfrom
dx-sec-credential-hardening
Aug 27, 2026
Merged

fix(security): warn on non-RevenueCat API host; protect Authorization from RC_HEADERS#153
joshdholtz merged 1 commit into
mainfrom
dx-sec-credential-hardening

Conversation

@joshdholtz

@joshdholtz joshdholtz commented Aug 26, 2026

Copy link
Copy Markdown
Member

One safety net: RC_HEADERS can no longer override Authorization, so a stray or hostile header can't swap out your RevenueCat credential. Other headers still work.

(The RC_BASE_URL half moved to #160, which locks endpoint overrides to dev builds.)


Note

Low Risk
Narrow security hardening in shared HTTP header application; only behavior change is blocking Authorization overrides from RC_HEADERS.

Overview
RC_HEADERS can still add or override most custom headers on RevenueCat API traffic, but Authorization is now ignored when those headers are merged onto outgoing requests.

httpx.Apply skips any Authorization entry (case-insensitive) from parsed RC_HEADERS, so a misconfigured or hostile header line cannot replace the CLI’s stored API key or OAuth credential. Other headers continue to override defaults as before. README documents the exception, and the apply test now expects the preset bearer token to survive when RC_HEADERS includes Authorization.

Reviewed by Cursor Bugbot for commit a8bbf01. Bugbot is set up for automated code reviews on this repo. Configure here.

Copilot AI lite review requested due to automatic review settings August 26, 2026 17:54
@joshdholtz

Copy link
Copy Markdown
Member Author

bugbot run

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit c599641. Configure here.

@joshdholtz joshdholtz closed this Aug 26, 2026
@joshdholtz
joshdholtz force-pushed the dx-sec-credential-hardening branch from c599641 to 2148eb4 Compare August 26, 2026 18:21
@joshdholtz

Copy link
Copy Markdown
Member Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 2148eb4. Configure here.

@joshdholtz joshdholtz reopened this Aug 26, 2026
@joshdholtz
joshdholtz requested a review from alfondotnet August 26, 2026 23:52
A stray or hostile RC_HEADERS entry could otherwise swap out the CLI's
credential. Other header overrides still work.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@joshdholtz
joshdholtz force-pushed the dx-sec-credential-hardening branch from 34a0be2 to a8bbf01 Compare August 27, 2026 12:25
@joshdholtz

Copy link
Copy Markdown
Member Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit a8bbf01. Configure here.

@joshdholtz
joshdholtz merged commit edb40b1 into main Aug 27, 2026
6 checks passed
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