T09 · Insecure Skill Coding Practices
Warning
- Location
scripts/validate-opportunity-ledger.mjs:162- Finding
Existing-Link Reclamation Cap Is Not Enforced
- Content
View full analysis
MAX_PER_DOMAIN) errors.push(`${domain}: exceeds the maximum of ${MAX_PER_DOMAIN} candidates per root domain.`); return { ok: errors.length === 0, errors, summary: { ...requirements, targetRootDomain, candidateCount: candidates.length, rootDomainCount: domains.size, laneCount: lanes.size, newProspectCount, existingReclamationCount, evidenceStates: states }, }; ``` ### Tech ...[truncated 2808 chars]- Remediation
View remediation
maximumReclamations) { errors.push( `Existing-link reclamation exceeds the maximum of ${maximumReclamations} candidates for the ${requirements.tier} tier.` ); } ``` If the intended rule is that reclamation may not exceed 20% of the submitted ledger, implement a ratio check instead: ```js const maximumReclamations = Math.floor(candidates.length * 0.2); if (existingReclamationCount > maximumReclamations) { errors.push( `Existing-link reclamation exceeds 20% of submitted candidates: ${existingReclamationCount} of ${candidates.length}.` ); } ``` The documentation should clarify which denominator is authoritative. The current wording, “20% of the selected tier,” suggests fixed limits of eight reclamation records for the minimum tier and twenty for the full tier. Add regression tests covering: - A minimum-tier ledger with 32 new prospects and more than eight reclamation records. - A full-tier ledger with 80 new prospects and more than twenty reclamation records. - Oversized ledgers that otherwise satisfy all domain, lane, URL, and enumeration checks. - Boundary cases at exactly eight and twenty reclamation records. - A direct assertion on the expected reclamation-cap validation message. The validator summary may also expose `maximumReclamations` and `reclamationPercentage` to make compliance independently auditable. ]]>
