Skip to content

fix: codecarto_publish reads the spec_path it checked - #383

Merged
TheAmericanMaker merged 1 commit into
mainfrom
fix/readspec-canonical
Sep 16, 2026
Merged

TheAmericanMaker merged 1 commit into
mainfrom
fix/readspec-canonical

Conversation

@TheAmericanMaker

Copy link
Copy Markdown
Member

Summary

Closes #362. Verified on main: readSpecArg computes resolvedSpecPath for the containment check and then calls readFile(args.spec_path). One line: the read now uses resolvedSpecPath, so what was checked is what is read. The swap window itself is a timing property no test can pin deterministically; the fix does not depend on it.

Test plan

  • tests/publish-path-containment.test.mjs: a symlink inside the root reads its target through the resolved path; the source is pinned to read resolvedSpecPath.
  • npm run build + npm test — 931 pass.

🤖 Generated with Claude Code

readSpecArg checked the canonical path and read the original string; a
symlink swap between the two could re-point the read outside the allowed
roots. The read goes through the canonical path.

Closes #362

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@TheAmericanMaker
TheAmericanMaker merged commit b271df1 into main Sep 16, 2026
5 checks passed
@TheAmericanMaker
TheAmericanMaker deleted the fix/readspec-canonical branch September 16, 2026 01:59
@TheAmericanMaker TheAmericanMaker mentioned this pull request Sep 16, 2026
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.

readSpecArg reads the original path after checking the canonical one

1 participant