Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .jules/sentinel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## 2025-05-18 - Prevent Command Injection on Windows File Open

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟑 Minor | ⚑ Quick win

Verify the sentinel entry date.

The date 2025-05-18 predates the PR creation timestamp (2026-06-13T11:44:12Z) by over a year. Please confirm whether this is the intended date or if it should be updated to reflect when the vulnerability was actually identified and fixed.

πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.jules/sentinel.md at line 1, Confirm whether the sentinel entry date
"2025-05-18" is correct and, if it should reflect the PR or discovery date
instead, update that date string in the sentinel entry header to the intended
date (e.g., the PR/discovery date) or add a clarifying note stating why the
earlier date is accurate.

**Vulnerability:** `subprocess.call(['start', filename], shell=True)` allows command injection on Windows because filenames can legally contain shell metacharacters like `&` and `^`.
**Learning:** Checking `os.path.isfile()` is insufficient to prevent shell injection when `shell=True` is used.
**Prevention:** Always use `os.startfile(filename)` to open files on Windows instead of invoking `start` through a shell.
2 changes: 1 addition & 1 deletion libs/utility_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def _open_resource_file(self, filename):
try:
if os.path.isfile(filename):
if platform.system() == "Windows":
subprocess.call(['start', filename], shell=True)
os.startfile(filename)
elif platform.system() == "Darwin":
subprocess.call(['open', filename])
elif platform.system() == "Linux":
Expand Down
Loading