Skip to content

fix: skip verification for partner onboarding requests in TurnstileMi…#695

Merged
onahprosper merged 1 commit intostablefrom
fix/skip-turnstile-for-partner-onboarding
Feb 19, 2026
Merged

fix: skip verification for partner onboarding requests in TurnstileMi…#695
onahprosper merged 1 commit intostablefrom
fix/skip-turnstile-for-partner-onboarding

Conversation

@SarahSync
Copy link
Collaborator

…ddleware

Added a condition to the TurnstileMiddleware to bypass token verification for requests that include a partner ID in the header, allowing for smoother onboarding processes.

Description

Describe the purpose of this PR along with any background information and the impacts of the proposed change. For the benefit of the community, please do not assume prior context.

Provide details that support your chosen implementation, including: breaking changes, alternatives considered, changes to the API, contracts etc.

References

Include any links supporting this change such as a:

If there are no references, simply delete this section.

Testing

Describe how this can be tested by reviewers. Be specific about anything not tested and reasons why. If this project has unit and/or integration testing, tests should be added for new functionality and existing tests should complete without errors.

Please include any manual steps for testing end-to-end or functionality not covered by unit/integration tests.

Also include details of the environment this PR was developed in (language/platform/browser version).

  • This change adds test coverage for new/changed/fixed functionality

Checklist

  • I have added documentation and tests for new/changed functionality in this PR
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used, if not main

By submitting a PR, I agree to Paycrest's Contributor Code of Conduct and Contribution Guide.

…ddleware

Added a condition to the TurnstileMiddleware to bypass token verification for requests that include a partner ID in the header, allowing for smoother onboarding processes.
@onahprosper onahprosper merged commit 83a6b7b into stable Feb 19, 2026
2 checks passed
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

This is the final PR Bugbot will review for you during this billing cycle

Your free Bugbot reviews will reset on February 26

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

if c.GetHeader("X-Partner-Id") != "" {
c.Next()
return
}
Copy link

Choose a reason for hiding this comment

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

Unvalidated header bypasses bot protection entirely

High Severity

The bypass checks only that X-Partner-Id is non-empty — the value is never validated against a known list of legitimate partner IDs, a database, a config allowlist, or any cryptographic proof. Any bot or attacker can include X-Partner-Id: anything in a request to completely skip Cloudflare Turnstile on both the auth/register and auth/login endpoints, enabling brute-force login attacks and mass automated account creation.

Fix in Cursor Fix in Web

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.

2 participants

Comments