T09 · Insecure Skill Coding Practices
- Location
SKILL.md:65- Finding
Destructive CRM Cleanup Uses Unsafe Classification Heuristics
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 65-69
Vulnerability Type: Unsafe destructive operations based on insufficient validation
Risk Level: MediumVulnerable Code Snippet
markdown 1. **Delete test deals** — search for deals with names containing "test", "demo", "sample", or with amount = $0 and no associated contacts. 2. **Address missing amounts** — export deals without `amount` and work with sales to fill in values or mark as lost. 3. **Close stale deals** — deals open with no activity in 90+ days should be reviewed with the deal owner. Set to "Closed Lost" if abandoned. 4. **Standardize pipeline stages** — ensure all pipelines have consistent stage names and probability percentages. 5. **Remove unused pipelines** — if a pipeline has zero active deals and is not in use, archive or delete it.Technical Analysis
The Skill authorizes destructive HubSpot operations using broad and insufficiently reliable heuristics. A deal name containing
test,demo, orsampledoes not establish that the record is disposable. Likewise, a zero-value deal without associated contacts may be a legitimate opportunity awaiting enrichment.The instruction to remove a pipeline when it has zero active deals and is "not in use" also lacks a precise verification procedure. A pipeline may still be referenced by historical records, reports, workflows, integrations, permissions, or future business processes.
The workflow does not mandate:
- A read-only preview or dry run before mutation.
- An export or backup of affected records and configurations.
- Explicit approval for every proposed deletion batch.
- Verification of record associations, workflows, reports, or other dependencies.
- Automatic exclusion of Salesforce-synchronized records.
- Stable test-record identifiers or an allowlist of approved record IDs.
- Preference for reversible archival over permanent deletion.
Although the docum ...[truncated 2159 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace substring and zero-value heuristics with explicit test-record markers, such as a dedicated boolean property, approved sandbox pipeline, or allowlisted record IDs.
- Require a read-only discovery phase that produces a complete proposed-change report before any mutation occurs.
- Require an authorized HubSpot administrator or record owner to approve the exact record IDs and pipelines in each deletion batch.
- Export all affected records, associations, properties, and pipeline configurations before making changes.
- Automatically detect
hs_salesforceopportunityidand exclude synchronized records unless both HubSpot and Salesforce administrators provide explicit approval. - Check contacts, companies, tickets, workflows, reports, integrations, historical records, permissions, and other dependencies before deleting a deal or pipeline.
- Prefer reversible archival or a quarantine stage over deletion. Apply a waiting period before permanent removal.
- Use least-privilege credentials: perform the audit with a read-only token and obtain temporary mutation privileges only after approval.
- Add batch-size limits, immutable audit logging, idempotency controls, and post-operation verification.
- Define objective criteria for determining that a pipeline is unused; zero active deals alone must not be sufficient.
