Skip to content
Detectors

Scanner deep dive

Overview

HubSpot is a CRM platform that provides tools for marketing, sales, and customer service. HubSpot API keys can be used to access and modify data within the HubSpot platform.
From the detector’s Description() in source
Provider and detector details

Summary

ProviderNo provider details added yet.

Runs on any connection. Triggered by keywords in the content, after decoding.How TruffleHog works

How detection works

The v1 detector checks decoded text containing “hubapi”, “hapikey”, “hapi_key” or “hubspot” for a possible credential.

Matching rules and source
Keywords
  • hubapi
  • hapikey
  • hapi_key
  • hubspot

Regex

  • v1 regexkeyPatapikey.go:32 (opens TruffleHog source on GitHub)Placed by its version number

    \b([a-zA-Z0-9]{8}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{12})\b
    Show as a diagram

    Must appear near: “hubapi”, “hapi_?key” or “hubspot”

apikey.go:32 (opens TruffleHog source on GitHub)apikey.go:37 (opens TruffleHog source on GitHub)apikey.go:76 (opens TruffleHog source on GitHub)apikey.go:91 (opens TruffleHog source on GitHub)apikey.go:100 (opens TruffleHog source on GitHub)apikey.go:102 (opens TruffleHog source on GitHub)
Detector-wide rules and behavior
Prefix regex
One value
Guards against false matches
Not found in source
Not found in source

How it behaves

What this detector does at each step of the TruffleHog pipeline.

pkg/detectors/hubspot_apikey/v1 · Scanner

Keywords

Any one of these in the decoded text wakes the detector.

  • hubapi
  • hapikey
  • hapi_key
  • hubspot

apikey.go line 38 (opens TruffleHog source on GitHub)

Behavior

Multi-part
No
Match window
512 bytes on each side of a keyword
ahocorasickcore.go line 159 (opens TruffleHog source on GitHub)
Custom endpoints
No
Cloud endpoint
None
Randomness check
None in this detector's own code
False-positive check
The shared word lists

Verification. When a scan allows it, TruffleHog tests a match by calling the provider. A scan can turn this off for every detector or for this one. Atlas only describes this; it never tests credentials. How the verify decision works

Analyzer.None in the open-source code.

In short

  • v1: Wakes on “hubapi”, “hapikey”, “hapi_key” or “hubspot” and tests matches with the provider. A default scan runs it.
  • v2: Wakes on “pat-na1-” or “pat-eu1-” and tests matches with the provider. A default scan runs it.

How verification works

The source checks both the HTTP status and the response body.

The detection and verification evidence on this page comes from the Open Source implementation. Check the Enterprise coverage guide for product availability.

Does checking a key change anything at the provider?

Not expected to: it’s a GET request, which reads without changing anything, and the source declares no changes.

Source says: GET as declared in source; mutating side effects not declared

Files
v1/apikey.go
Checked rule

v1 · Legacy API key

GET /contacts/v1/lists with the key in the hapikey query parameter.

Verified when HTTP 200 with a valid JSON body.

HTTP 401 rejects the key. Invalid JSON or any other status, including 403, produces a verification error.

View source for v1 · Legacy API key
Errors, timeouts and rate limits
Not found in source
Not found in source
SetVerificationError; unexpected HTTP response status %d

other statuses: verification error or unknown

transport errors return a verification error

All URLs found in source

  • https://legacydocs.hubspot.com/docs/methods/auth/oauth-overview
  • https://api.hubapi.com/contacts/v1/lists?hapikey=
  • https://api.hubapi.com/account-info/v3/api-usage/daily/private-apps

Verified findings

Open Source · Standard output (stdout)

The CLI prints verified findings to stdout. Use --json for structured output.

Example scan output · credential redacted

✅ Found verified result 🐷🔑
Detector Type: HubSpotApiKey
Decoder Type: PLAIN
Raw result: [redacted]
Terminal printer source
CI formats

With --github-actions, GitHub Actions displays this workflow command as a warning on the indicated file and line.

::warning file=config/example.env,line=8,endLine=8::Found verified HubSpotApiKey result 🐷🔑
GitHub Actions printer source

Legacy compatibility. --json-legacy writes pre-v3 JSON for Git, GitLab, and GitHub sources only.

Enterprise alerts

