Skip to content

fix: load CLI package.json via static require - #1923

Merged
chrisvxd merged 1 commit into
mainfrom
xavie/puck-626-monitor-failing-on-nodejs-potential-path
Nov 19, 2026
Merged

chrisvxd merged 1 commit into
mainfrom
xavie/puck-626-monitor-failing-on-nodejs-potential-path

Conversation

@xaviemirmon

Copy link
Copy Markdown
Collaborator

Fixes PUCK-626.

Oneleet flagged require(pkgPath) in packages/core/bin/cli.mjs as a potential path traversal because require received a variable. It was a false positive, since pkgPath comes from require.resolve on a fixed package name. This PR passes the literal "@puckeditor/cli/package.json" to require instead, so the next scan should clear the finding.

Runtime behaviour doesn't change: require and require.resolve look up the same file. pkgPath stays because the script uses it to find the CLI's directory.

Testing

  • node packages/core/bin/cli.mjs --help prints the CLI help and exits 0
  • node packages/core/bin/cli.mjs --version matches the installed @puckeditor/cli version

🤖 Generated with Claude Code

@vercel

vercel Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
puck-demo Ready Ready Preview Nov 18, 2026 5:52pm UTC
puck-docs Ready Ready Preview Nov 18, 2026 5:52pm UTC

Request Review

@chrisvxd
chrisvxd merged commit 4391457 into main Nov 19, 2026
5 checks passed
@chrisvxd
chrisvxd deleted the xavie/puck-626-monitor-failing-on-nodejs-potential-path branch November 19, 2026 11:45

This branch was successfully deployed

2 active deployments
Preview – puck-docs — d8550736 Deployed Nov 18, 2026 by vercel[bot]
Preview – puck-demo — d8550736 Deployed Nov 18, 2026 by vercel[bot]
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.

2 participants