Skip to content

fix(facebookoauth): verify app creds against /{app-id} instead of /me#5013

Open
lukem-ts wants to merge 1 commit into
mainfrom
fix/facebookoauth-verifier-endpoint
Open

fix(facebookoauth): verify app creds against /{app-id} instead of /me#5013
lukem-ts wants to merge 1 commit into
mainfrom
fix/facebookoauth-verifier-endpoint

Conversation

@lukem-ts
Copy link
Copy Markdown

@lukem-ts lukem-ts commented Jun 3, 2026

Description:

The verifier built a valid app access token ({app-id}|{app-secret}) but queried the /me node, which only accepts user/page tokens. Facebook rejects an app token there with HTTP 400 OAuthException code 2500 ("An active access token must be used to query information about the current user."), so the check returned 400 for every App ID/Secret pair — valid or not — and could never mark a result verified.

Query the documented validation endpoint instead: GET /{app-id}?fields=roles with the app token. Valid credentials return 200; invalid pairs return 400 OAuthException 190. Status handling now distinguishes verified (200), unverified (400/401), and indeterminate (other statuses -> verification error).

image

Checklist:

  • Tests passing (make test-community)?
  • Lint passing (make lint this requires golangci-lint)?

Note

Low Risk
Detector-only change to outbound Facebook Graph validation; no TruffleHog auth or data-path changes, though verified leaks may now correctly flag live app credentials.

Overview
Fixes Facebook App ID/secret verification so valid pairs can actually be marked verified. Verification no longer calls Graph /me with an app access token ({app-id}|{app-secret}), which only accepts user/page tokens and always failed with HTTP 400.

It now uses GET /{app-id}?fields=roles with the same app token. 200 marks credentials verified; 400/401 mark them unverified; other statuses surface a verification error. On success, optional ExtraData includes app role count and user:role pairs parsed from the response.

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

@lukem-ts lukem-ts requested a review from a team June 3, 2026 02:04
@lukem-ts lukem-ts requested a review from a team as a code owner June 3, 2026 02:04
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

Corpora Test Results

No detector regex or keyword changes in this PR. Bench skipped.

Comment on lines +68 to +69
if verificationErr != nil {
s1.SetVerificationError(verificationErr, apiSecretRes)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

no need for this if here. SetVerificationError only adds error if it exists

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