CVE-2022-5582: Malicious code in random-vouchercode-generator (npm)

random-vouchercode-generator Updated 02 Oct 2025

Summary

20/06/2022
CRITICAL
No i
Critical
Not published

MAL-2022-5582: Malicious code in random-vouchercode-generator (npm). Affected versions are not published. No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The random-vouchercode-generator is an npm package that generates random voucher codes. It is commonly used in applications that require the generation of unique codes for promotions, discounts, or other purposes. This package is vulnerable to a malicious code injection, which compromises the security of any system that has it installed or running.

Vulnerability Detail

The vulnerability originates from a specific version of the random-vouchercode-generator package, which contains malicious code. Once installed or running, this package gives full control of the affected computer to an outside entity. As a result, all secrets and keys stored on that computer should be rotated immediately from a different computer. Removing the package may not guarantee the removal of all malicious software resulting from its installation.

How To Fix

This package is malicious. Remove it and rotate any credentials it could have accessed.

npm uninstall random-vouchercode-generator

If it arrived as a transitive dependency, remove the package that pulled it in, then reinstall.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

There is no known workaround for this vulnerability. It is essential to follow the steps mentioned in the 'how_to_fix' section to mitigate the risk effectively.

Conclusion

The random-vouchercode-generator npm package is vulnerable to a malicious code injection, which compromises the security of the affected system. To mitigate the risk, it is crucial to rotate all secrets and keys, remove the package, and conduct a thorough security audit. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for random-vouchercode-generator →

Share this vulnerability

FAQ

random-vouchercode-generator is an npm package used for generating random voucher codes in applications.

The vulnerability allows an outside entity to gain full control of the affected computer, compromising the security of all stored secrets and keys.

If you have random-vouchercode-generator installed, it is crucial to rotate all secrets and keys stored on the affected computer from a different, secure computer. Additionally, remove the package and conduct a thorough security audit.

No, there is no known workaround for this vulnerability. It is essential to follow the steps mentioned in the 'how_to_fix' section.

Removing the random-vouchercode-generator package may not guarantee the removal of all malicious software. It is recommended to conduct a thorough security audit to ensure no other malicious software or backdoors are present.

How To Fix

This package is malicious. Remove it and rotate any credentials it could have accessed.

npm uninstall random-vouchercode-generator

If it arrived as a transitive dependency, remove the package that pulled it in, then reinstall.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback