fix(cypress-image): resolve critical security vulnerabilities#2713
Open
billhimmelsbach wants to merge 5 commits intomasterfrom
Open
fix(cypress-image): resolve critical security vulnerabilities#2713billhimmelsbach wants to merge 5 commits intomasterfrom
billhimmelsbach wants to merge 5 commits intomasterfrom
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Let's fix some security vulnerabilities in the old cypress image! Upgrading to the latest cypress image fixes a lot of the critical issues... except for two in the crypto/tls and undici libraries.
These remaining vulnerabilities are especially annoying to fix since they're wrapped up in cypress: cypress runs a post-install script that installs the electron app with a bunch of it's own pre-installed node modules like a jerk. So package.json resolutions don't appear to work since yarn/npm isn't involved in the installation of them, so for the remaining two critical vulnerabilities we gotta go in there and replace them manually.
I experimented with fixing all the non-critical, high vulnerabilities with this method, but I think we should wait to see if cypress fixes themselves since this method is brittle/prone to causing issues, and added a ticket to track that GHE #2711.
Changes
experimentalStudio: truesince it's no longer experimental in cypress v15Testing
Try yarn installing before testing anything out and cypress should work from there. But if you encounter issues, because cypress can be a little finicky sometimes, I'd recommend the following:
clear the cache and reinstall
Still getting a weird
Cannot find module '@ffprobe-installer/darwin-x64/ffprobe'error when on your Mac? Make sure the env varnpm_config_archis unset before you run the commands above, and maybe reach out to me if you're still having issues.local run
ci run
Notes
Cypress.env()and instead replace it with two different ways of accessing env vars:cy.env()(for sensitive secrets) orCypress.expose()(for public envs). For now we're fine, but we'll want to fix it for the next version that happens someday. Here's the ticket I made for future us: GHE #5493Resolves GHE #5478