Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub detector silently ignores rate-limit, reports valid tokens as unverified #3658

Open
rgmz opened this issue Nov 22, 2024 · 0 comments
Open
Labels

Comments

@rgmz
Copy link
Contributor

rgmz commented Nov 22, 2024

The GitHub detector does not have any status code checks and minimal error handling. Consequently, important responses like rate limit errors are silently skipped.

if res.StatusCode >= 200 && res.StatusCode < 300 {

This is exacerbated by the fact that:

  1. the V1 detector seems to incorrectly match uppercase characters
  2. The detectors do not implement entropy checks to filter obvious false-positives
  3. matches are not cached and instead indiscriminately re-tested, causing an excessive amount of outgoing requests.

IMO, any detector that contains if err == nil is defective.

Example

This required custom code in order to surface.

Found unverified result 🐷🔑❓
Verification issue: unexpected response: 403, '{
  "documentation_url": "https://docs.github.com/free-pro-team@latest/rest/overview/rate-limits-for-the-rest-api#about-secondary-rate-limits",
  "message": "You have exceeded a secondary rate limit. Please wait a few minutes before you try again. If you reach out to GitHub Support for help, please include the request ID FB58:28A6E9:8CC7F:110648:673FC6EF."
}'
Detector Type: Github
Decoder Type: BASE64
Raw result: 6DA9C48BA71FBD34DBD8E460B7CE81EE238CA410
Rotation_guide: https://howtorotate.com/docs/tutorials/github/
Version: 1
...

This is likely related to the issue @ankushgoel27 noted in Slack.
image
https://trufflehog-community.slack.com/archives/CK3UYAQF2/p1731731489015699

@rgmz rgmz added the bug label Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant