T09 · Insecure Skill Coding Practices
- Location
templates/chart_page.html:47- Finding
Stored client-side HTML and JavaScript injection in generated reports
- Content
View full analysis
${sec.title}`; const uid=r.afterRender?('chart_'+Date.now()+'_'+Math.random().toString(36).slice(2,6)):null; h+=r.render(sec.data,uid); el.innerHTML+=h; if(r.afterRender&&uid) setTimeout(()=>r.afterRender(sec.data,uid),50); } ``` The text renderer directly interpolates the CSS class, title, and content: ```javascript registerRenderer('text', function(d){ const cls=d.level||'warning'; return ``; }); ``` The table renderer directly interpolates headers and cells: ```javascript registerRenderer('table', function(d){ let h=''; (d.headers||[]).forEach(th=>h+=``); h+=''; (d.rows||[]).forEach(row=>{ h+=''; row.forEach(cell=>{ const cls=typeof cell==='string'&&cell.startsWith('↑')?' style="color:var(--green);font-weight:700"':typeof cell==='string'&&cell.startsWith('↓')?' style="color:var(--red);font-weight:700"':''; h+=`${cell}`; }); h+=''; }); h+='${d.title||''}
${d.content||''}
'; return h; }); ``` The direction renderer directly interpolates recommendation fields: ```javascript let h='${th} '; (d.rows||[]).forEach((r,idx)=>{ const color=getColor(r.title,idx); const icon=get ...[truncated 6127 chars]- Remediation
View remediation
` - `` - Attribute-breaking quotes - Closing element tags - `javascript:` URLs ]]>
