fix(reporter): enable Jinja2 autoescape in report generation - #1047
Conversation
Both report environments rendered scenario data into HTML with escaping off, so any scenario or test name containing markup was written through unescaped. Coverity flags both sites as JINJA2_AUTOESCAPE_DISABLED. select_autoescape is not usable here - it keys off the file extension and the templates are named .jinja2, which is not in its default list. Refs: HPCINFRA-4857 Signed-off-by: Or Balayla <obalayla@nvidia.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: NVIDIA/cloudai/.coderabbit.yaml Review profile: ASSERTIVE Plan: Enterprise Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 12 included reviews per hour; 10 remain after this review. 📝 WalkthroughWalkthroughJinja2 HTML autoescaping is enabled for standard scenario reports and DSE reports. ChangesReport escaping
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to HTML reports will now escape markup in rendered values, reducing injection risk without an identified merge-blocking impact. 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Comment |
Both Jinja2 environments in
reporter.pyrendered scenario data into HTML report files with autoescaping disabled, so a scenario or test name containing markup was written through unescaped. Coverity reports both asJINJA2_AUTOESCAPE_DISABLED.Sets
autoescape=Trueat both sites (generate_scenario_report, and the DSE report environment).select_autoescape()is not usable here — it keys off the file extension, and these templates are named.jinja2, which is not in its default list.No output change expected: the templates these two environments load pass plain scalar values only. The
| safefilters elsewhere are innixl_report_template.jinja2, a different template, and| safeis an explicit opt-out that is unaffected.These are the only defects Coverity reports on the codebase, which unblocks making the Coverity stage fail on findings.