PoC files

4 files

File viewing is interactive and short-lived. Downloads are password-protected ZIP archives using password eip.

GitHub

Analysisdeepseek-v4-pro:cloud ·

Technical assessment

The artifact is a proof-of-concept exploit for CVE-2026-40897, a sandbox bypass leading to remote code execution in the Math.js expression parser. It includes a vulnerable Node.js server (server.js) that evaluates user-supplied expressions via math.evaluate, a Dockerfile to build the vulnerable environment, and a README.md with step-by-step instructions to achieve a reverse shell by submitting a crafted expression that overwrites ArrayNode's internal .map to access Function.constructor.

Backdoor review

No backdoor observed in reviewed code

The supplied evidence consists of a Dockerfile, a README.md, and a server.js file that together demonstrate a proof-of-concept (PoC) for CVE-2026-40897, a sandbox bypass leading to remote code execution in Math.js. The server.js file implements a simple HTTP server that accepts mathematical expressions and evaluates them using a vulnerable version of Math.js (15.1.0). The README.md describes the vulnerability and provides a payload that exploits the expression parser to achieve reverse shell access. All observed behavior is consistent with the stated purpose of demonstrating the CVE. No concealed executable behavior, unrelated payloads, persistence mechanisms, credential theft, or other backdoor functionality was found in the reviewed text files.

ClassificationExploit
Model confidence95%
AuthenticationNot required
Languagesjavascriptmarkdowndockerfile
Target softwaremathjs
Attack typesremote code executionsandbox bypassprototype pollution
Evidence & reasoningClassification basis · observed behavior · safety review
Technical evidence

Classification basis and observed behavior

Classification basis

The artifact contains a complete, executable exploit chain: a vulnerable server (server.js) that evaluates user input, a Dockerfile to reproduce the vulnerable environment, and a README with a specific payload and instructions to achieve a reverse shell. The payload is designed to exercise the vulnerability by overwriting internal object properties to execute arbitrary code, which is the definition of an exploit.

README.md:14-15README.md:44-61server.js:19-21

Requirements

  • A vulnerable Math.js version (13.1.1 to 15.1.1) must be installed and used to evaluate user-controlled expressions.Dockerfile:3README.md:23
  • The application must pass untrusted user input directly to math.evaluate without additional sanitization.server.js:19-21README.md:70
  • The attacker must have network access to the vulnerable server and a listener for the reverse shell.README.md:47-50

Observed behavior

  • The server.js file creates an HTTP server that accepts POST requests to /calculate, parses a JSON body containing an 'expr' field, splits it by newline, and passes the resulting array directly to math.evaluate.server.js:13-21
  • The README.md provides a multi-line JavaScript payload that uses reviver to obtain an ArrayNode, overwrites its .map property with a function that returns Function.constructor, and then uses a FunctionAssignmentNode to trigger internal code that calls the overwritten .map, ultimately executing a reverse shell command.README.md:54-61
  • The Dockerfile builds a container with Math.js version 15.1.0 (vulnerable), copies the server.js, and creates a flag file to demonstrate file system access after exploitation.Dockerfile:1-6
Safety-review evidence

Behaviors behind the backdoor verdict

Observables

Vulnerable Dependency
mathjs@15.1.0The Dockerfile installs a version of Math.js known to be vulnerable to CVE-2026-40897, which is the subject of the PoC.Dockerfile:3
Exploit Payload
JavaScript expression that overwrites ArrayNode.map to access Function.constructor and execute a reverse shell command.The README.md provides a multi-line expression that exploits the Math.js parser to achieve arbitrary code execution, consistent with the described CVE.README.md:55-60
Network Service
HTTP server on port 3000 accepting POST /calculate with JSON body {"expr": "..."}The server.js file implements the vulnerable endpoint that evaluates user-supplied expressions, which is the attack surface for the PoC.server.js:13-21
Review boundaries

What the analysis did not establish

  • The evidence includes one non-text media file (an image in the README) that was not analyzed; its content is not required for classification.
  • The artifact's behavior is inferred from static code analysis and documentation; the code was not executed, and the exploit's reliability is not verified.
  • One non-text media file (a PNG image embedded in server.js as a base64 data URI) was not analyzed; it appears to be a team logo and is unlikely to contain executable code.
  • The review is limited to the static source code and documentation; runtime behavior or network interactions were not observed.
Model interpretation

This review is limited to the supplied PoC code and context. It does not assert that the code works or is safe to execute.

Docker lab environments

1
GitHub

Repository root

Created
Vuln labCVE-2026-40897Dockerfile

1 Dockerfile

Analysisdeepseek-v4-pro:cloud ·

Environment assessment

A single-container Node.js environment serving a web-based calculator. The application uses mathjs@15.1.0 to evaluate user-supplied mathematical expressions. A flag file is written to the container filesystem. The README documents a sandbox-bypass RCE vulnerability (CVE-2026-40897) in mathjs and provides a proof-of-concept exploit that achieves arbitrary code execution and a reverse shell.

Dockerfile:1-6server.js:1-137README.md:1-77

Lab assessment

Vulnerability lab

