T01 · Skill Instruction Hijacking
- Location
scripts/get_stock_themes.py:31- Finding
Prompt Injection Through Unvalidated Stock Code Input
- Content
View full analysis
- Remediation
View remediation
str: stock_code = stock_code.strip() if not re.fullmatch(r"\d{6}", stock_code): raise ValueError("Stock code must contain exactly six digits") return stock_code ``` 2. Validate every entry loaded from both command-line input and stock-list files. 3. Reject malformed entries rather than attempting to sanitize arbitrary instruction text. 4. Limit the number of stock codes accepted in one request to prevent uncontrolled subagent spawning. 5. Prefer a structured Skill/API invocation in which the stock code is passed as a typed parameter rather than embedded in a natural-language task. 6. Run delegated subagents with only the tools and permissions needed to retrieve stock themes. 7. Log rejected input safely and avoid including the complete malicious payload in shared logs. ]]>
