test: add OpenClaw bypass parity coverage#2
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds test-only coverage to support the planned OpenClaw migration by (a) documenting which raw fs.* operations are currently covered by @openclaw/fs-safe APIs and (b) asserting “read-like” bypass resistance across multiple surfaces (root APIs, path scoping, pinned/root file open helpers, and absolute-path read resolution).
Changes:
- Introduces a coverage map test that classifies each OpenClaw raw
fs.*operation as covered/partial/missing/trusted-only/out-of-scope. - Adds read bypass parity tests covering traversal attempts, symlink parents/leaves, hardlinks (when configured to reject), and absolute-path symlink behavior.
- Adds a “no outside bytes” regression test to ensure rejected paths don’t accidentally leak readable content via returned handles/results.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| test/openclaw-read-bypass-parity.test.ts | New bypass/parity tests asserting read/open/stat/list/pathScope/root-file-open behaviors against traversal, symlinks, hardlinks, and leakage. |
| test/openclaw-fs-operation-coverage.test.ts | New operation coverage map + assertions to keep missing raw fs.* operations explicit for migration planning. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
305293d to
d66cffc
Compare
d66cffc to
cdafee4
Compare
cdafee4 to
6afe126
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
root().read,root().open,root().stat,root().list,pathScope,openRootFile,openPinnedFileSync, andresolveAbsolutePathForReadroot().write,root().create,root().append,root().openWritable,root().copyFrom,root().mkdir,root().remove, androot().movePayload sources
Representative payload categories are based on common OWASP / PayloadsAllTheThings directory traversal testing guidance: dot-dot traversal, URL-encoded traversal, double encoding, null-byte strings, Windows drive paths, backslash traversal, and UNC paths.
Validation
pnpm checkNotes
This PR is intentionally test-only. The new tests did not require production fixes; where platform-looking strings are legal POSIX literals, the assertions verify they stay inside the root and do not touch outside files.