proomt

Search

Search posts, papers, and topics

All posts

Hacker News front pageSafeDep Team10 min readintermediate

Why Does an NPM Math Library Need an Encrypted Loader?

Summary

SafeDep discovered that several npm packages masquerading as mathjs contain an encrypted loader that only activates when a caller passes a particular matrix to the LU solver, using the matrix’s lower‑triangular factor as the decryption password. The loader decrypts and executes a multi‑stage remote‑access implant that talks to Slack, Telegram and a blockchain contract, and the same technique is r…

  • The malicious loader is triggered by passing a specific 3×3 Pascal matrix to lusolve; the lower‑triangular factor L (JSON‑stringified) serves as the AES‑GCM password.
  • The loader uses scrypt‑derived keys to decrypt large encrypted blobs (graph.js, fraction.js, bignumber/type.js), writes them to disk and require()s them, giving the attacker code execution with Node’s privileges.
  • The payload implements a remote‑access implant: generates X25519 keys, reads a Base Sepolia smart contract via ethers, and exfiltrates commands via Slack and Telegram bots.
  • Identical loader files and encrypted payloads appear in three npm packages (mathmain, mathsbase, math‑universe) across multiple versions, none of which are present in the linked public GitHub repos.

Supply‑chain security teams and Node.js developers should care because a seemingly innocuous math library can hide a stealthy remote‑access implant triggered by specific inputs, exposing systems to unauthorized code execution.

7/10

Related reading

  1. App Hardening: One Obfuscation Pipeline Across Every Port

    Codename One adds a cloud‑side hardening step that runs on the merged JAR before it is split into Android, iOS, JavaScript, and desktop binaries. It can rename symbols, encrypt string literals, and insert opaque‑predicate control‑flow guards at configurable levels (off → standard → aggressive → paranoid). The transforms are selective per platform to avoid breaking optimizers, and a mapping is kep…

    CodeName Onecodenameone.com6 min
  2. When scanners miss the attack: how Cloudflare Client-Side Security protects storefronts

    Cloudflare’s Page Shield uses a graph‑neural‑network (GNN) to model JavaScript as a syntax‑tree graph, followed by a lightweight LLM for second‑opinion triage and an ensemble of frontier models for deep analysis. This pipeline caught eight malicious payloads across four distinct affiliate‑theft and backdoor techniques that traditional scanners missed, demonstrating the need for runtime, behavior‑…

    Cloudflarecloudflare.com21 minHN2
  3. Article: Your Next DSL Author Is a Language Model

    Typed Domain Grounding (TDG) embeds a DSL inside a mainstream language the LLM already knows (e.g., Kotlin) and uses the host compiler as an oracle. The author describes five building blocks—embedding, choosing a host language with high training‑data frequency, compiler‑driven type safety, a generate‑compile‑repair loop, and an on‑demand teaching tool—and shows measured results from kUML, a Kotli…

    InfoQinfoq.com18 min
  4. WebAuthn Passkey Recovery: Building Account Fallbacks and Backup Codes in Node.js

    A step‑by‑step tutorial for building a zero‑trust WebAuthn passkey recovery flow in Node.js/TypeScript. It covers generating 128‑bit backup codes, hashing them with Argon2id, rate‑limited verification, time‑boxed JWT recovery sessions, and orchestrating new credential registration with @simplewebauthn/server while revoking lost credentials and rotating codes.

    SitePointsitepoint.com19 min