Repository navigation
fix: prevent path traversal vulnerability in checkpoint manager - #23
awhite0030 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. |
|
nc-review could not produce a verdict this run (agent exit |
|
Automated validation failed. A follow-up fix session will continue from this branch. |
Root cause: The checkpoint manager wrote and read snapshot files at
path.join(checkpointDir, relativePath)without ensuringrelativePathstays within thefilesdirectory. This permitted a path traversal vulnerability where file reads or writes could escape the workspace sandbox ifrelativePathwas manipulated (e.g.../../etc/passwd).Fix: Implemented path validation checks within both
saveCheckpointandloadCheckpoint. The fix resolves the target file path and ensures it starts with the resolvedfilesbase directory path separator, preventing any paths from escaping the directory. A changeset file is added and tests are added for both read and write traversal cases.Validation:
All commands succeeded without errors, and AVA correctly passed the 2 new regression tests checking for correct traversal prevention.
Fixes Nano-Collective#1148