CVE-2022-21122

Arbitrary Code Execution

Critical · published June 3, 2022

CVSS v3.1
9.0
EPSS
3%
Percentile
84.7
In the wild
Unconfirmed
What it is

🚨 A sneaky flaw in metacalc before version 0.0.2 opens the door to Arbitrary Code Execution! Just by exposing the JavaScript Math class to user-land, attackers can tap into some serious power. 🔥 Think of it like a restaurant that allows customers to enter the kitchen. Once they're in, they can whip up whatever dish they want, including some questionable recipes! This vulnerability gives malicious users the chance to create arbitrary functions in your application, just like a rogue chef could cook up a storm without any oversight. An attacker can execute any JavaScript code on your server, leading to disastrous consequences: data theft, system manipulation, or even taking control of the entire application. This is absolutely devastating, as it allows the bad guys to run their own code as if they were trusted users, wreaking havoc on your software!

Put simply

Think of it like a restaurant that allows customers to enter the kitchen. Once they're in, they can whip up whatever dish they want, including some questionable recipes! This vulnerability gives malicious users the chance to create arbitrary functions in your application, just like a rogue chef could cook up a storm without any oversight. This vulnerability arises because the metacalc package exposes the JavaScript Math class within the v8 context, allowing attackers to leverage the Function constructor and execute arbitrary code, thus bypassing security controls.

What to do

An attacker can execute any JavaScript code on your server, leading to disastrous consequences: data theft, system manipulation, or even taking control of the entire application. This is absolutely devastating, as it allows the bad guys to run their own code as if they were trusted users, wreaking havoc on your software! Update metacalc to version 0.0.2 or later immediately to close this security gap. Review your code for any usage of the Math class and ensure it isn’t exposed to untrusted inputs. Additionally, consider implementing a security review to prevent similar vulnerabilities in the future. You've got this! By taking these steps, you’re on your way to solidifying your defenses and keeping your application secure. 🛡️

The record
Technical detail
CVSS v3.1
9.0 · CRITICAL
Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H/E:P
CVSS v4.0
Not supplied
EPSS
0.02513 · 84.7th percentile
Published
2022-06-03T20:05Z
EPSS history
Timeline
  • 03 JUN 20:05Z
    Arbitrary Code Execution
    cvelistv5