Back to skill

Security audit

Enrich Industry

Security checks for vulnerabilities and agentic risk

Overview

This skill gives mostly manual HubSpot instructions and audit scripts for copying company industry onto contacts, with no hidden persistence or unrelated data movement found.

Before installing or using this skill, run it with a least-privilege HubSpot token, keep .env out of source control, pin or lock script dependencies, and test the workflow on a small static list before selecting 'enroll existing contacts' in HubSpot.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T08 · Insecure Dependencies

Warning
Location
scripts/before.py:1
Finding

Unpinned Runtime Dependencies in Before-State Audit Script

Content
View full analysis

Vulnerability Details

File Location: scripts/before.py, lines 1-6
Vulnerability Type: Supply-chain risk from unpinned third-party dependencies
Risk Level: Medium

python
# /// script
# requires-python = ">=3.10"
# dependencies = [
#   "requests>=2.31",
#   "python-dotenv>=1.0",
# ]
# ///

Technical Analysis

The script declares third-party packages using minimum-version constraints rather than exact, reviewed versions. A PEP 723-compatible script runner may automatically resolve and install any current or future package release satisfying these constraints. The project contains no dependency lockfile, package hashes, or other integrity controls that would make dependency resolution reproducible.

Consequently, the code executed by the script can change even when the audited project files remain unchanged. Exploitation would require a malicious or compromised release of one of the declared packages, or compromise of the dependency distribution channel. Such dependency code can execute during package installation or Python import, before the script performs its intended audit operations.

Attack Path

  1. An attacker compromises a future release of requests or python-dotenv, or the package delivery channel.
  2. The malicious release retains a version satisfying the script's >= constraint.
  3. A user runs scripts/before.py through an environment that resolves its inline dependencies.
  4. The resolver downloads and installs the compromised release because no exact version or hash is enforced.
  5. Malicious code executes during installation or import in the context of the user running the script.
  6. The dependency can access the script process, including the HUBSPOT_ACCESS_TOKEN environment variable and HubSpot data returned to the process.

Impact Assessment

Successful exploitation would provide code execution with the operating-system privileges of the user running the script ...[truncated 557 chars]

Remediation
View remediation

Remediation Suggestions

  • Replace minimum-version ranges with exact, reviewed package versions.
  • Generate and commit a lockfile that records the complete transitive dependency graph.
  • Require cryptographic hashes for downloaded distributions, such as through a hash-locked requirements file.
  • Install dependencies only from an explicitly configured, trusted package index.
  • Perform dependency updates through a controlled review process with automated vulnerability and provenance checks.
  • Run the script with a least-privilege HubSpot token containing only the read scopes required for the before-state audit.
  • Execute the script in an isolated virtual environment or container with restricted filesystem and network access.

T08 · Insecure Dependencies

Warning
Location
scripts/after.py:1
Finding

Unpinned Runtime Dependencies in After-State Verification Script

Content
View full analysis

Vulnerability Details

File Location: scripts/after.py, lines 1-6
Vulnerability Type: Supply-chain risk from unpinned third-party dependencies
Risk Level: Medium

python
# /// script
# requires-python = ">=3.10"
# dependencies = [
#   "requests>=2.31",
#   "python-dotenv>=1.0",
# ]
# ///

Technical Analysis

The verification script permits any future versions of requests and python-dotenv that satisfy the specified lower bounds. No lockfile, exact version constraint, package hash, or equivalent integrity mechanism is supplied. An automatic script runner can therefore install dependency code that was not part of this audit.

Python dependencies execute within the script's process and can run code during installation or module import. If an accepted future package release or its distribution channel is compromised, the malicious code would execute before the verification logic and would inherit access to the script's environment and runtime resources.

Attack Path

  1. An attacker publishes or causes distribution of a compromised future release of a declared dependency.
  2. The release version satisfies requests>=2.31 or python-dotenv>=1.0.
  3. A user launches scripts/after.py with a runner that resolves the inline dependency metadata.
  4. The runner selects the compromised release because the project does not constrain an exact artifact or verify its hash.
  5. Attacker-controlled code runs during dependency installation or import.
  6. The malicious dependency reads the available HubSpot token or intercepts CRM data handled during after-state verification.

Impact Assessment

Exploitation could result in arbitrary code execution under the invoking user's account. It could expose HUBSPOT_ACCESS_TOKEN, local files accessible to that user, contact information processed by the script, company associations, and industry data returned by HubSpot. A stolen token could be reused to p ...[truncated 321 chars]

Remediation
View remediation

Remediation Suggestions

  • Pin each direct dependency to an exact, security-reviewed version.
  • Commit a lockfile covering direct and transitive dependencies.
  • Verify package artifacts using cryptographic hashes and fail installation when hashes differ.
  • Restrict package resolution to a trusted index and disable unapproved extra indexes.
  • Use automated dependency scanning while requiring human review for version updates.
  • Provision a least-privilege HubSpot token limited to the read operations required by verification.
  • Run the verification process in an isolated environment with only necessary filesystem and network access.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (26)

