π‘οΈ Sentinel: [CRITICAL] Fix path traversal bypass in Lua IO module#18
π‘οΈ Sentinel: [CRITICAL] Fix path traversal bypass in Lua IO module#18mleem97 wants to merge 1 commit into
Conversation
|
π 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. |
π¨ Severity: CRITICAL
π‘ Vulnerability: A prefix-matching path traversal bypass existed in
GregIoLuaModule.cs. The module usedString.StartsWithto ensure the resolved path started with the sandbox base directory. However, because the base directory string did not strictly end in a directory separator, a requested path like/base/data-secretwould successfully evaluate asStartsWith("/base/data")allowing arbitrary read/write access to matching folders outside the intended sandbox.π― Impact: Malicious Lua scripts could potentially escape the intended sandbox (
/modDir/data/) and read, write, or delete files in adjacent directories that share the same string prefix, potentially compromising mod or game data.π§ Fix: Appended
Path.DirectorySeparatorChartodataDirFullif it doesn't already have a trailing separator before performing theStartsWithcheck. Documented the pattern in.jules/sentinel.md.β Verification: Compiled the solution successfully (
dotnet build gregCore.csproj -c Release) to ensure no regressions and verified logic locally.PR created automatically by Jules for task 7332935971261093362 started by @mleem97