Malicious Code Detected in compare-obj Package - Critical Security Alert

compare-obj Updated 25 Nov 2025

Summary

24/11/2025
CRITICAL
No i
Critical
Not published

MAL-2025-190950: Malicious code in compare-obj (npm). Affects compare-obj versions 1.1.1 – 1.1.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 compare-obj package is a utility for comparing JavaScript objects, often used in applications to determine differences between data structures. It is popular in the npm ecosystem due to its simplicity and effectiveness. However, a recent discovery has revealed that this package contains malicious code, posing significant security risks to any application that utilizes it.

Vulnerability Detail

The vulnerability originates from the compare-obj package, which has been identified to contain embedded malicious code. This code can compromise the security of any system where the package is installed, potentially allowing unauthorized access to sensitive data, including secrets and keys. The malicious nature of the code means that any system running this package should be considered fully compromised, necessitating immediate action to mitigate risks.

How To Fix

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

npm uninstall compare-obj

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 temporary workaround, you can avoid using the compare-obj package altogether and implement your own object comparison logic or use an alternative library that does not have known vulnerabilities.

Conclusion

The discovery of malicious code in the compare-obj package highlights the importance of vigilance in managing open-source dependencies. Immediate action is required to mitigate risks associated with this vulnerability. By uninstalling the affected package and utilizing tools like Vulert, developers can better protect their applications from potential threats.

See every vulnerability recorded for compare-obj →

Share this vulnerability

FAQ

You should immediately uninstall the compare-obj package and rotate any secrets or keys stored on the affected system.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. Visit Vulert Scanner to check your application without needing to sign up.

Failing to address this vulnerability can lead to unauthorized access to sensitive data, potential data breaches, and complete system compromise.

Regularly audit your dependencies, use tools like Vulert for real-time monitoring, and keep your packages updated to the latest secure versions.

While many npm packages are safe, it's essential to perform due diligence by reviewing package sources, checking for known vulnerabilities, and using monitoring tools like Vulert.

How To Fix

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

npm uninstall compare-obj

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