monica_rand_core

Back to the numbers

Versions 0.10.1, 0.10.2 and 0.10.3 of monica_rand_core copied the metadata of the widely used rand_core crate. Their build scripts wrote a prebuilt program for the build machine's operating system to a temporary directory and started it in the background. Version 0.10.2 also printed every environment variable of the build into the build output. Anyone who built a project depending on one of these versions ran these steps on their machine.

Cratemonica_rand_core on crates.io (removed)
Affected versions0.10.1, 0.10.2 and 0.10.3
ClassificationMalicious
CoverageBuilt and traced in a microVM on Linux
Reported toNot reported: crates.io removed the crate before a report (date unknown)
StatusRemoved from crates.io
ScoreCritical for every version

Timeline

2026-09-29 02:14 UTC0.10.1 published
2026-09-29 02:16 UTCCrateward verdict for 0.10.1: not flagged for review (see below)
2026-09-29 05:45 UTC0.10.2 published
2026-09-29 05:46 UTCCrateward verdict for 0.10.2: critical
2026-09-29 06:06 UTC0.10.3 published
2026-09-29 06:08 UTCCrateward verdict for 0.10.3: not flagged for review (see below)
UnknownRemoved by crates.io
2026-10-02Removal confirmed: the index entry and the 0.10.2 crate file are gone
2026-10-02Published here for 0.10.2
2026-10-06Crateward verdicts for 0.10.1 and 0.10.3: critical, after a change to its scoring. Their crate files are gone too
2026-10-06This page updated to cover all three versions

Behavior

All of it happens in build.rs, which Cargo runs on the building machine before compiling the crate:

  1. Version 0.10.2 only: it prints each environment variable as a Cargo warning (cargo:warning=KEY=VALUE, line 78). For a dependency from crates.io, Cargo does not show these warnings unless asked to (-vv), but it stores them in the build directory, under target/, where build caches and CI artifacts can carry them further. In the microVM, the fake GitHub token Crateward planted in the environment ended up in that stored output.

  2. Every version embeds one of three prebuilt executables, chosen by operating system (helper/linux, helper/darwin, helper/windows), and writes it to /tmp/code-helper, or code-helper.exe in the temporary directory on Windows. The three executables are the same in all three versions.

  3. On Linux and macOS it makes the file executable and starts it in a new session with its input and output discarded, so it outlives the build. On Windows it starts it hidden through ShellExecuteW. Version 0.10.3 starts it in the directory that holds the build's target/ directory, normally the root of the project being built.

In the microVM the Linux helper started in every version, made no network attempt and exited with status 101. Crateward's VM has no internet, and the helper may behave differently elsewhere. Its purpose was not analyzed further.

Indicators

0.10.1 crate file (SHA-256)0163b4cc1ae2aa04c4d1b117f693a9a357b9adc741ec9048ecd1951268defe12
0.10.2 crate file (SHA-256)b48735ac515873879ef74566b587bb5e98c1c2eb626d41ec2d1c054f1f2b27c7
0.10.3 crate file (SHA-256)63807ab2b6793482ac03df72099328cb665cdef7a1d175c7ef0f30cd79f95043
helper/linux (SHA-256)68fab57a13f9f22f7a5fdf6feba042e71f600dbb5040e9f9a26c0b05f8ba745a
helper/darwin (SHA-256)91b0656bf0779446450927738e50486d0aac1dae6d89e8b7011c78095ac7de34
helper/windows (SHA-256)d9879c72586d80899d0b700d3dd09e1ec1e01dff9eae94bc72536a53d56003b5
Files/tmp/code-helper; %TEMP%\code-helper.exe

How Crateward found it

Each version was fetched within three minutes of its publication. The static analysis flagged the three embedded executables and the hidden process start in every version, and in 0.10.2 also the build script reading every environment variable. The builds in the microVM recorded the helper starting from /tmp in every version, and in 0.10.2 the planted token copied into the build output. A full build in a fresh VM confirmed 0.10.2.

Correction: on 2026-10-02 this page said that 0.10.1 did not show this behavior in Crateward's analysis. That was wrong. Crateward's trace of 0.10.1 showed the helper starting, but its scoring at the time weighed the copied token and not a program started from a temporary directory, so 0.10.1 and 0.10.3 were not flagged for review. After the scoring changed on 2026-10-06, re-scoring the stored evidence flagged both as critical, and a human reviewed it.

MITRE ATT&CK techniques the evidence is consistent with: T1082 (system information discovery, 0.10.2), T1552.001 (credentials in files, 0.10.2) and T1027.009 (embedded payloads).

Remediation

If a machine or CI job built a project depending on monica_rand_core 0.10.1, 0.10.2 or 0.10.3:

Crateward keeps the original crate files as they were published, with the checksums crates.io listed for them. Contact: security@janfedler.de. Mistakes are corrected on this page.