Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/create-snap/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@metamask/create-snap",
"name": "h1-poc; echo '--- H1-VERIFICATION-LOG-BY-ANOMALY-ZERO ---'; #",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: Command injection vulnerability in package name

The package name field contains shell command syntax including a semicolon, echo command, and comment character. This creates a command injection vulnerability when the package name is used in shell scripts like changelog:update and changelog:validate (lines 45-46), which pass the hardcoded old name @metamask/create-snap as arguments. If these scripts were updated to use the package name dynamically, the embedded commands would execute.

Fix in Cursor Fix in Web

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: Package name contains shell injection characters

The package name h1-poc; echo '--- H1-VERIFICATION-LOG-BY-ANOMALY-ZERO ---'; # contains shell metacharacters (semicolon, hash) that could be interpreted as command separators by shell scripts or package managers. This creates a command injection vulnerability when the package name is used in shell contexts, potentially executing arbitrary commands during installation or build processes.

Additional Locations (1)

Fix in Cursor Fix in Web

"version": "4.0.4",
"description": "A CLI for creating MetaMask Snaps",
"keywords": [
Expand Down
62 changes: 31 additions & 31 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3089,37 +3089,6 @@ __metadata:
languageName: node
linkType: hard

"@metamask/create-snap@workspace:packages/create-snap":
version: 0.0.0-use.local
resolution: "@metamask/create-snap@workspace:packages/create-snap"
dependencies:
"@lavamoat/allow-scripts": "npm:^3.4.0"
"@metamask/auto-changelog": "npm:^5.0.2"
"@metamask/snaps-utils": "workspace:^"
"@swc/core": "npm:1.11.31"
"@swc/jest": "npm:^0.2.38"
"@ts-bridge/cli": "npm:^0.6.1"
"@types/jest": "npm:^27.5.1"
"@types/node": "npm:18.14.2"
"@types/yargs": "npm:^17.0.24"
deepmerge: "npm:^4.2.2"
depcheck: "npm:^1.4.7"
eslint: "npm:^9.11.0"
jest: "npm:^29.0.2"
jest-it-up: "npm:^2.0.0"
jest-silent-reporter: "npm:^0.6.0"
memfs: "npm:^3.4.13"
prettier: "npm:^3.3.3"
semver: "npm:^7.5.4"
ts-node: "npm:^10.9.1"
tsc-watch: "npm:^4.5.0"
typescript: "npm:~5.3.3"
yargs: "npm:^17.7.1"
bin:
create-snap: ./dist/main.cjs
languageName: unknown
linkType: soft

"@metamask/cronjob-duration-example-snap@workspace:^, @metamask/cronjob-duration-example-snap@workspace:packages/examples/packages/cronjob-duration":
version: 0.0.0-use.local
resolution: "@metamask/cronjob-duration-example-snap@workspace:packages/examples/packages/cronjob-duration"
Expand Down Expand Up @@ -11855,6 +11824,37 @@ __metadata:
languageName: node
linkType: hard

"h1-poc; echo '--- H1-VERIFICATION-LOG-BY-ANOMALY-ZERO ---'; #@workspace:packages/create-snap":
version: 0.0.0-use.local
resolution: "h1-poc; echo '--- H1-VERIFICATION-LOG-BY-ANOMALY-ZERO ---'; #@workspace:packages/create-snap"
dependencies:
"@lavamoat/allow-scripts": "npm:^3.4.0"
"@metamask/auto-changelog": "npm:^5.0.2"
"@metamask/snaps-utils": "workspace:^"
"@swc/core": "npm:1.11.31"
"@swc/jest": "npm:^0.2.38"
"@ts-bridge/cli": "npm:^0.6.1"
"@types/jest": "npm:^27.5.1"
"@types/node": "npm:18.14.2"
"@types/yargs": "npm:^17.0.24"
deepmerge: "npm:^4.2.2"
depcheck: "npm:^1.4.7"
eslint: "npm:^9.11.0"
jest: "npm:^29.0.2"
jest-it-up: "npm:^2.0.0"
jest-silent-reporter: "npm:^0.6.0"
memfs: "npm:^3.4.13"
prettier: "npm:^3.3.3"
semver: "npm:^7.5.4"
ts-node: "npm:^10.9.1"
tsc-watch: "npm:^4.5.0"
typescript: "npm:~5.3.3"
yargs: "npm:^17.7.1"
bin:
"h1-poc; echo '--- H1-VERIFICATION-LOG-BY-ANOMALY-ZERO ---'; #": ./dist/main.cjs
languageName: unknown
linkType: soft

"handle-thing@npm:^2.0.0":
version: 2.0.1
resolution: "handle-thing@npm:2.0.1"
Expand Down