
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
A universal javascript library for signing strings to avoid tampering:
import { sign, check } from 'sign';
// Keep the secret long and safe! e.g., use `process.env.SECRET` or similar
const signed = await sign('Francisco', '123456');
console.log(signed);
// Francisco.pACXHmIctuGrwvidl7vVNyh5uvZMEHmp+D3NQB3uXJ4
// Only matches if the secret is the same used to sign
console.log(await check(signed, '123456')); // true
console.log(await check(signed, 'badsecret')); // false
// Prevent tampering on the client side since they don't know the secret
const fakeCookie = await sign('Francisco', 'badsecret');
console.log(await check(fakeCookie, '123456')); // false
It works on Node.js, the browser and Cloudflare Workers.
It is used to make sure that only those with the secret have modified the message. This is ideal to sign session cookies, since those are created and modified only by the server, but can be used for many more things.
Note that this does no encrypt the messages, just checks whether the message has been modified by someone who knows the secret. The message remains in plain text.
Both the message and secret must be plain strings. Make sure that the secret has high entropy and remains in a safe location, e.g.:
const signed = sign('Francisco', process.env.SECRET);
The result looks like {MESSAGE}.{SIGNATURE}.
Check whether the message has been signed with this secret. The signed message looks like {MESSAGE}#{SIGNATURE}:
// Signed with '123456'
const signed = "Francisco.pACXHmIctuGrwvidl7vVNyh5uvZMEHmp+D3NQB3uXJ4";
expect(await check(signed, '123456')).toBe(true);
expect(await check(signed, 'fake')).toBe(false);
FAQs
A universal javascript library for signing strings to avoid tampering
The npm package sign receives a total of 58 weekly downloads. As such, sign popularity was classified as not popular.
We found that sign demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.