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

Transitive dependency on vulnerable version of cross-spawn #4640

Open
1 task done
mlc opened this issue Nov 25, 2024 · 5 comments
Open
1 task done

Transitive dependency on vulnerable version of cross-spawn #4640

mlc opened this issue Nov 25, 2024 · 5 comments

Comments

@mlc
Copy link

mlc commented Nov 25, 2024

What happened?

Detox depends on child-process-promise, which in turn depends on cross-spawn@^4.0.2. However, versions of cross-spawn prior to 6.0.6 are vulnerable to a REDoS vulnerability.

What was the expected behaviour?

Detox should presumably switch away from child-process-promise and towards something more actively maintained, I guess?, or figure out another way to mitigate this vulnerability.

Was it tested on latest Detox?

  • I have tested this issue on the latest Detox release and it still reproduces.

Help us reproduce this issue!

No response

In what environment did this happen?

No response

Detox logs

No response

Device logs

No response

More data, please!

No response

@Seraphiyra
Copy link

We are also getting notified about this via Snyk

@lundn
Copy link

lundn commented Dec 2, 2024

We're also getting warned about this through Dependabot

@carldsparks3
Copy link

carldsparks3 commented Dec 3, 2024

I started getting warnings about this from npm audit.

I see at least 1 other dependency that contains a vulnerable version of "cross-spawn" in Detox 20.28.0. The dev dependency for the Detox project, "cross-env". Detox currently specifies version 7.0.3 of "cross-env" which then specifies version 7.0.1 of "cross-spawn" as a dependency.

The "cross-env" project is currently archived since it is in maintenance mode.

EDIT:
I currently added a package override to my project's main package.json file while waiting for an official solution.

"overrides": { "cross-spawn": "^7.0.6" }

@noomorph
Copy link
Collaborator

noomorph commented Dec 4, 2024

I see. I'll try to take this during December. Thanks for the report.

@noomorph noomorph self-assigned this Dec 4, 2024
@thomashohn
Copy link

thomashohn commented Dec 10, 2024

You could switch to promisify-child-process - seems to work at a couple of places - but could not make it work in BinaryExec.js doesn't seem that it can be a drop in replacement there:

At least the
const spawn = require('child-process-promise').spawn;
=>
const { spawn } = require('promisify-child-process');

does not work - maybe you have a suggestion?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants