Skip to main content
Challenges npm supply chain
Xonalar Expert A typosquat package, lock integrity and multi-layer JS stages Solves: 5

npm supply chain

Author: CyberSamSU
Points
200

Room: npm supply chain. During build #4821, the CI agent of the payment portal (payments-portal) sent strange DNS queries to the .invalid zone. The accused package is lodahs (a typosquat of lodash). Two copies were saved from the internal mirror, and it is unknown which one ended up in CI.

supply_case.zip: incident_note.txt, app/package.json and app/package-lock.json, mirror-a/ and mirror-b/ (each with lodahs-4.17.21.tgz), cdn/s/*.bin (an archived copy of the external "CDN"), ci/install.log. All the JS code only reveals data; there is no need to run it (and it is not recommended) — static analysis is enough.

Task 1. The lodahs entry in package-lock.json specifies integrity (sha512-<base64>). Compute the sha512 of both .tgz and determine the copy that really ended up in CI. The other is a copy from a different campaign (a decoy).

Task 2. In the package.json of the chosen tarball, which script does postinstall run? That script is obfuscated (a string array + rotation + base64 + hex escapes). Recover the host, id, xorkey and cid values from it (see module.exports; unused variables are noise).

Task 3. The _0xdec function in the script shows how it decrypts the second-stage file. Find cdn/s/<id>.bin and decrypt it to obtain the second-stage JS text.

Task 4. The second-stage configuration contains ep (the exfil endpoint) and a token hidden with XOR. The key is the value written to process.env.LDH_CID in the first stage. The token is the room's flag.

Flag format: BAYROQ{NPM_TAMINOT_xxxxxxxxxxxxxxxx} (the last 16 characters are lowercase hex). The decoy tarball also gives a "token" in the same format — only the copy that matches the lock is correct.

Attached files
supply_case.zip Log in to download
Hints 3
Opening a hint reduces the points you get for solving this challenge.
Hint 1 −20 pts Log in
Hint 2 −40 pts Log in
Hint 3 −60 pts Log in
To submit a flag, log in.

First solvers

1. Mirjaxon Qaxxarov 25.11.2026
2. Odam 25.11.2026
3. AGENT X 26.11.2026
4. Asmaa Mottery 27.11.2026
5. 𝖛𝖊𝖑𝖐𝖆𝖓 28.11.2026