CVE-2017-1001002CWE-94

math.js before 3.17.0 had an arbitrary code execution in the JavaScript engine

published November 27, 2017

CVSS
—
EPSS
2%
Percentile
83.6
In the wild
Unconfirmed
What it is

⚡ If you thought math was just about numbers, think again! An arbitrary code execution flaw in math.js versions before 3.17.0 could let attackers run wild with clever JavaScript tricks! 🔥 This vulnerability is like a mathematics teacher who accepts any equation, no matter how nonsensical or malicious, as an answer. Instead of just solving for 'x', it’s executing the entire formula without question! An attacker could craft a specially named typed function, causing the JavaScript engine to execute arbitrary code. This means they could manipulate the application to their liking, potentially leading to data breaches or unwanted behavior in your application.

Put simply

This vulnerability is like a mathematics teacher who accepts any equation, no matter how nonsensical or malicious, as an answer. Instead of just solving for 'x', it’s executing the entire formula without question! The flaw lies in how math.js allows the definition of typed functions with JavaScript code as their names, enabling the execution of code that shouldn't be run. This could allow unauthorized access or manipulation of the application.

What to do

An attacker could craft a specially named typed function, causing the JavaScript engine to execute arbitrary code. This means they could manipulate the application to their liking, potentially leading to data breaches or unwanted behavior in your application. Upgrade to math.js version 3.17.0 or later to patch this vulnerability. Conduct a thorough review of how typed functions are defined in your code to ensure they aren't misused. Implement input validation to prevent such attacks in the future. You've got this! By updating and reviewing your code, you can keep your application safe and sound. 🛡️

The record
Technical detail
CVSS
Not scored
CVSS v4.0
Not supplied
EPSS
0.02357 · 83.6th percentile
Weakness
CWE-94 · Improper Control of Generation of Code ('Code Injection')
Published
2017-11-27T14:00Z
EPSS history
Timeline
  • 27 NOV 14:00Z
    math.js before 3.17.0 had an arbitrary code execution in the JavaScript engine
    cvelistv5