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

Sendgrid verification is not working with rotated keys #3708

Open
andy778 opened this issue Dec 2, 2024 · 3 comments
Open

Sendgrid verification is not working with rotated keys #3708

andy778 opened this issue Dec 2, 2024 · 3 comments
Assignees
Labels

Comments

@andy778
Copy link

andy778 commented Dec 2, 2024

TruffleHog Version

3.84.1

Expected Behavior

Sendgrid seems not to remove keys when they get invalidated but rather they are removed all rights so one can't send e-mail on them. Think the test need to be redone to try to send mail as the documentation on sendgrid suggests

Actual Behavior

It says the key is valid, so it's kind of false positive

Steps to Reproduce

References

https://www.twilio.com/docs/sendgrid/ui/account-and-settings/api-keys#testing-an-api-key

@andy778 andy778 added the bug label Dec 2, 2024
@kashifkhan0771
Copy link
Contributor

I conducted some tests using different types of API keys with the API currently used in the detector. I generated an API key with the least access privileges, specifically a billing key. The API worked fine with this key.

I didn’t observe any expiry time on their API keys, and even after deleting the key, the API continued returning 200 OK for a short period (consistent with what you reported). However, after a few minutes, the API began returning 401 Unauthorized, as expected. It seems their system takes a few minutes to recognize that an API key has been deleted or removed, after which it correctly returns 401.

I guess the reason for using this API endpoint /scopes was that it works for all type of tokens regardless of the access.

@kashifkhan0771 kashifkhan0771 self-assigned this Dec 23, 2024
@andy778
Copy link
Author

andy778 commented Dec 25, 2024

I have a couple of keys that have been in this state for soon half year.

@kashifkhan0771
Copy link
Contributor

Are those keys deleted? If yes, can you try to make a call to the scopes API using those API Keys in Postman or any other tool you like. If it works and return 200, than that is something to worry about.

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

2 participants