Conversation
Co-authored-by: Manuel H. <LouisLetcher@users.noreply.github.com>
Co-authored-by: Manuel H. <LouisLetcher@users.noreply.github.com>
Co-authored-by: Manuel H. <LouisLetcher@users.noreply.github.com>
|
Cursor Agent can help with this pull request. Just |
Summary of ChangesHello @LouisLetcher, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the security posture of the application by addressing several critical vulnerabilities. It introduces comprehensive HTML escaping to prevent Cross-Site Scripting (XSS) in generated reports, strengthens CLI commands against path traversal and symlink escape attacks, and updates core dependencies to resolve known Common Vulnerabilities and Exposures (CVEs). These changes collectively improve the application's resilience against various security threats. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request effectively addresses several security vulnerabilities, including path traversal in CLI commands and Cross-Site Scripting (XSS) in HTML reports. The changes are well-implemented, with robust validation for user-supplied paths and comprehensive HTML escaping for dynamic content. The dependency updates to fastapi and starlette also resolve known CVEs. The addition of specific unit tests for these security fixes is a great practice and significantly increases confidence in the changes. My review includes a few suggestions to further improve code robustness and readability.
Co-authored-by: Manuel H. <LouisLetcher@users.noreply.github.com>
Co-authored-by: Manuel H. <LouisLetcher@users.noreply.github.com>
Co-authored-by: Manuel H. <LouisLetcher@users.noreply.github.com>
Co-authored-by: Manuel H. <LouisLetcher@users.noreply.github.com>
Co-authored-by: Manuel H. <LouisLetcher@users.noreply.github.com>
Co-authored-by: Manuel H. <LouisLetcher@users.noreply.github.com>
Co-authored-by: Manuel H. <LouisLetcher@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Manuel H. <36189959+LouisLetcher@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Manuel H. <36189959+LouisLetcher@users.noreply.github.com>
Co-authored-by: Manuel H. <LouisLetcher@users.noreply.github.com>
Signed-off-by: Manuel H. <36189959+LouisLetcher@users.noreply.github.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
This PR is being reviewed by Cursor Bugbot
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
Co-authored-by: Manuel H. <LouisLetcher@users.noreply.github.com>
Co-authored-by: Manuel H. <LouisLetcher@users.noreply.github.com>
Co-authored-by: Manuel H. <LouisLetcher@users.noreply.github.com>
|



Summary
This PR addresses critical security vulnerabilities identified during a repository audit, focusing on preventing XSS, path traversal, and updating vulnerable dependencies.
Changes
src/reporting/html.py):<script>tags is safely escaped to prevent XSS.src/main.py):package-run: Added robust validation forrun_idto prevent path traversal attacks when creating archives.clean-cache: Hardened directory traversal logic to prevent symlink escapes, ensuring files outside the intended cache root are not deleted.fastapito0.128.7and added a directstarletteconstraint to0.52.1inpyproject.tomlandpoetry.lockto resolve reported CVEs.How to Test
poetry installpoetry run ruff check .(should pass)poetry run pytest(all tests, including new security tests, should pass)poetry run pip-audit(should report onlypipitself as vulnerable, not application dependencies)"<img src=x onerror=alert(1)>").report.htmlin a browser; the payload should be escaped and not execute.package-runpath traversal prevention:poetry run main package-run ../../evil --reports-dir ./reports(should fail with aBadParametererror).clean-cachesymlink protection:poetry run main clean-cache --max-age-days 7. The file outside the cache root (via symlink) should not be deleted.Checklist (KISS)
pre-commit run --all-files).envvalues are excludedRelated Issues/Links
Note
Medium Risk
Touches security-sensitive areas (HTML generation and filesystem deletion/archiving) and upgrades core web dependencies, which could introduce behavior changes or edge-case regressions despite added tests.
Overview
Security hardening across reporting and CLI tooling. The HTML report generator now escapes all user-controlled fields and safely serializes JSON embedded in
<script>tags to prevent XSS; it also supports fully-offline reports by writingplotly.min.jsnext toreport.html(and exposes it as a downloadable artifact).Filesystem traversal protections.
package-runnow validatesrun_idand enforces that resolved paths stay withinreports_dir, andclean-cachenow avoids following symlink directories/files and refuses deletions that resolve outside the cache root.Infra/deps updates. Bumps
fastapi(and adds/bumps directstarlette) and refreshespoetry.lock, updates the dashboard server UI to drop Tailwind CDN usage and link reports via the app’s download endpoint instead offile://, and hardens Docker builds by pinning/installing Poetry via pip, copyingpoetry.lock, creating a non-root user, and adjusting runtime PATH/env.Written by Cursor Bugbot for commit c7557d8. This will update automatically on new commits. Configure here.