Repository navigation
feat(gitleaks): detect gohighlevel webhook capability urls - #36
Merged
Merged
Conversation
Gitleaks' default set has no detector for GoHighLevel inbound webhook URLs, and neither did the org ruleset, so the shape <host>.leadconnectorhq.com/hooks/<locationId>/webhook-trigger/<uuid> scanned green everywhere. A live client site served two of them in its production HTML and every secret-scan run on it passed. Possession of one of those URLs is authorisation: the receiving end verifies no signature and checks no origin, so whoever holds it can drive the workflow it fires against that sub-account. That makes it a credential, even though it carries no secret-looking name. The rule uses `keywords` so the regex is only evaluated against lines containing `webhook-trigger`, matches the registrable domain rather than the `services.` subdomain, and allows a 15-30 character location id, so a longer or differently-hosted capability URL still fires. Measured against a corpus of twelve lines on gitleaks 8.30.1 (the version this repo pins). The shared allowlist's UUID-as-a-value entry does not mask the rule; its truncated-placeholder entry does mask a capability URL written on a line ending in an ellipsis, which is left as is and documented in the file.
This was referenced Oct 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The org ruleset detects GoHighLevel Private Integration Tokens but had no
detector for GoHighLevel inbound webhook capability URLs, which are a
separate credential class:
A capability URL is a credential because possession is authorisation. The
receiving end verifies no signature and checks no origin or sender identity, so
anyone holding the URL can post to the workflow it fires and drive whatever that
workflow does — lead creation, SMS/email sends, pipeline moves — against that
sub-account. Nothing in it is named
secret,tokenorkey, which is exactlywhy it ends up in client-side code.
This is not hypothetical. A live client site serves two of them in its
production HTML today, and
secret-scanhas passed on every run of that repo,because no rule in the ruleset described the shape.
What changed
One new
[[rules]]block,gohighlevel-webhook-url, plus comments in thefile's existing style recording why it is shaped the way it is.
Shape choices, each measured rather than assumed:
keywords = ["webhook-trigger"]— the regex is only evaluated againstlines containing that literal, so the scan stays cheap, as with the PIT rule.
services., so acapability URL served from another
*.leadconnectorhq.comhost still fires.For a scanner a miss is the costly direction.
[A-Za-z0-9]{15,30}, not the exactly-20 characters bothreal-world URLs carry, so a longer agency- or company-scoped id still fires.
<and>are outside the class, so a documentation placeholder cannot match.\b, for the same reason as the PIT rule above it.Measurement
gitleaks 8.30.1 — the version this repo pins in both
.github/workflows/gitleaks.ymland.pre-commit-config.yaml. Run as CI runsit (
gitleaks git --redact) over a throwaway git repo holding a 12-case corpusat the repo root, so the allowlist's
tests//fixtures/path exclusions do notapply. Synthetic values below are made up and safe to publish; the two
real-world cases were taken verbatim from the live page and are not
reproduced here.
hooks/AbCdEfGh12345678IjKl/webhook-trigger/0f1e2d3c-4b5a-6978-8765-4321fedcba09gohighlevel-webhook-urlgohighlevel-webhook-urlgohighlevel-webhook-urlGHL_TOKEN=pit-0f1e2d3c-4b5a-6978-8765-4321fedcba09gohighlevel-pitonlyfetch('https://services.leadconnectorhq.com/')/hooks/<locationId>/webhook-trigger/<uuid>link.leadconnectorhq.com/widget/booking/abc123XYZ(also served by that page)webhook_uuid = "0f1e2d3c-…"...backend.leadconnectorhq.com/hooks/…/webhook-trigger/<uuid>gohighlevel-webhook-urlBaseline, same corpus against
origin/main's.gitleaks.toml:One finding — the PIT. All four capability URLs scan clean. That is the gap.
With this PR's config:
Does the existing
[allowlist]mask the new rule?Asked and isolated by re-running the same corpus with the two candidate
allowlist regexes deleted:
[=:]\s*["']?) does not mask it.** It requires the hex to sit immediately after=or:; in a capability URL the UUID is the final path segment, preceded by/`. Confirmed two ways: T02/T03fire with that entry in place, and T09 (a genuinely bare UUID value) stays
clean even with the entry removed, so the entry is simply not in this rule's
path.
\.\.\.\s*$) does mask it in one case.With both entries removed the corpus yields 6 findings instead of 5, the extra
one being T10 — a full URL on a line ending in an ellipsis.
regexTarget = "line"allowlists the whole line, so the ellipsis suppresses the finding.Left as is: the entry is doing the job it exists for, and narrowing it would
cost more coverage elsewhere than it buys here. Documented in the file, with
the instruction to write
/webhook-trigger/<uuid>in prose instead.Repo gates
Review notes
reusable workflow fetches
.gitleaks.tomlfrommainon every run, so everycalling repo picks the new rule up on its next scan with no PR anywhere else.
Auto-merge has deliberately not been enabled; this wants human review.
client-side code. That is the rule working. Rotating the URL in GoHighLevel is
the fix; allowlisting it is not.