CVE-2024-34347 @hoppscotch/cli affected by Sandbox Escape in @hoppscotch/js-sandbox leads to RCE

High 8.4 Published Updated

Attackers can execute arbitrary code by escaping the JavaScript sandbox in Hoppscotch CLI via crafted pre-request scripts.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2024-34347?

CVE-2024-34347 is a high-severity code injection vulnerability in hoppscotch, published on 8 May 2024. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

@hoppscotch/cli is a CLI to run Hoppscotch Test Scripts in CI environments. Prior to 0.8.0, the @hoppscotch/js-sandbox package provides a Javascript sandbox that uses the Node.js vm module. However, the vm module is not safe for sandboxing untrusted Javascript code. This is because code inside the vm context can break out if it can get a hold of any reference to an object created outside of the vm. In the case of @hoppscotch/js-sandbox, multiple references to external objects are passed into the vm context to allow pre-request scripts interactions with environment variables and more. But this also allows the pre-request script to escape the sandbox. This vulnerability is fixed in 0.8.0.

Weakness: CWE-77

Which versions are affected by CVE-2024-34347?

2 open source packages ship an affected version, including @hoppscotch/cli.

PackageAffectedFixed in
@hoppscotch/cli npmFrom 0.5.00.8.0
@hoppscotch/cli npmFrom 0.5.00.8.0

How do I fix CVE-2024-34347?

Upgrade @hoppscotch/cli to 0.8.0 or later.

Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.

Is CVE-2024-34347 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-34347 exists.

Sources

Also known as GHSA-qmmm-73r2-f8xr.

Is CVE-2024-34347 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free