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
7 changes: 7 additions & 0 deletions .jules/sentinel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## 2024-05-24 - Command Injection Risk in docker logs endpoint
**Vulnerability:** Node.js `execSync` combined with unsanitized URL query parameters (`id` and `tail`) directly interpolated into a shell string caused a command injection vulnerability. Additionally, user-controlled flags were not validated.
**Learning:** Raw shell execution functions (like `execSync`) evaluate shell meta-characters. Interpolating user inputs into these functions exposes the application to remote code execution (RCE) and argument/flag injection.
**Prevention:**
1. Prefer `execFile` or `execFileAsync` where parameters are provided as an array so they are not evaluated by the shell.
2. Explicitly validate variables meant to be command arguments to ensure they do not start with hyphens (`-`) to avoid flag injection.
3. Separate executable targets and variables using double-dashes (`--`) if the command supports it.
Loading