Skip to content

test: add OpenClaw bypass parity coverage#2

Merged
steipete merged 3 commits into
mainfrom
test/openclaw-read-parity
May 5, 2026
Merged

test: add OpenClaw bypass parity coverage#2
steipete merged 3 commits into
mainfrom
test/openclaw-read-parity

Conversation

@jesse-merhi
Copy link
Copy Markdown
Member

@jesse-merhi jesse-merhi commented May 5, 2026

Summary

  • expand this PR into a bypass-focused parity suite for both read-like and write-like OpenClaw migration surfaces
  • add payload-driven read tests for root().read, root().open, root().stat, root().list, pathScope, openRootFile, openPinnedFileSync, and resolveAbsolutePathForRead
  • add write/move/delete tests for root().write, root().create, root().append, root().openWritable, root().copyFrom, root().mkdir, root().remove, and root().move
  • exercise dot-dot traversal, nested traversal, slash normalization, encoded/double-encoded traversal strings, NUL-byte strings, Windows/backslash/drive/UNC-looking payloads, absolute outside paths, symlink parents, final symlink leaves, hardlinks, and no-outside-bytes/no-outside-clobber behavior

Payload 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 check

Notes

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.

Copilot AI review requested due to automatic review settings May 5, 2026 13:48
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@jesse-merhi jesse-merhi force-pushed the test/openclaw-read-parity branch from 305293d to d66cffc Compare May 5, 2026 14:05
@jesse-merhi jesse-merhi changed the title test: add OpenClaw fs read parity coverage test: add OpenClaw read bypass parity coverage May 5, 2026
@jesse-merhi jesse-merhi force-pushed the test/openclaw-read-parity branch from d66cffc to cdafee4 Compare May 5, 2026 14:14
@jesse-merhi jesse-merhi changed the title test: add OpenClaw read bypass parity coverage test: add OpenClaw bypass parity coverage May 5, 2026
@steipete steipete force-pushed the test/openclaw-read-parity branch from cdafee4 to 6afe126 Compare May 5, 2026 17:50
@steipete steipete merged commit 83c1032 into main May 5, 2026
1 check passed
@steipete steipete deleted the test/openclaw-read-parity branch May 5, 2026 17:51
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.

3 participants