
Research
/Security News
npm Package Uses Prompt Injection and Token Flooding to Disrupt AI Malware Scanners
A new npm package tests AI malware scanners with prompt injection, safety-triggering comments, context flooding, and obfuscated JavaScript.
@endo/hex@endo/hex encodes and decodes between Uint8Array and hexadecimal
strings.
It is a ponyfill for the TC39 Uint8Array.prototype.toHex and
Uint8Array.fromHex intrinsics (proposal-arraybuffer-base64, Stage 4),
but for errors provides a consistent diagnostic optionally including a name to
identify the file the source material came from, which can be instrumental for
debugging.
On engines that ship the native intrinsics, encodeHex and decodeHex
dispatch to them at module load time.
On older engines, and in SES-locked-down compartments where a realm
has removed the intrinsics, the package falls through to a portable
pure-JavaScript implementation.
npm install @endo/hex
import { encodeHex } from '@endo/hex/encode.js';
import { decodeHex } from '@endo/hex/decode.js';
// Or, if you genuinely need to entrain both implementations:
// import { encodeHex, decodeHex } from '@endo/hex';
encodeHex(new Uint8Array([0xb0, 0xb5, 0xc4, 0xfe])); // 'b0b5c4fe'
decodeHex('b0b5c4fe'); // Uint8Array(4) [0xb0, 0xb5, 0xc4, 0xfe]
encodeHex(bytes) -> stringEncodes a Uint8Array as a lowercase hex string.
Callers that need uppercase can call .toUpperCase() on the result.
decodeHex(string, name?) -> Uint8ArrayDecodes a hex string to a Uint8Array.
Accepts both upper- and lowercase input.
Throws on odd-length strings and on characters outside [0-9a-fA-F].
The optional name parameter is included in error messages for
diagnostic context.
The native intrinsic reference is captured once at module load, before
any caller can reach the exported functions and before SES lockdown
freezes Uint8Array.
Post-lockdown mutation of Uint8Array cannot redirect the dispatched
bindings.
In a post-lockdown environment, this module hardens its interfaces to reduce supply chain attack exposure.
FAQs
Transcodes hexadecimal
We found that @endo/hex demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 9 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
A new npm package tests AI malware scanners with prompt injection, safety-triggering comments, context flooding, and obfuscated JavaScript.

Product
Socket now detects supply chain risks in project manifests, starting with missing lockfiles that can make dependency installs non-reproducible.

Research
/Security News
The trojanized extensions use TinyGo-compiled WebAssembly and Solana transaction memos to resolve command-and-control infrastructure.