From ec9bc2ae1122939774bfc460a345bf99fff1cf98 Mon Sep 17 00:00:00 2001 From: Cameron Brooks <95648474+CameronBrooks11@users.noreply.github.com> Date: Sat, 17 Oct 2026 16:20:58 -0400 Subject: [PATCH] feat(gitleaks): detect gohighlevel webhook capability urls Gitleaks' default set has no detector for GoHighLevel inbound webhook URLs, and neither did the org ruleset, so the shape .leadconnectorhq.com/hooks//webhook-trigger/ 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. --- .gitleaks.toml | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/.gitleaks.toml b/.gitleaks.toml index 4105926..9aa3de6 100644 --- a/.gitleaks.toml +++ b/.gitleaks.toml @@ -95,3 +95,58 @@ entropy = 0 # A doc example written with real hex digits is, by construction, # indistinguishable from a live token -- so it SHOULD fail the scan. Write # `pit-` in prose instead of allowlisting a hex-shaped example. + +# Gitleaks' default set also has no detector for GoHighLevel inbound webhook +# capability URLs, a different credential class from a PIT and a live exposure +# of the same kind: a client site served two of them in its production HTML, +# and the weekly full-history sweep reported success on every run because +# nothing in the ruleset described the shape. +# +# A capability URL IS a credential: 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 — injecting leads, +# triggering whatever SMS/email sends and automations that workflow drives +# against that sub-account. It carries no `secret`/`token`/`key` in its name +# and reads as an ordinary endpoint, which is exactly how it reaches +# client-side HTML. + +[[rules]] +id = "gohighlevel-webhook-url" +description = "GoHighLevel inbound webhook capability URL" +# `keywords` keeps the scan cheap the same way as the rule above: the regex is +# only evaluated against lines containing this literal, and `webhook-trigger` +# is specific to this vendor's URL shape. +# +# Measured choices: +# * The host is matched at the registrable domain rather than pinned to the +# `services.` subdomain, so a capability URL served from another +# `*.leadconnectorhq.com` host still fires. For a scanner a miss is the +# costly direction. +# * The location id is `[A-Za-z0-9]{15,30}`, not the exactly-20 characters both +# measured URLs carried, so a longer agency- or company-scoped id still +# fires. It still cannot match a documentation placeholder: `<` and `>` are +# outside the class, so `/hooks//webhook-trigger/` does not +# match — measured, not assumed. +# * No trailing `\b`, deliberately, for the same reason as the rule above. +regex = '''(?i)\bleadconnectorhq\.com/hooks/[A-Za-z0-9]{15,30}/webhook-trigger/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}''' +keywords = ["webhook-trigger"] +entropy = 0 + + # The shared [allowlist] above was checked against this rule rather than + # assumed harmless, and the two entries that could have masked it behave + # differently: + # + # * The UUID-as-a-value entry does NOT mask it. That regex requires the hex + # to sit immediately after `=` or `:` (with an optional quote); here the + # UUID is the final path segment of a URL, preceded by `/`, so it never + # matches — confirmed against both real-world shapes. + # * The truncated-placeholder entry (`\.\.\.\s*$`) DOES mask a finding when a + # full capability URL sits on a line that happens to end in an ellipsis, + # because `regexTarget = "line"` allowlists the whole line. Left as is: the + # entry is doing what it exists for, and narrowing it would cost more + # coverage elsewhere than it buys here. Write `/webhook-trigger/` in + # prose instead of relying on a trailing ellipsis. + # + # No rule-scoped allowlist, for the reason given above: every safe way of + # writing the shape (``, ``, `xxxx`) is already outside the + # regex, so an entry for one would be dead code that looked like coverage.