Commit ddea515
fix: validate reviewAgentLogPath to prevent path injection (#1134)
* fix: validate reviewAgentLogPath to prevent path injection
Add path validation to invokeDiffReviewLlm to ensure the log path
stays within the expected DATA_CACHE_DIR/review-agent directory.
This addresses CodeQL alert #19 (js/path-injection) by resolving
the path and verifying it does not escape the log directory.
The validation is performed before each fs.appendFileSync call
to prevent path traversal attacks even if the call chain changes
in the future.
Co-authored-by: Michael Sukkarieh <msukkari@users.noreply.github.com>
* chore: add CHANGELOG entry for path injection fix
Co-authored-by: Michael Sukkarieh <msukkari@users.noreply.github.com>
* refactor: share REVIEW_AGENT_LOG_DIR constant between app.ts and invokeDiffReviewLlm.ts
Export the log directory constant from invokeDiffReviewLlm.ts and
import it in app.ts to ensure a single source of truth for the
review agent log directory path.
Co-authored-by: Michael Sukkarieh <msukkari@users.noreply.github.com>
* docs: add guidance to link PRs to Linear issues in PR description
Co-authored-by: Michael Sukkarieh <msukkari@users.noreply.github.com>
* fix: use lazy evaluation for REVIEW_AGENT_LOG_DIR to fix build
Change REVIEW_AGENT_LOG_DIR from a top-level constant to a
getReviewAgentLogDir() function to avoid evaluating env.DATA_CACHE_DIR
at module load time, which fails during Next.js build when
environment variables are not yet available.
Co-authored-by: Michael Sukkarieh <msukkari@users.noreply.github.com>
* docs: add requirement to run tests and build before pushing
Co-authored-by: Michael Sukkarieh <msukkari@users.noreply.github.com>
* Revert "docs: add requirement to run tests and build before pushing"
This reverts commit 476081e.
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Michael Sukkarieh <msukkari@users.noreply.github.com>1 parent da92ca1 commit ddea515
4 files changed
Lines changed: 19 additions & 1 deletion
File tree
- packages/web/src/features/agents/review-agent
- nodes
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
| 279 | + | |
279 | 280 | | |
280 | 281 | | |
281 | 282 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
33 | | - | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
Lines changed: 15 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 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
9 | 22 | | |
10 | 23 | | |
11 | 24 | | |
| |||
19 | 32 | | |
20 | 33 | | |
21 | 34 | | |
| 35 | + | |
22 | 36 | | |
23 | 37 | | |
24 | 38 | | |
| |||
32 | 46 | | |
33 | 47 | | |
34 | 48 | | |
| 49 | + | |
35 | 50 | | |
36 | 51 | | |
37 | 52 | | |
| |||
0 commit comments