T09 · Insecure Skill Coding Practices
Warning
- Location
handler.py:74- Finding
Unescaped Caller Input Permits Markdown Template and Prompt Injection
- Content
View full analysis
str: page_target = _pick_text(data, ['page_target', 'pages']) if page_target: return page_target if 'page' in page_target.lower() else f'{page_target} pages' time_target = _pick_text(data, ['time', 'minutes', 'duration']) if time_target: lower = time_target.lower() if 'minute' in lower or 'page' in lower: return time_target return f'{time_target} minutes' ``` ```python def handle(inputs): meta = _load_skill_meta('skill') data = _coerce_dict(inputs) raw = _normalize_inputs(inputs) focus = _pick_text(data, ['focus', 'theme', 'topic']) obstacle = _pick_text(data, ['obstacle', 'stuckness'], _detect_one(raw, OBSTACLE_RULES, 'Freeze on page one')) container = _extract_container(data, raw) writing_rule = 'Keep the pen or cursor moving, do not edit while writing, and write the next honest sentence even if it feels repetitive.' if obstacle == 'Self-editing': writing_rule = 'Write without polishing or crossing out, and let awkward sentences stay awkward until the session ends.' elif obstacle == 'Over-analysis': writing_rule = 'Stay with raw observation, not interpretation, until the timer or page target ends.' cues = _build_cues(obstacle, focus) gentle_focus = focus if focus else 'Whatever feels loudest in your mind this morning.' return f"""# Morning Pages Session ## Container - Time or page target: {container} - Writing rule: {writing_rule} - Gentle focus, if helpful: {gentle_focus} ## Starter Cues - {cues[0]} - {cues[1]} - {cues[2]} ## After Writing - One phrase that stood out: Circle or copy one line that surprised you. - One feel ...[truncated 2813 chars]- Remediation
View remediation