When Enterprise verifies that a secret is live, a configured notifier can alert your team. The finding is also available through the Enterprise API.

Optional analysis

No analyzer is recorded for this detector.

A missing analyzer is not evidence the credential has no further access.

Rotation resources

Use the provider’s instructions for this credential.

Rotation and revocation instructions

HubSpot documents rotation for the access token of a legacy private app. This procedure applies to the private-app token variant, and the console offers immediate expiry of the old token when appropriate.

Provider documentation checked by Atlas on .

See it in the rotation directory

Token types

TruffleHog’s source looks for 2 token types, by prefix. It doesn’t name them.

Token types: from TruffleHog’s source, and what the vendor says
PrefixVariant
pat-eu1-v2
pat-na1-v2
Pages TruffleHog’s source links to (1)

Written in the detector’s source by its authors. Shown as written: this doesn’t say what each page covers.

Coverage in other scanners

4 scanners have a confirmed match.

Changes

1 recorded change since Sep 18, 2026; 1 still needs review.

  1. What this change means

    How responses are judged changed. Changes how the detector verifies or what it treats as the credential.

    Field changes
    FieldBeforeAfter
    Expected statusesBefore: 200 (StatusOK) → verified; 401 (StatusUnauthorized) → not verified; 403 (StatusForbidden) → verified; other (default) → error or unknownAfter: 200 (StatusOK) → verified; 401 (StatusUnauthorized) → not verified; other (default) → error or unknown
    pkg/detectors/hubspot_apikey/v1/apikey.go+8−3View file
    @@ -2,6 +2,7 @@ package v1
    22
    33import (
    44 "context"
    5added: "encoding/json"
    56 "fmt"
    67 "io"
    78 "net/http"
    @@ -88,12 +89,16 @@ func verifyToken(ctx context.Context, client *http.Client, token string) (bool,
    8889
    8990 switch res.StatusCode {
    9091 case http.StatusOK:
    92added: body, err := io.ReadAll(res.Body)
    93added: if err != nil {
    94added: return false, err
    95added: }
    96added: if !json.Valid(body) {
    97added: return false, fmt.Errorf("unexpected response body for HTTP 200")
    98added: }
    9199 return true, nil
    92100 case http.StatusUnauthorized:
    93101 return false, nil
    94removed: case http.StatusForbidden:
    95removed: // The token is valid but lacks permission for the endpoint.
    96removed: return true, nil
    97102 default:
    98103 return false, fmt.Errorf("unexpected HTTP response status %d", res.StatusCode)
    99104 }
    pkg/detectors/hubspot_apikey/v2/apikey.go+18−1View file
    @@ -2,6 +2,7 @@ package v2
    22
    33import (
    44 "context"
    5added: "encoding/json"
    56 "fmt"
    67 "io"
    78 "net/http"
    @@ -31,6 +32,10 @@ var (
    3132 keyPat = regexp.MustCompile(`\b(pat-(?:eu|na)1-[A-Za-z0-9]{8}\-[A-Za-z0-9]{4}\-[A-Za-z0-9]{4}\-[A-Za-z0-9]{4}\-[A-Za-z0-9]{12})\b`)
    3233)
    3334
    35added: type hubspotErrorResponse struct {
    36added: Category string `json:"category"`
    37added: }
    38added:
    3439// Keywords are used for efficiently pre-filtering chunks.
    3540// Use identifiers in the secret preferably, or the provider name.
    3641func (s Scanner) Keywords() []string {
    @@ -87,11 +92,23 @@ func verifyToken(ctx context.Context, client *http.Client, token string) (bool,
    8792
    8893 switch res.StatusCode {
    8994 case http.StatusOK:
    95added: body, err := io.ReadAll(res.Body)
    96added: if err != nil {
    97added: return false, err
    98added: }
    99added: if !json.Valid(body) {
    100added: return false, fmt.Errorf("unexpected response body for HTTP 200")
    101added: }
    90102 return true, nil
    91103 case http.StatusUnauthorized:
    92104 return false, nil
    93105 case http.StatusForbidden:
    94removed: // The token is valid but lacks permission for the endpoint.
    106added: // Only HubSpot's own scope error proves the token authenticated; a 403 from anything
    107added: // else (e.g. a proxy) says nothing about the token.
    108added: var errResp hubspotErrorResponse
    109added: if err := json.NewDecoder(res.Body).Decode(&errResp); err != nil || errResp.Category != "MISSING_SCOPES" {
    110added: return false, fmt.Errorf("unexpected 403 response, unable to verify token")
    111added: }
    95112 return true, nil
    96113 default:
    97114 return false, fmt.Errorf("unexpected HTTP response status %d", res.StatusCode)

Source

Every fact on this page was parsed from trufflesecurity/trufflehog at 2325546, unless a row below says otherwise.

2325546
2921dcc
Parser
trufflehog-detectors-analyzers-v12
Extraction
intel-detector-v7

4 of 31 evidence rows need attention

Evidence rows that need attention
FieldStatusValueSource
lastSeenAt2026-11-25T16:33:44.855ZNo citation
rotationGuideNone extractedFile
timeoutNone extractedFile
rateLimitNone extractedFile
All 31 evidence rows
All evidence rows
FieldStatusValueSource
descriptionHubSpot is a CRM platform that provides tools for marketing, sales, and customer service. HubSpot API keys can be used to access and modify data within the HubSpot platform.File
keywordshubapi, hapikey, hapi_key, hubspot, pat-na1-, pat-eu1-File
detectorTypesHubSpotApiKeyFile
filesv1/apikey.go, v2/apikey.goFile
patterns\b([a-zA-Z0-9]{8}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{12})\b, \b(pat-(?:eu|na)1-[A-Za-z0-9]{8}\-[A-Za-z0-9]{4}\-[A-Za-z0-9]{4}\-[A-Za-z0-9]{4}\-[A-Za-z0-9]{12})\bFile
patternTypeprefix_regexFile
statusactiveFile
lastSeenAt2026-11-25T16:33:44.855ZNo citation
rotationGuideNone extractedFile
verify.hasVerifyYesFile
verify.httpMethodsGETFile
verify.statusCodesOK, Unauthorized, ForbiddenFile
timeoutNone extractedFile
rateLimitNone extractedFile
errorHandlingSetVerificationError; unexpected HTTP response status %dFile
verify.urlshttps://legacydocs.hubspot.com/docs/methods/auth/oauth-overview, https://api.hubapi.com/contacts/v1/lists?hapikey=, https://api.hubapi.com/account-info/v3/api-usage/daily/private-appsFile
detection.keywordshubapi, hapikey, hapi_key, hubspotLines 37–37
detection.keywordspat-na1-, pat-eu1-Lines 41–41
verification.endpointhttps://api.hubapi.com/contacts/v1/lists?hapikey=Lines 76–76
verification.httpMethodGETLines 76–76
verification.authenticationMethodURL path suffixLines 76–76
verification.expectedStatuses.verified{"statuses":[200],"names":["StatusOK"],"outcome":"verified"}Lines 91–91
verification.expectedStatuses.not_verified{"statuses":[401],"names":["StatusUnauthorized"],"outcome":"not_verified"}Lines 100–100
verification.expectedStatuses.error_or_unknown{"statuses":[],"names":["default"],"outcome":"error_or_unknown"}Lines 102–102
verification.endpointhttps://api.hubapi.com/account-info/v3/api-usage/daily/private-appsLines 79–79
verification.httpMethodGETLines 79–79
verification.authenticationMethodBearer tokenLines 83–83
verification.expectedStatuses.verified{"statuses":[200],"names":["StatusOK"],"outcome":"verified"}Lines 94–94
verification.expectedStatuses.not_verified{"statuses":[401],"names":["StatusUnauthorized"],"outcome":"not_verified"}Lines 103–103
verification.expectedStatuses.verified{"statuses":[403],"names":["StatusForbidden"],"outcome":"verified"}Lines 105–105
verification.expectedStatuses.error_or_unknown{"statuses":[],"names":["default"],"outcome":"error_or_unknown"}Lines 113–113
Parser completeness
  • Field status: Extracted
  • Field status: Extracted
  • Field status: Extracted
  • Field status: Extracted
  • Field status: Unknown
  • Field status: Unknown
  • Field status: Extracted
  • Field status: Extracted
  • Field status: Extracted
  • Field status: Extracted
  • Field status: Not scanned
Package files (2)
  • v1/apikey.go
  • v2/apikey.go