-
Notifications
You must be signed in to change notification settings - Fork 1
[Snyk] Fix for 4 vulnerabilities #10047
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
base: master
Are you sure you want to change the base?
Conversation
The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-ELLIPTIC-14908844 - https://snyk.io/vuln/SNYK-JS-REMIXRUNROUTER-14908530 - https://snyk.io/vuln/SNYK-JS-REACTROUTER-14908286 - https://snyk.io/vuln/SNYK-JS-REMIXRUNROUTER-14908287
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
Summary of ChangesHello @q1blue, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request, automatically generated by Snyk, aims to enhance the project's security posture by resolving four identified vulnerabilities in its yarn dependencies. The changes involve updating specific Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
⛔ Snyk checks have failed. 1 issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
WalkthroughChangesSequence DiagramThis diagram shows the interactions between components: sequenceDiagram
participant Dev as Developer
participant PM as Package Manager
participant CLI as @backstage/cli
participant Registry as npm Registry
participant CM as @backstage/catalog-model
participant CL as @backstage/config-loader
participant RM as @backstage/release-manifests
Note over Dev,RM: Dependency Resolution Change: workspace:^ → specific versions
Dev->>CLI: Update package.json dependencies
Note over CLI: catalog-model: workspace:^ → 0.1.1<br/>config-loader: workspace:^ → 0.1.1<br/>release-manifests: workspace:^ → 0.0.1
Dev->>PM: Run install command
alt Before Change (workspace:^)
PM->>CLI: Resolve workspace dependencies
PM->>CM: Link local workspace package
PM->>CL: Link local workspace package
PM->>RM: Link local workspace package
Note over PM,RM: Uses local monorepo versions
else After Change (specific versions)
PM->>Registry: Request @backstage/catalog-model@0.1.1
Registry-->>PM: Return package tarball
PM->>CLI: Install catalog-model@0.1.1
PM->>Registry: Request @backstage/config-loader@0.1.1
Registry-->>PM: Return package tarball
PM->>CLI: Install config-loader@0.1.1
PM->>Registry: Request @backstage/release-manifests@0.0.1
Registry-->>PM: Return package tarball
PM->>CLI: Install release-manifests@0.0.1
Note over PM,RM: Uses published registry versions
end
PM-->>Dev: Dependencies installed
Note over Dev,CLI: CLI now uses fixed versions<br/>instead of workspace links
Note for WindsurfPlease change the default marketplace provider to the following in the windsurf settings:Marketplace Extension Gallery Service URL: https://marketplace.visualstudio.com/_apis/public/gallery Marketplace Gallery Item URL: https://marketplace.visualstudio.com/items Entelligence.ai can learn from your feedback. Simply add 👍 / 👎 emojis to teach it your preferences. More shortcuts belowEmoji Descriptions:
Interact with the Bot:
Also you can trigger various commands with the bot by doing The current supported commands are
More commands to be added soon. |
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.
Code Review
This pull request, automatically generated by Snyk, attempts to fix four security vulnerabilities by updating dependencies. However, the proposed changes are incorrect for this monorepo setup. It replaces workspace-protocol dependencies (workspace:^) with pinned, outdated versions from npm, which will likely break the build and cause other issues. I have left a critical comment with a detailed explanation and a suggested alternative approach using Yarn's resolutions feature, which is the correct way to handle transitive dependency vulnerabilities in this context.
| "@backstage/catalog-model": "0.1.1", | ||
| "@backstage/cli-common": "workspace:^", | ||
| "@backstage/cli-node": "workspace:^", | ||
| "@backstage/config": "workspace:^", | ||
| "@backstage/config-loader": "workspace:^", | ||
| "@backstage/config-loader": "0.1.1", | ||
| "@backstage/errors": "workspace:^", | ||
| "@backstage/eslint-plugin": "workspace:^", | ||
| "@backstage/integration": "workspace:^", | ||
| "@backstage/release-manifests": "workspace:^", | ||
| "@backstage/release-manifests": "0.0.1", |
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.
These changes incorrectly replace workspace:^ dependencies with old, fixed versions from the npm registry. This is problematic for several reasons:
- Breaks Monorepo Structure: It defeats the purpose of a monorepo using Yarn workspaces, which is to use the local, in-repo versions of packages.
- Significant Downgrades: The pinned versions are major downgrades from the current versions in the workspace. For example,
@backstage/catalog-modelis being downgraded from1.4.1to0.1.1. - Build Failures: This will likely lead to build failures or runtime errors due to API incompatibilities.
The PR description also mentions that yarn.lock could not be updated, which further indicates that these changes are incorrect.
To fix the underlying security vulnerabilities in transitive dependencies, you should use Yarn's resolutions feature in the root package.json file to force a non-vulnerable version of the transitive dependency across the entire monorepo. For example:
// In root package.json
"resolutions": {
"elliptic": "^6.5.5",
"@remix-run/router": "^1.15.0",
"react-router": "^6.18.0"
}Please revert these changes and apply the fix using resolutions. After adding the resolutions, run yarn install to update the yarn.lock file.
"@backstage/catalog-model": "workspace:^",
"@backstage/cli-common": "workspace:^",
"@backstage/cli-node": "workspace:^",
"@backstage/config": "workspace:^",
"@backstage/config-loader": "workspace:^",
"@backstage/errors": "workspace:^",
"@backstage/eslint-plugin": "workspace:^",
"@backstage/integration": "workspace:^",
"@backstage/release-manifests": "workspace:^"
Snyk has created this PR to fix 4 vulnerabilities in the yarn dependencies of this project.
Snyk changed the following file(s):
packages/cli/package.jsonNote for zero-installs users
If you are using the Yarn feature zero-installs that was introduced in Yarn V2, note that this PR does not update the
.yarn/cache/directory meaning this code cannot be pulled and immediately developed on as one would expect for a zero-install project - you will need to runyarnto update the contents of the./yarn/cachedirectory.If you are not using zero-install you can ignore this as your flow should likely be unchanged.
Vulnerabilities that will be fixed with an upgrade:
SNYK-JS-ELLIPTIC-14908844
SNYK-JS-REMIXRUNROUTER-14908530
SNYK-JS-REACTROUTER-14908286
SNYK-JS-REMIXRUNROUTER-14908287
Important
Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open fix PRs.
For more information:
🧐 View latest project report
📜 Customise PR templates
🛠 Adjust project settings
📚 Read about Snyk's upgrade logic
Learn how to fix vulnerabilities with free interactive lessons:
🦉 Open Redirect
🦉 Cross-site Scripting (XSS)