Buffer Overflow Affecting cesanta/mjs package, versions [0,]


Severity

Recommended
0.0
critical
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
0.11% (46th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-UNMANAGED-CESANTAMJS-6137712
  • published21 Dec 2023
  • disclosed20 Dec 2023
  • creditpip-izony

Introduced: 20 Dec 2023

CVE-2023-50044  (opens in a new tab)
CWE-120  (opens in a new tab)

How to fix?

There is no fixed version for cesanta/mjs.

Overview

Affected versions of this package are vulnerable to Buffer Overflow via the getprop_builtin_foreign function. An attacker can execute arbitrary code, cause a denial of service, and obtain sensitive information through a segmentation fault that occurs when the input string includes a name of Built-in APIs.

PoC

cd mjs 
git checkout b1b6eac6b1e5b830a5cb14f8f4dc690ef3162551 
export LDFLAGS="-lpthread -latomic" 
./afl-clang -DMJS_MAIN mjs.c -fno-inline -ldl -o mjs-bin -fsanitize=address -g 
./mjs-bin -f PoCfile

CVSS Scores

version 3.1