A recent commit to the Zod repository on GitHub shows that version 4.6.6 of the popular TypeScript schema validation library was altered to include malicious code. The diff, visible in the commit history, adds an immediately‑invoked asynchronous function expression that begins by declaring a variable g set to null. It then iterates over an array R (presumably a list of remote URLs) and attempts to send a POST request to each endpoint with a JSON‑RPC payload calling eth_on (the method eth_call) using a specific to address and data S.

If the response contains a result field, the code decodes that result and loops over the decoded items d. For each item it tries to fetch a resource from https://{d}/loader. When the fetch succeeds and returns JSON containing the fields setupB64, payloadName, and payloadB64, the script creates a temporary directory using Node’s fs.mkdtempSync, writes the base64‑decoded payload to a file named payloadName inside that directory, and stores the directory path and the base64 setup string in the variable g. Upon finding a valid payload, the loop breaks.
After the loop, if g is set, the script assigns the temporary directory path to the environment variable RUNTIME_DIR. It then dynamically imports a JavaScript module whose source is the base64 string stored in g.s, prefixed with a data URL. This import triggers the execution of the payload’s setup code, which is expected to expose a global __SETUP_DONE__ function that is subsequently called. Finally, the script attempts to remove the temporary directory recursively, cleaning up traces of the payload.
The entire routine is wrapped in a try/catch that swallows errors, and if any step fails the process exits with code 1. The presence of this code indicates a supply‑chain compromise where an attacker injected a fetch‑and‑execute routine designed to retrieve and run additional malware from remote servers. The commit does not reveal the ultimate purpose of the downloaded payload, but the mechanism matches typical behavior used to steal credentials, exfiltrate data, or establish persistent access. No other changes are visible in the same commit, suggesting the malicious addition was the primary modification introduced in version 4.6.6.
