T09 · Insecure Skill Coding Practices
- Location
scripts/render_network_report.py:117- Finding
Stored Cross-Site Scripting Through Unescaped Network Metrics
- Content
View full analysis
`${k.replaceAll('_',' ')}: ${typeof v==='object'?JSON.stringify(v):v}`).join(''); if(!metrics.nodes||!metrics.edges){const outcome=document.getElementById('outcome');outcome.hidden=false;outcome.textContent='No eligible evidence network was produced. This is a recorded negative or partial result, not evidence that no biological relationship exists.';} ``` ### Technical Analysis Values originating in the input edge table, including `source_ref`, `source`, `evidence_type`, and `evidence_tier`, are incorporated into the `metrics` object without validation or HTML encoding. The generated report subsequently converts these values to strings and inserts them into the document through `innerHTML`. Escaping the report title and replacing `- Remediation
View remediation
{ const metric = document.createElement('div'); metric.className = 'metric'; const label = document.createElement('b'); label.textContent = `${key.replaceAll('_', ' ')}: `; const text = document.createTextNode( typeof value === 'object' ? JSON.stringify(value) : String(value) ); metric.append(label, text); container.appendChild(metric); }); ``` ]]>
