T09 · Insecure Skill Coding Practices
- Location
scripts/script.sh:548- Finding
Stored HTML Injection in Generated Shadow Previews
- Content
View full analysis
Shadow Preview: {rec['name']} body {{ display: flex; justify-content: center; align-items: center; min-height: 100vh; background: #f0f0f0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; margin: 0; flex-direction: column; gap: 24px; }} .preview-card {{ width: 280px; height: 180px; background: #ffffff; border-radius: 12px; {prop}: {val}; display: flex; align-items: center; justify-content: center; color: #666; font-size: 14px; }} .css-code {{ background: #1e1e1e; color: #d4d4d4; padding: 16px 24px; border-radius: 8px; font-family: 'Courier New', monospace; font-size: 13px; white-space: pre; }} h2 {{ color: #333; margin: 0; }}{rec['name']}
Shadow Preview{prop}: {val};""" ``` ### Technical Analysis The generated HTML directly interpolates persisted record fields into multiple HTML and CSS contexts without output encoding or strict validation: - `rec['name']` is inserted into the document title and an `h2` element. - `rec['css_value']` is inserted into both a `style` element and an HTML text context. - `css_property` is also inserted into CSS and text contexts. The record name and CSS value can originate from command-line parameters suc ...[truncated 2258 chars]- Remediation
View remediation
`. - Reject sequences capable of terminating the stylesheet, including ``, script elements, and event-handler markup. Verify that generated previews display these inputs as inert text or reject them entirely. ]]>
