Commit 13d6c59
fix: validate reviewAgentLogPath to prevent path injection
Add path validation in invokeDiffReviewLlm to ensure the log file path
stays within the expected review-agent directory. This prevents potential
path traversal attacks by validating that the resolved path starts with
the expected base directory (DATA_CACHE_DIR/review-agent).
Fixes CodeQL js/path-injection alerts #18 and #19.
Co-authored-by: Michael Sukkarieh <msukkari@users.noreply.github.com>1 parent 2c89825 commit 13d6c59
1 file changed
Lines changed: 14 additions & 0 deletions
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
9 | 19 | | |
10 | 20 | | |
11 | 21 | | |
12 | 22 | | |
13 | 23 | | |
14 | 24 | | |
15 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
16 | 30 | | |
17 | 31 | | |
18 | 32 | | |
| |||
0 commit comments