Skip to content

fix: prevent path traversal vulnerability in checkpoint manager - #23

Open
awhite0030 wants to merge 1 commit into
mainfrom
fix-path-traversal-checkpoint-manager-10972292857538799575
Open

awhite0030 wants to merge 1 commit into
mainfrom
fix-path-traversal-checkpoint-manager-10972292857538799575

Conversation

@awhite0030

@awhite0030 awhite0030 commented Sep 13, 2026 •

Copy link
Copy Markdown
Owner

Root cause: The checkpoint manager wrote and read snapshot files at path.join(checkpointDir, relativePath) without ensuring relativePath stays within the files directory. This permitted a path traversal vulnerability where file reads or writes could escape the workspace sandbox if relativePath was manipulated (e.g. ../../etc/passwd).

Fix: Implemented path validation checks within both saveCheckpoint and loadCheckpoint. The fix resolves the target file path and ensures it starts with the resolved files base 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:

pnpm run build && pnpm test:format && pnpm test:lint && pnpm test:types && pnpm test:knip && pnpm test:ava

All commands succeeded without errors, and AVA correctly passed the 2 new regression tests checking for correct traversal prevention.

Fixes Nano-Collective#1148

@google-labs-jules

Copy link
Copy Markdown

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@github-actions

Copy link
Copy Markdown

nc-review could not produce a verdict this run (agent exit 1). This is a problem with the review agent, not with your pull request. A maintainer can retry with /re-review.

@awhite0030

Copy link
Copy Markdown
Owner Author

Automated validation failed. A follow-up fix session will continue from this branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] checkpoint-manager.ts path traversal - writes outside workspace

1 participant