
Research
Supply Chain Attack on Axios Pulls Malicious Dependency from npm
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.
bool-chance
Advanced tools
A simple wrapper around Math.random for returning a random boolean, with the
provided chance of being true. It exports an object with a ::get method to
facilitate stubbing for unit tests.
const boolChance = require('bool-chance');
let bool = boolChance.get(0.75); // Will return true 75% of the time.
let otherBool = boolChance.get(0.5); // Will return true half of the time.
Even though this is very simple, popular utility libraries like
lodash don't have a method like it.
Chance.js does, but its api requires you to construct
an instance of a directly exported class, which can be frustrating for unit
tests since you can't stub the constructor. You can stub the Chance::Chance
method to get an instance, though having to do this every time you need to test
a random bool is annoying.
As a result, I found myself writing utility functions like this one in a lot of my personal projects. I figured I'd save myself some trouble and just publish it. Use if you like, though I don't really have plans to add much more to it in the future.
FAQs
Weighted random bool generator
We found that bool-chance 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.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.

Security News
TeamPCP is partnering with ransomware group Vect to turn open source supply chain attacks on tools like Trivy and LiteLLM into large-scale ransomware operations.