Skip to content

Harden supply chain security#18

Merged
yosriady merged 2 commits into
mainfrom
sec/npm-sec
May 20, 2026
Merged

Harden supply chain security#18
yosriady merged 2 commits into
mainfrom
sec/npm-sec

Conversation

@yosriady
Copy link
Copy Markdown
Collaborator

@yosriady yosriady commented May 20, 2026


View in Codesmith
Need help on this PR? Tag @codesmith with what you need.

  • Let Codesmith autofix CI failures and bot reviews

yosriady and others added 2 commits May 20, 2026 14:34
The dependency pin in package.json (^3.2.0 → 3.2.0) left the
lockfile specifier out of sync, which broke `pnpm install
--frozen-lockfile` in CI. The resolved version is unchanged
(3.2.0); only the specifier field is updated. A full `pnpm
install` would have been blocked by the 7d minimumReleaseAge
cooldown against a recently-bumped transitive, so the lockfile
is edited surgically.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request pins the ethereum-cryptography dependency to a specific version and increases the minimumReleaseAge for package updates to 7 days. Review feedback advises against pinning dependencies in a library to prevent version conflicts for consumers and suggests that a 7-day delay for updates may be too long, potentially delaying critical security patches.

Comment thread package.json
},
"dependencies": {
"ethereum-cryptography": "^3.2.0"
"ethereum-cryptography": "3.2.0"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Pinning a dependency to an exact version in a library's package.json can lead to dependency conflicts for consumers. It prevents the package manager from deduplicating the dependency if other packages in the consumer's tree require a compatible but different version. For libraries, it is generally recommended to use semver ranges (e.g., ^3.2.0) and rely on the lockfile for reproducible development.

Suggested change
"ethereum-cryptography": "3.2.0"
"ethereum-cryptography": "^3.2.0"

Comment thread pnpm-workspace.yaml
Comment on lines +11 to +12
# are at least 10080 minutes (7d) old. pnpm 11's default is 1440 (24h).
minimumReleaseAge: 10080
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

security-medium medium

Setting minimumReleaseAge to 7 days (10080 minutes) significantly delays the availability of all new dependency versions, including critical security patches. While this mitigates the risk of "poisoned" packages, it introduces a window of vulnerability where the project cannot easily update to a patched version of a dependency after a vulnerability is disclosed. A shorter window (e.g., 24 to 48 hours) is typically sufficient to catch most malicious releases while allowing for faster response to legitimate security updates.

# are at least 2880 minutes (48h) old. pnpm 11's default is 1440 (24h).
minimumReleaseAge: 2880

@yosriady yosriady merged commit af227a1 into main May 20, 2026
9 checks passed
@yosriady yosriady deleted the sec/npm-sec branch May 20, 2026 07:44
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.

1 participant