Skip to content

fix(cypress-image): resolve critical security vulnerabilities#2713

Open
billhimmelsbach wants to merge 5 commits intomasterfrom
5478-resolve-critical-vulns
Open

fix(cypress-image): resolve critical security vulnerabilities#2713
billhimmelsbach wants to merge 5 commits intomasterfrom
5478-resolve-critical-vulns

Conversation

@billhimmelsbach
Copy link
Contributor

@billhimmelsbach billhimmelsbach commented Mar 21, 2026

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

  • updates us to Cypress v15 to resolve a ton of vulnerabilities (the latest Cypress 14 image didn't get us as far)
Before After
Screenshot 2026-03-20 at 5 56 51 PM test-security-no-critical-security copy
Before After
test-security-no-critical-security copy Screenshot 2026-03-20 at 7 07 28 PM
  • remove manually installing cypress with the force option, but add legacy peer deps flag because of incompatibility with cypress-keycloak v2.0.2
  • remove experimentalStudio: true since it's no longer experimental in cypress v15
  • added some cypress troubleshooting suggestions to the readme

Testing

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

yarn install
yarn yarn cypress cache clear
yarn cypress install

Still getting a weird Cannot find module '@ffprobe-installer/darwin-x64/ffprobe' error when on your Mac? Make sure the env var npm_config_arch is unset before you run the commands above, and maybe reach out to me if you're still having issues.

  1. Do the tests still run and pass locally and in CI? Yes and Yes!

local run

Screenshot 2026-03-21 at 2 51 58 PM

ci run

Screenshot 2026-03-21 at 3 25 21 PM
  1. Are the critical vulnerabilities resolved? Yes!
Screenshot 2026-03-21 at 3 25 58 PM

Notes

Resolves GHE #5478

@billhimmelsbach billhimmelsbach marked this pull request as ready for review March 21, 2026 22:40
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