Skip to content
RCE Advisory Intermediate CVE-2020-1920

GHSL-2021-070: Command injection in react-dev-utils - CVE-2020-1920

The react-dev-utils package constructs a shell script from user input, allowing environment variable expansion. An attacker could extract environment variables and send them to an arbitrary server, but only on Mac OS X and when the function is manually invoked with user-provided values.

ghsecuritylab Follow

Originally disclosed on GitHub Security Lab

There exists a command injection, similar to CVE-2021-24033, in the react-dev-utils npm package, which is a part of Facebook’s facebook/create-react-app repository.

ghsecuritylab, on GitHub Security Lab

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely, the openBrowser function constructs a shell script from user-controlled input without properly escaping it, allowing environment variable expansion.

Impact

An attacker could extract environment variables and send them to an arbitrary server, but only on Mac OS X and only when the function is manually invoked with user-provided values; a sanitiser prevents execution of shell scripts.

What the attacker needed

Mac OS X; manual invocation with user input

The fix

The vulnerability was fixed in version 0.64.1.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

When a program builds a command for the operating system using text from an untrusted source, an attacker can sneak in extra instructions. Here, the package creates a shell script that includes the user's input, and on Macs the shell expands variables like $PATH, which can leak sensitive information. The impact is limited because a sanitiser blocks full command execution and the issue only affects Mac OS X.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More by ghsecuritylab

View all

132 more disclosed reports, best first.

More from GitHub Security Lab

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.