GHSA-h5vj-f7r9-w564 Entropy Backdoor in text-qrcode

Not scored Published

A backdoor in the text-qrcode npm package weakens cryptographic entropy, allowing attackers to guess generated keys and compromise sensitive data.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
None listed

What is GHSA-h5vj-f7r9-w564?

GHSA-h5vj-f7r9-w564 is a vulnerability in text-qrcode, published on 1 Sep 2020. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

All versions of text-qrcode contain malicious code that overwrites the randomBytes method for the crypto module with a function that generates weak entropy. Instead of generating 32 bytes, the infected randomBytes will generate 3 bytes of entropy and hash them, resulting in a 32 byte value being returned, but one that is easily guessable.

Recommendation

Uninstall text-qrcode immediately. If the module was used to generate entropy that is load bearing, all such instances of generated entropy must be replaced. This includes things like bitcoin wallets, private keys, encrypted messages, etc.

Which versions are affected by GHSA-h5vj-f7r9-w564?

2 open source packages ship an affected version, including text-qrcode.

PackageAffectedFixed in
text-qrcode npmFrom 0.0.0None
text-qrcode npmFrom 0.0.0None

How do I fix GHSA-h5vj-f7r9-w564?

No fix has been published for GHSA-h5vj-f7r9-w564 yet. Limit exposure of the affected software until one is available.

Is GHSA-h5vj-f7r9-w564 being exploited?

There is no known exploitation of GHSA-h5vj-f7r9-w564 in the wild and no public exploit code.

Sources

Is GHSA-h5vj-f7r9-w564 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free