T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:464- Finding
Overly Broad Local Credential and Secret Discovery
- Content
View full analysis
list[SecretFinding]: """Scan a directory tree for exposed secrets.""" findings = [] root_path = Path(root) for file_path in root_path.rglob("*"): if not file_path.is_file(): continue if file_path.suffix in self.SKIP_EXTENSIONS: continue if '.git' in file_path.parts: continue if file_path.stat().st_size > max_file_size_bytes: continue try: content = file_path.read_text(errors='ignore') except (PermissionError, OSError): continue for pattern in self.SECRET_PATTERNS: for match in pattern.finditer(content): secret_value = ( match.group(1) if match.lastindex else match.group(0) ) secret_hash = self.hash_secret(secret_value) risk = "high" description = ( f"Potential secret found matching pattern: " f"{pattern.pattern[:50]}..." ) if secret_hash in self.known_hashes: risk = "critical" description = ( f"KNOWN production secret detected outside " f"authorized secret store" ) if file_path.name in ( '.env', '.env.local', '.env.production' ): risk = "critical" description = ( f"Secret in environment file that may be " f"committed to source control" ) findings. ...[truncated 4135 chars]- Remediation
View remediation
