Malicious code in generate-protocol (npm)

generate-protocol Updated 02 Oct 2025

Summary

25/06/2024
CRITICAL
No i
Critical
Not published

MAL-2024-2415: Malicious code in generate-protocol (npm). Affects generate-protocol versions 6.0.2. 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 Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

The generate-protocol package is an npm package used for generating protocol buffers. It is commonly used in applications that require efficient serialization and deserialization of structured data. The package provides a set of tools and utilities for working with protocol buffers, including code generation and validation. However, a vulnerability has been discovered in the package that allows for the execution of malicious code.

Vulnerability Detail

The vulnerability, identified as MAL-2024-2415, originates from a malicious code injection in the generate-protocol package. The code injection occurs in version 6.0.2 of the package, which has been flagged as malicious by ReversingLabs. This malicious code can be exploited by an attacker to execute arbitrary commands on the affected system. The ramifications of this vulnerability include potential unauthorized access, data breaches, and system compromise.

How To Fix

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

npm uninstall generate-protocol

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

As a workaround, users can uninstall the affected version (6.0.2) of generate-protocol and install a previous version that is known to be secure. For example, version 5.2.1 does not contain the malicious code. The following commands can be used to uninstall and install the specific version:

Uninstall: npm uninstall generate-protocol@6.0.2 Install secure version: npm install generate-protocol@5.2.1

Conclusion

The generate-protocol package has been found to contain a malicious code injection vulnerability in version 6.0.2. This vulnerability can be exploited to execute arbitrary code on the affected system, potentially leading to unauthorized access and data breaches. It is crucial to update to a secure version of the package and review the package's source code and dependencies for any other potential security issues.

See every vulnerability recorded for generate-protocol →

Share this vulnerability

FAQ

Generate-protocol is an npm package used for generating protocol buffers. It provides tools and utilities for working with protocol buffers, including code generation and validation.

The vulnerability allows for the execution of arbitrary code, which can lead to unauthorized access, data breaches, and system compromise.

To fix this vulnerability, update the generate-protocol package to a non-malicious version, such as 5.2.1.

Yes, you can uninstall the affected version (6.0.2) and install a previous secure version (e.g., 5.2.1) of generate-protocol.

You can find more information about this vulnerability in the ReversingLabs report and the GitHub repository for the malicious-packages project.

How To Fix

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

npm uninstall generate-protocol

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