T09 · Insecure Skill Coding Practices
- Location
scripts/compress.py:19- Finding
Filename-Only Secret Filtering Allows Sensitive Content to Be Sent to an External API
- Content
View full analysis
bool: """Heuristic denylist for files that must never be shipped to a third-party API.""" name = filepath.name if SENSITIVE_BASENAME_REGEX.match(name): return True lowered_parts = {p.lower() for p in filepath.parts} if lowered_parts & SENSITIVE_PATH_COMPONENTS: return True # Normalize separators so "api-key" and "api_key" both match "apikey". lower = re.sub(r"[_\-\s.]", "", name.lower()) return any(tok in lower for tok in SENSITIVE_NAME_TOKENS) ``` ```python def call_claude(prompt: str) -> str: api_key = os.environ.get("ANTHROPIC_API_KEY") if api_key: try: import anthropic client = anthropic.Anthropic(api_key=api_key) ...[truncated 3596 chars]- Remediation
View remediation