The README explicitly describes CVE-2026-40897 as a sandbox bypass leading to RCE in Math.js, lists affected versions, provides a PoC with a reverse shell payload, and includes build/run instructions for a vulnerable environment. The Dockerfile installs a vulnerable version of mathjs (15.1.0) and the server.js exposes a /calculate endpoint that passes user input directly to math.evaluate, creating an intentionally vulnerable target for the documented exploit.

README.md:1-77Dockerfile:1-6server.js:1-137
Lab shapeDockerfile
ServicesUnknown
Compose manifests0
Dockerfiles1
Evidence & reasoningComponents · CVE assessment · exercise context · review boundaries
Components

Services and files described by the evidence

mathjs-vuln container

vulnerable targetweb calculator service

A Node.js container based on node:20.18.0. It installs mathjs@15.1.0, copies server.js, writes a flag to /flag.txt, and starts an HTTP server on port 3000. The server serves a calculator HTML page and a POST /calculate endpoint that evaluates user-supplied expressions using math.evaluate.

Dockerfile:1-6server.js:1-137

server.js

HTTP serverexpression evaluatorvulnerable endpoint

A Node.js HTTP server that listens on port 3000. It serves a static HTML calculator page for GET requests and exposes a POST /calculate endpoint. The endpoint parses a JSON body, extracts an 'expr' field, splits it by newlines, and passes the resulting array to math.evaluate. The results are formatted and returned as JSON. The server uses mathjs@15.1.0, which is vulnerable to CVE-2026-40897.

server.js:1-137

mathjs@15.1.0

vulnerable libraryexpression parser

The mathjs library version 15.1.0, installed via npm. According to the README, this version is vulnerable to a sandbox bypass (CVE-2026-40897) that allows arbitrary code execution through crafted expressions.

Dockerfile:3README.md:1-77

flag.txt

capture-the-flag artifact

A file written to /flag.txt inside the container containing a flag string (EQST{m4thj5_4rr4y_m4p_p0llut10n_RCE}). This is a typical CTF-style target for the exploit exercise.

Dockerfile:5
CVE assessment

How the supplied evidence relates each vulnerability

CVE-2026-40897

Supported by supplied evidence

The README explicitly associates the repository with CVE-2026-40897, describing it as a sandbox bypass leading to RCE in Math.js. The Dockerfile installs mathjs@15.1.0, which falls within the vulnerable version range (13.1.1 ≤ version ≤ 15.1.1) stated in the README. The server.js passes user input directly to math.evaluate, providing the attack surface described in the CVE. The PoC in the README demonstrates the exploit path using the installed version.

README.md:1-77Dockerfile:3server.js:1-137
Exercise context

Requirements and sequence described by the evidence

Prerequisites

  • Docker must be installed to build and run the container.README.md:37-40
  • The container must be built and run with port 3000 mapped to the host (docker run -p 3000:3000).README.md:37-40
  • An attacker must have network access to the target's port 3000 to submit the malicious expression.README.md:37-40README.md:47-60
  • The attacker must set up a reverse shell listener (e.g., nc -lvnp 4444) and replace ATTACKER_IP in the PoC payload with their own IP address.README.md:47-60

Evidence-described exercise path

  1. Build the Docker image: docker build -t cve-2026-40897-mathjs-vuln .README.md:37-40
  2. Run the container with port mapping: docker run --rm -it -p 3000:3000 --name mathjs-vuln cve-2026-40897-mathjs-vulnREADME.md:37-40
  3. Start a reverse shell listener on the attacker's machine: nc -lvnp 4444README.md:47-49
  4. Submit the malicious expression payload (with ATTACKER_IP replaced) to the /calculate endpoint via the web calculator interface.README.md:51-60
  5. Receive an interactive bash shell from the target container on the attacker's listener.README.md:62-63
Safety-review evidence

Behaviors behind the stored safety assessment

No harmful behavior observed

The packet describes a self-contained vulnerability lab. The Dockerfile builds a container that runs a vulnerable mathjs service and writes a flag file. The server.js exposes a /calculate endpoint that passes user input to math.evaluate, which is the documented attack surface. The README provides a PoC that exploits the vulnerability to achieve RCE and a reverse shell from the target container to an attacker-controlled listener. This is expected offensive behavior directed at the lab's own target. There is no evidence of host compromise, persistence, credential theft, data destruction, unexplained external payloads, or behavior materially unrelated to the stated exercise. The reverse shell connects to an operator-selected listener, not a hardcoded third-party target. No concealed or deceptive behavior is present.

Dockerfile:1-6server.js:1-137README.md:1-77
Review boundaries

What the analysis did not establish

  • The packet does not include a Compose file; the environment is defined by a standalone Dockerfile.
  • The PoC payload in the README contains a placeholder ATTACKER_IP; the actual target of the reverse shell is operator-selected and not hardcoded.
  • The safety assessment is based solely on the supplied text artifacts; no runtime behavior was observed.
Model interpretation

This review is limited to the supplied lab evidence packet. It does not assert that the environment runs, reproduces a vulnerability, or is safe to execute. Contract: eip-docker-lab-analysis-v1.

Linked vulnerabilities

1