Tainted flow: 'HEADERS' from os.environ (line 33, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/after.py (reported line 54)May include surrounding context.

python
# ── Helpers ──────────────────────────────────────────────────────

def search_count(filters):
    resp = requests.post(SEARCH_URL, headers=HEADERS, json={
        "filterGroups": [{"filters": filters}],
        "limit": 1,
    })

Tainted flow: 'HEADERS' from os.environ (line 33, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/after.py (reported line 91)May include surrounding context.

python
# Step 3 — spot-check: verify contact industry matches company
print("Step 3: Spot-check — verifying contact industry matches associated company...")

resp_sample = requests.post(SEARCH_URL, headers=HEADERS, json={
    "filterGroups": [{"filters": [
        {"propertyName": "industry", "operator": "HAS_PROPERTY"},
    ]}],

Tainted flow: 'HEADERS' from os.environ (line 33, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/after.py (reported line 109)May include surrounding context.

python
cid = contact["id"]
    contact_industry = contact.get("properties", {}).get("industry", "")

    assoc_resp = requests.get(
        f"{BASE}/crm/v4/objects/contacts/{cid}/associations/companies",
        headers=HEADERS,
    )

Tainted flow: 'HEADERS' from os.environ (line 33, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/after.py (reported line 123)May include surrounding context.

python
continue

    company_id = assoc_results[0]["toObjectId"]
    comp_resp = requests.get(
        f"{BASE}/crm/v3/objects/companies/{company_id}",
        headers=HEADERS,
        params={"properties": "industry"},

Tainted flow: 'HEADERS' from os.environ (line 33, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/after.py (reported line 170)May include surrounding context.

python
if after_cursor:
        payload["after"] = after_cursor

    resp = requests.post(SEARCH_URL, headers=HEADERS, json=payload)
    if resp.status_code != 200:
        break

Tainted flow: 'HEADERS' from os.environ (line 34, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/before.py (reported line 47)May include surrounding context.

python
# ── Helpers ──────────────────────────────────────────────────────

def search_count(filters):
    resp = requests.post(SEARCH_URL, headers=HEADERS, json={
        "filterGroups": [{"filters": filters}],
        "limit": 1,
    })

Tainted flow: 'HEADERS' from os.environ (line 34, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/before.py (reported line 64)May include surrounding context.

python
# Step 1 — total contacts
print("Step 1: Total contacts...")
resp_all = requests.get(
    f"{BASE}/crm/v3/objects/contacts", headers=HEADERS, params={"limit": 1},
)
total_contacts = resp_all.json().get("total", 0) if resp_all.status_code == 200 else 0

Tainted flow: 'HEADERS' from os.environ (line 34, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/before.py (reported line 89)May include surrounding context.

python
# Step 3b — check for alternate 'industry_name' custom property
print("Step 3b: Checking for alternate 'industry_name' custom property...")
prop_resp = requests.get(
    f"{BASE}/crm/v3/properties/contacts/industry_name", headers=HEADERS,
)
if prop_resp.status_code == 200:

Tainted flow: 'HEADERS' from os.environ (line 34, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/before.py (reported line 122)May include surrounding context.

python
if after:
        payload["after"] = after

    resp = requests.post(SEARCH_URL, headers=HEADERS, json=payload)
    if resp.status_code != 200:
        print(f"  Search API error: {resp.status_code}")
        break

Tainted flow: 'HEADERS' from os.environ (line 34, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/before.py (reported line 134)May include surrounding context.

python
for contact in results:
        cid = contact["id"]
        assoc_resp = requests.get(
            f"{BASE}/crm/v4/objects/contacts/{cid}/associations/companies",
            headers=HEADERS,
        )

Tainted flow: 'HEADERS' from os.environ (line 34, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/before.py (reported line 142)May include surrounding context.

python
assoc_results = assoc_resp.json().get("results", [])
            if assoc_results:
                company_id = assoc_results[0]["toObjectId"]
                comp_resp = requests.get(
                    f"{BASE}/crm/v3/objects/companies/{company_id}",
                    headers=HEADERS,
                    params={"properties": "industry"},

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description says the skill backfills contact industry from associated companies using a HubSpot workflow. However, this code chunk is an 'after state' validation script only. It calls HubSpot search and association/company read endpoints, computes counts, spot-checks whether contact industry matches company industry, and exports metrics to a CSV. There are no contact update/write operations, no workflow creation or execution, and no logic that actually copies company industry onto contacts. This is a materially different primary purpose: auditing/verification rather than enrichment.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared purpose says the skill backfills contact-level industry from associated company records using a HubSpot workflow. However, the supplied code does not perform any write/update operations to contacts or execute a workflow action. It only reads HubSpot contacts, properties, associations, and company data to estimate how many records could be enriched, then outputs a CSV audit trail. The final printed statement claiming it copies values via batch updates is not reflected in the actual code. The core intent is related to industry enrichment, but the primary behavior of this chunk is analysis/preflight auditing rather than backfilling, so the description materially overstates what the code actually does.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
76% confidence
Finding

Loading secrets from a local .env file increases the chance that API credentials are stored in plaintext on disk, accidentally committed, or exposed through weak file permissions. In an agent skill context, this is more dangerous because skills are often shared, versioned, or run in semi-automated environments where secret hygiene is inconsistent.

Content

Scanner excerpt · scripts/after.py (reported line 29)May include surrounding context.

python
from dotenv import load_dotenv

# ── Configuration ────────────────────────────────────────────────
load_dotenv(os.path.join(os.path.dirname(__file__), "..", ".env"))

TOKEN = os.environ["HUBSPOT_ACCESS_TOKEN"]
BASE = "https://api.hubapi.com"

Credential Access

High
Category
Privilege Escalation
Confidence
83% confidence
Finding

The script loads credentials from a local .env file and accesses a HubSpot bearer token, which is sensitive capability material. While this is common practice, in an agent skill it is security-relevant because anyone running the skill grants CRM read access; if the environment file is mishandled, checked into source control, or over-scoped, the token could be exposed or abused.

Content

Scanner excerpt · scripts/before.py (reported line 30)May include surrounding context.

python
from dotenv import load_dotenv

# ── Configuration ────────────────────────────────────────────────
load_dotenv(os.path.join(os.path.dirname(__file__), "..", ".env"))

TOKEN = os.environ["HUBSPOT_ACCESS_TOKEN"]
BASE = "https://api.hubapi.com"

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill includes executable Python snippets that use environment variables and make authenticated network calls to HubSpot, but the skill metadata declares no tool scope or permissions. This creates an authorization and transparency gap: an agent or user may run code with access to secrets and outbound connectivity without an explicit declaration of those capabilities.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill instructs users to activate a workflow that can update large numbers of contact records, including enrolling existing contacts, without requiring a pilot/test segment, rollback plan, or warning about mass data modification. In CRM environments, a misconfigured property mapping or wrong target property can silently propagate bad data across tens of thousands of records and disrupt segmentation, reporting, and downstream automation.

Content

No source excerpt is available for this finding.

Tainted flow: 'company_id' from requests.get (line 122, network input) → requests.get (network output)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · scripts/after.py (reported line 123)May include surrounding context.

python
continue

    company_id = assoc_results[0]["toObjectId"]
    comp_resp = requests.get(
        f"{BASE}/crm/v3/objects/companies/{company_id}",
        headers=HEADERS,
        params={"properties": "industry"},

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The script requires and uses a sensitive HubSpot access token, but the documented behavior does not clearly disclose this credential requirement up front. In an agent-skill context, incomplete disclosure reduces informed consent and can cause users to run code with powerful credentials without fully understanding external access.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/after.py (reported line 54)May include surrounding context.

python
# ── Helpers ──────────────────────────────────────────────────────

def search_count(filters):
    resp = requests.post(SEARCH_URL, headers=HEADERS, json={
        "filterGroups": [{"filters": filters}],
        "limit": 1,
    })

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/after.py (reported line 91)May include surrounding context.

python
# ── Helpers ──────────────────────────────────────────────────────

def search_count(filters):
    resp = requests.post(SEARCH_URL, headers=HEADERS, json={
        "filterGroups": [{"filters": filters}],
        "limit": 1,
    })

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/after.py (reported line 170)May include surrounding context.

python
# ── Helpers ──────────────────────────────────────────────────────

def search_count(filters):
    resp = requests.post(SEARCH_URL, headers=HEADERS, json={
        "filterGroups": [{"filters": filters}],
        "limit": 1,
    })

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/before.py (reported line 47)May include surrounding context.

python
# ── Helpers ──────────────────────────────────────────────────────

def search_count(filters):
    resp = requests.post(SEARCH_URL, headers=HEADERS, json={
        "filterGroups": [{"filters": filters}],
        "limit": 1,
    })

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/before.py (reported line 122)May include surrounding context.

python
# ── Helpers ──────────────────────────────────────────────────────

def search_count(filters):
    resp = requests.post(SEARCH_URL, headers=HEADERS, json={
        "filterGroups": [{"filters": filters}],
        "limit": 1,
    })

Tainted flow: 'company_id' from requests.get (line 141, network input) → requests.get (network output)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · scripts/before.py (reported line 142)May include surrounding context.

python
assoc_results = assoc_resp.json().get("results", [])
            if assoc_results:
                company_id = assoc_results[0]["toObjectId"]
                comp_resp = requests.get(
                    f"{BASE}/crm/v3/objects/companies/{company_id}",
                    headers=HEADERS,
                    params={"properties": "industry"},