Skip to content

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

Closed
awhite0030/nanocoder
#23

Description

@akramcodez

Description

Snapshot files are written at path.join(checkpointDir, relativePath) without checking if relativePath escapes the workspace (e.g., if a model wrote an absolute path or a path containing ..). The snapshot read could thus write outside the checkpoints directory.

Environment

  • OS: Any
  • Node version: v22.20.0
  • Nanocoder version: 1.30.0
  • Provider: N/A
  • Model: N/A

Steps to Reproduce

  1. Modify metadata.filesChanged or trick the model into creating a path containing ...
  2. Trigger the checkpoint manager to save.

Expected Behavior

The path should be strictly validated and normalized to ensure it stays within the intended directory sandbox.

Actual Behavior

A path traversal vulnerability exists, allowing files to be written out of bounds.

Additional Context

  • I have searched existing issues to ensure this is not a duplicate
  • I can reproduce this issue consistently
  • This issue occurs with the latest version of nanocoder

Activity

  1. added
    bug
    on Sep 2, 2026
  2. MayurK-cmd commented on Sep 4, 2026

    @MayurK-cmd
    Contributor

    Working on this

  3. awhite0030 commented on Sep 13, 2026

    @awhite0030
  4. added a commit that references this issue on Sep 15, 2026
    8c09f9b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions