Skip to content
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

🐛 Bug Report: Backstage 1.16 have a critical vulnerability for tough-cookie 2.5.0 in Cypress and @backstage/backend-common modules #18827

Closed
2 tasks done
bbasu opened this issue Jul 28, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@bbasu
Copy link

bbasu commented Jul 28, 2023

📜 Description

After upgrading to Backstage 1.16 we still have a critical vulnerabiity for tough-cookie 2.5.0. When we trace it through

 yarn why tough-cookie

we see that the 2.5.0 version is being referenced in 2 places like below:

yarn why tough-cookie
yarn why v1.22.17
[1/4] Why do we have the module "tough-cookie"...?
[2/4] Initialising dependency graph...
[3/4] Finding dependency...
[4/4] Calculating file sizes...
=> Found "tough-cookie@2.5.0"
info Has been hoisted to "tough-cookie"
info Reasons this module exists

  • "workspace-aggregator-29dc2367-ed34-4cdd-ae81-ed1b0258236e" depends on it
    **- Hoisted from "project#app#cypress#@cypress#request#tough-cookie"
  • Hoisted from "project#backend#@backstage#backend-common#@kubernetes#client-node#request#tough-cookie"**
    info Disk size without dependencies: "104KB"
    info Disk size with unique dependencies: "620KB"
    info Disk size with transitive dependencies: "620KB"
    info Number of shared dependencies: 2
    => Found "jsdom#tough-cookie@4.1.3"
    info This module exists because "project#@backstage#cli#jest-environment-jsdom#jsdom" depends on it.
    info Disk size without dependencies: "132KB"
    info Disk size with unique dependencies: "744KB"
    info Disk size with transitive dependencies: "788KB"
    info Number of shared dependencies: 5
    => Found "isomorphic-dompurify#tough-cookie@4.1.3"
    info Reasons this module exists
  • "project#app#@backstage#plugin-api-docs#@asyncapi#react-component#isomorphic-dompurify#jsdom" depends on it
  • Hoisted from "project#app#@backstage#plugin-api-docs#@asyncapi#react-component#isomorphic-dompurify#jsdom#tough-cookie"
    info Disk size without dependencies: "132KB"
    info Disk size with unique dependencies: "744KB"
    info Disk size with transitive dependencies: "788KB"
    info Number of shared dependencies: 5
    Done in 1.57s.

Cypress and @backstage/backend-common. Can some one tell us how to make these modules use the latest tough-cookie v4.1.3? Or is this something that needs an update the owners of Cypress and @backstage/backend-common modules?

👍 Expected behavior

Cypress and @backstage/backend-common should include the latest version of tough-cookie as a dependency

👎 Actual Behavior with Screenshots

Cypress and @backstage/backend-common includes the latest a vulnerable version of tough-cookie (2.5.0) as a dependency

👟 Reproduction steps

In the project, run

yarn audit

yarn why tough-cookie

📃 Provide the context for the Bug.

Tried upgrading backstage to the latest 1.16 version

🖥️ Your Environment

No response

👀 Have you spent some time to check if this bug has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

Are you willing to submit PR?

Yes I am willing to submit a PR!

@bbasu bbasu added the bug Something isn't working label Jul 28, 2023
@bbasu bbasu changed the title 🐛 Bug Report: <title> 🐛 Bug Report: Backstage 1.16 have a critical vulnerability for tough-cookie 2.5.0 in Cypress and @backstage/backend-common modules Jul 28, 2023
@awanlin
Copy link
Collaborator

awanlin commented Jul 28, 2023

Hi @bbasu, in this case this is not a direct dependency of Backstage packages but of other packages used by Backstage. In this case you there are tools like Renovate, Dependabot, or Snyk that would help identify and upgrade for you.

@Rugvip
Copy link
Member

Rugvip commented Jul 31, 2023

We're bringing in a vulnerable version of tough-cookie due to @kubernetes/client-node, which in turn depends on the deprecated request package. There's a migration ongoing: kubernetes-client/javascript#754.

The latest version of jsdom no longer depends on a vulnerable version of tough-cookie, so you'll be able to bump that version on your end.

I would imagine that there's no actual expose to the vulnerability in tough-cookie in practice, as it seems to be related only to the cookie jar, and I'd be surprised if that was used in @kubernetes/client-node. It's not something I've verified though.

@iamvolvo
Copy link

iamvolvo commented Sep 27, 2023

Would you say this is a duplicate of #18742 ?
If yes, should we close one of them?
Thanks!

@Rugvip
Copy link
Member

Rugvip commented Sep 28, 2023

Ah yep I will close this, since #18742 is an automatically generated issue

@Rugvip Rugvip closed this as completed Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants