T09 · Insecure Skill Coding Practices
- Location
core/dynamic_tracer.py:34- Finding
Dynamic analysis executes untrusted code without enforcing resource limits or a timeout
- Content
View full analysis
bool: """Quick check if code looks safe to execute""" dangerous_patterns = [ "while True:", # Infinite loops "__import__", "eval(", "exec(", ] code_lower = code.lower() for pattern in dangerous_patterns: if pattern in code_lower: return False return True ``` ### Technical Analysis The scanner performs in-process execution of Python files supplied by an untrusted Skill. Although the constructor accepts a five-second timeout, `self.timeout` is never used to interrupt or terminate execution. The safety check is a substring denylist rather than a resource-control boundary. It only detects a few exact textual forms. Equivalent resource-exhaustion constructs such as `while 1:`, computationally expensive loops, deep recursion, or memory-intensive expressions are not rejected. RestrictedPython constrains access to selected Python operations, but it does not independently enforce wall-clock, CPU, or memory limits. Because execution occurs synchronously in the scanner process, a resource-exhaustion payload can hang or terminate the security tool ...[truncated 1197 chars]- Remediation
View remediation
