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

Microsoft Teams webhook false verification #2693

Open
atkinchris opened this issue Apr 10, 2024 · 0 comments
Open

Microsoft Teams webhook false verification #2693

atkinchris opened this issue Apr 10, 2024 · 0 comments
Labels

Comments

@atkinchris
Copy link
Contributor

TruffleHog Version

$ trufflehog --version
trufflehog 3.72.0

Bug also present in enterprise version.

Expected Behavior

The revoked Microsoft Teams webhook should not have been shown as verified.

Actual Behavior

The revoked Microsoft Teams webhook was shown as verified.

Steps to Reproduce

  1. Create a Microsoft Teams webhook, and put the webhook URL in a file.
  2. Scan the file with TruffleHog. Observe a (correctly) verified result.
  3. Delete the webhook through Microsoft Teams.
  4. Scan the file with TruffleHog. Observe an erroneous verified result.

Additional Context

The test in TruffleHog's detector sends an empty message to the webhook, and declares the result verified if Microsoft respond saying that text is required. However, this response is the same for both valid and revoked webhook URLs.

if strings.Contains(string(body), "Text is required") {
return true, nil
}

I suspect Microsoft's payload validation is now happening before the webhook destination is validated. Sending a request with a message (even an empty string) to a revoked webhook, correctly returns a 404 error with the below text.

Webhook message delivery failed with error: Microsoft Teams endpoint returned HTTP error 404

However, sending a non-empty message to a Microsoft Teams webhook is a mutative action. If the webhook is valid, a message will be produced on the channel.

@atkinchris atkinchris added the bug label Apr 10, 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