π‘οΈ Sentinel: [CRITICAL] Fix path traversal in Lua list_files pattern - #265
π‘οΈ Sentinel: [CRITICAL] Fix path traversal in Lua list_files pattern#265mleem97 wants to merge 1 commit into
Conversation
- I added validation to prevent directory traversal via the search pattern in Directory.GetFiles - I updated my sentinel journal with this learning
|
π Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a π emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
βΉοΈ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with π while any review is running, comments if it has suggestions, and reacts with π once all reviews finish with no findings. |
Not up to standards βπ΄ Issues
|
| Category | Results |
|---|---|
| Security | 1 high |
π’ Metrics 4 complexity Β· 0 duplication
Metric Results Complexity 4 Duplication 0
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Severity: CRITICAL
Vulnerability: Path Traversal (CWE-22) in
src/Infrastructure/Scripting/Lua/Modules/GregIoLuaModule.cs. Thelist_filesfunction directly passed a user-controlledpatternargument toDirectory.GetFiles(). By supplying a pattern like../*.*, an attacker could escape the sandboxeddataDirand list arbitrary files on the system.Impact: An attacker could exploit this to list sensitive files outside of the intended sandbox directory, leading to information disclosure.
Fix: Added validation to the
patternargument inlist_filesto throw anUnauthorizedAccessExceptionif it contains path traversal characters (..,/,\). Added inline comment// [Security] Prevent path traversal via pattern in Directory.GetFiles.Verification: Ran
dotnet testto ensure all tests pass. Tested locally using a temporary console app to verify thatDirectory.GetFilesis indeed vulnerable to path traversal via the search pattern and that rejecting patterns with..prevents it.PR created automatically by Jules for task 5095109451561560952 started by @mleem97