Skip to content

feat(gitleaks): detect gohighlevel webhook capability urls - #36

Merged
CameronBrooks11 merged 1 commit into
mainfrom
feat/ghl-webhook-url-rule
Oct 17, 2026
Merged

CameronBrooks11 merged 1 commit into
mainfrom
feat/ghl-webhook-url-rule

Conversation

@CameronBrooks11

Copy link
Copy Markdown
Contributor

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:

<host>.leadconnectorhq.com/hooks/<locationId>/webhook-trigger/<uuid>

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, token or key, which is exactly
why 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-scan has 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 the
file'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 against
    lines containing that literal, so the scan stays cheap, as with the PIT rule.
  • Host matched at the registrable domain, not pinned to services., so a
    capability URL served from another *.leadconnectorhq.com host still fires.
    For a scanner a miss is the costly direction.
  • Location id [A-Za-z0-9]{15,30}, not the exactly-20 characters both
    real-world URLs carry, so a longer agency- or company-scoped id still fires.
    < and > are outside the class, so a documentation placeholder cannot match.
  • No trailing \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.yml and .pre-commit-config.yaml. Run as CI runs
it (gitleaks git --redact) over a throwaway git repo holding a 12-case corpus
at the repo root, so the allowlist's tests//fixtures/ path exclusions do not
apply. 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.

# Case Expected Result
T01 synthetic real-shaped URL, hooks/AbCdEfGh12345678IjKl/webhook-trigger/0f1e2d3c-4b5a-6978-8765-4321fedcba09 match gohighlevel-webhook-url
T02 live shape A, verbatim (id + uuid redacted here) match gohighlevel-webhook-url
T03 live shape B, verbatim (id + uuid redacted here) match gohighlevel-webhook-url
T04 GHL_TOKEN=pit-0f1e2d3c-4b5a-6978-8765-4321fedcba09 PIT rule only, not this one gohighlevel-pit only
T05 bare domain, fetch('https://services.leadconnectorhq.com/') no match no match
T06 docs example, /hooks/<locationId>/webhook-trigger/<uuid> no match no match
T07 same placeholder assigned to a variable no match no match
T08 link.leadconnectorhq.com/widget/booking/abc123XYZ (also served by that page) no match no match
T09 bare uuid as a value, webhook_uuid = "0f1e2d3c-…" no match no match
T10 full capability URL on a line ending in ... — (see below) no match, masked by the allowlist
T11 the words "the webhook-trigger step fires the workflow" no match no match
T12 backend.leadconnectorhq.com/hooks/…/webhook-trigger/<uuid> match gohighlevel-webhook-url

Baseline, same corpus against origin/main's .gitleaks.toml:

INF 1 commits scanned.
WRN leaks found: 1
gohighlevel-pit line 8

One finding — the PIT. All four capability URLs scan clean. That is the gap.

With this PR's config:

INF 1 commits scanned.
WRN leaks found: 5
gohighlevel-webhook-url line 2    (T01)
gohighlevel-webhook-url line 4    (T02, live)
gohighlevel-webhook-url line 6    (T03, live)
gohighlevel-pit         line 8    (T04 — PIT rule, not this one)
gohighlevel-webhook-url line 24   (T12)

Does the existing [allowlist] mask the new rule?

Asked and isolated by re-running the same corpus with the two candidate
allowlist regexes deleted:

  • **The UUID-as-a-value entry ([=:]\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/T03
    fire 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.
  • The truncated-placeholder entry (\.\.\.\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

$ gitleaks git --redact --config .gitleaks.toml .    # as secret-scan runs it
INF 35 commits scanned.
INF no leaks found

$ pre-commit run --all-files
Detect hardcoded secrets.................................................Passed

Review notes

  • This changes detection behaviour fleet-wide the moment it merges. The
    reusable workflow fetches .gitleaks.toml from main on every run, so every
    calling 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.
  • Expect new findings in repos that embed a GoHighLevel webhook URL in
    client-side code. That is the rule working. Rotating the URL in GoHighLevel is
    the fix; allowlisting it is not.
  • No real capability URL appears in this diff, this description, or any commit.

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.
@CameronBrooks11
CameronBrooks11 merged commit 18545d3 into main Oct 17, 2026
2 checks passed
@CameronBrooks11
CameronBrooks11 deleted the feat/ghl-webhook-url-rule branch October 17, 2026 21:08
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.

1 participant