-
Notifications
You must be signed in to change notification settings - Fork 247
Security: Pin axios to mitigate supply chain attack #2379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
CChanHY
wants to merge
5
commits into
Mentra-Community:main
Choose a base branch
from
CChanHY:security/pin-axios
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
fc26ada
Pin axios to 1.14.0 to mitigate supply chain attack (axios@1.14.1, ax…
1832ee3
Update root package-lock.json with pinned axios version
543a2f0
Add resolutions field for bun/yarn compatibility
061a535
Update lock files with pinned axios version
dac0956
Add trustedDependencies allowlist for lifecycle scripts
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: Mentra-Community/MentraOS
Length of output: 434
🏁 Script executed:
Repository: Mentra-Community/MentraOS
Length of output: 3336
🌐 Web query:
pnpm overrides field top-level vs pnpm.overrides nested syntax💡 Result:
In pnpm (version 10.x as of 2026), the overrides field is a top-level key used in pnpm-workspace.yaml at the root of the project (or workspace). It cannot be set in sub-packages and must be at the project root. Example in pnpm-workspace.yaml: overrides: foo: ^1.0.0 In package.json, pnpm-specific overrides are nested under the pnpm.overrides field (though official docs emphasize pnpm-workspace.yaml; package.json usage is common in practice, especially for non-workspace projects or root package.json). Example in root package.json: { "pnpm": { "overrides": { "foo": "^1.0.0" } } } pnpm does NOT natively support npm-style top-level overrides in package.json (e.g., "overrides": { "foo": "^1.0.0" }) due to differences in resolution algorithms. Top-level overrides is ignored by pnpm; use pnpm.overrides or pnpm-workspace.yaml instead. This is a long-standing design choice, with open issues requesting compatibility. Key differences: - pnpm-workspace.yaml: Top-level overrides (preferred for workspaces, official docs). - package.json: Nested pnpm.overrides (works in root, common in tutorials). Both achieve the same: overriding dependencies project-wide. Use root location only.
Citations:
🌐 Web query:
bun package manager resolutions vs overrides dependency resolution💡 Result:
In Bun package manager, "overrides" and "resolutions" are equivalent mechanisms for forcing specific versions of dependencies (including metadependencies/transitive dependencies) anywhere in the dependency tree. There is no difference between them in Bun. Both are supported in package.json at the top level: - "overrides": npm-style syntax - "resolutions": Yarn-style syntax (for easier migration from Yarn) Example: { "overrides": { "bar": "~4.4.0" } } or { "resolutions": { "bar": "~4.4.0" } } Bun forces the specified version of "bar" for all occurrences, direct or nested. Limitations (as of latest docs): - Only top-level (flat) overrides/resolutions supported; nested/scoped not supported (warns and ignores). - Only read from root package.json (not workspace children). They serve the same purpose: override dependency resolution to pin versions (e.g., for security fixes), with identical behavior and syntax.
Citations:
Critical:
overridesfield will be ignored by pnpm.The repository has
pnpm-lock.yamlat the root (lockfileVersion 9.0), indicating pnpm is the active package manager. However, pnpm does not recognize top-level"overrides"in package.json—it requires the field nested under the"pnpm"key or defined inpnpm-workspace.yaml.As a result, transitive dependencies pulling in compromised axios versions won't be blocked by pnpm. The field will have no effect on dependency resolution in pnpm workspaces.
Note: bun (used in
cloud/**) supports the current"overrides"syntax at the top level, so no changes are needed there. The issue is pnpm-specific.🔒 Proposed fix for pnpm compatibility
"scripts": { "prepare": "husky", "generate-licenses": "bun docs/generate-licenses.ts" }, - "overrides": { - "axios@>=1": "1.14.0", - "axios@<1": "0.30.3", - "plain-crypto-js": "0.0.0-blocked" + "pnpm": { + "overrides": { + "axios@>=1": "1.14.0", + "axios@<1": "0.30.3", + "plain-crypto-js": "0.0.0-blocked" + } }📝 Committable suggestion
🤖 Prompt for AI Agents