T09 · Insecure Skill Coding Practices
- Location
scripts/gen-report.py:14- Finding
Unescaped Report Data Allows HTML and Content Injection
- Content
View full analysis
1 else {} def r(key, default='—'): return str(data.get(key, default)) replacements = { '{{DATE}}': r('date', '2026-04-08'), '{{WEEKDAY}}': r('weekday', '周三'), '{{TIME}}': r('time', '09:00'), '{{EC2_COUNT}}': r('ec2Count', '86'), '{{RDS_COUNT}}': r('rdsCount', '34'), '{{ELB_COUNT}}': r('elbCount', '28'), '{{COST_TOTAL}}': r('costTotal', '70,005'), '{{COST_DAILY}}': r('costDaily', '2,334'), '{{UNATTACHED_VOL}}': r('unattachedVol', '19'), '{{UNUSED_EIP}}': r('unusedEip', '1'), '{{LOW_CPU}}': r('lowCpu', '53'), '{{OLD_SNAP}}': r('oldSnap', '1'), '{{SP_UTIL_PCT}}': r('spUtilPct', '100'), '{{SP_COV_PCT}}': r('spCovPct', '51.5'), '{{RDS_RI_PCT}}': r('rdsRiPct', '34.6'), '{{EC_RI_PCT}}': r('ecRiPct', '18.4'), '{{NO_MFA}}': r('noMfa', '31/35'), '{{UNENC_EBS}}': r('unencEbs', '201/205'), '{{OPEN_SG}}': r('openSg', '17'), '{{OLD_KEYS}}': r('oldKeys', '13'), '{{S3_RISK}}': r('s3Risk', '4/19'), } for k, v in replacements.items(): html = html.replace(k, v) high_cpu = data.get('highCpu', [ {'name': 'kafka-prod-server-02', 'cpu': 50.6, 'level': 'orange'}, ]) cpu_html = '' for item in high_cpu: level = item.get('level', 'yellow') cpu_html += f'{item["name"]}{item["cpu"]}%' html = html.replace('{{HIGH_CPU_ITEMS}}', cpu_html) sp_details = data.get( 'spRiDetails', 'SP: $27.06/h 承诺 (3个活跃) · RDS RI: 31个实例 · Redis RI: 60个节点' ) html = html.replace('{{SP_RI_DE ...[truncated 3945 chars]- Remediation
View remediation
