CVE-2015-9238: Insecure Comparison in secure-compare

secure-compare Updated 02 Oct 2025

Summary

03/06/2019
Yes i
High
Not published

CVE-2015-9238: Insecure Comparison in secure-compare. Affects secure-compare versions < 3.0.1. Fixed in 3.0.1. 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 Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

The secure-compare package is an npm package used for secure string comparison. It is designed to compare two strings in a way that mitigates timing attacks. The package is commonly used in applications that require secure comparison of sensitive data, such as password verification. However, versions prior to 3.0.1 of secure-compare are affected by a vulnerability that allows the package to always return true when comparing two strings of the same length, regardless of the actual contents of those strings.

Vulnerability Detail

The vulnerability in secure-compare arises from an insecure comparison algorithm used in the package. This algorithm fails to properly compare the contents of two strings, resulting in a constant-time comparison that always returns true for strings of the same length. This can lead to security issues in applications that rely on secure-compare for secure string comparison. An attacker could exploit this vulnerability to bypass password verification or other security measures that depend on accurate string comparison.

How To Fix

Minimum fixed version

3.0.1

This is the first release that contains the fix.

npm install secure-compare@3.0.1

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Conclusion

In summary, the secure-compare package prior to version 3.0.1 is affected by an insecure comparison vulnerability that can lead to security bypasses. It is recommended to upgrade to the fixed version to ensure the integrity of string comparisons in your application. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for secure-compare →

Share this vulnerability

FAQ

The impact of this vulnerability can vary depending on how the secure-compare package is used in an application. However, in general, it can lead to security bypasses and compromise the integrity of password verification or other security measures.

You can use the Vulert Playground at Vulert Scanner to check if your application is affected by this vulnerability. Simply upload your package-lock.json file and the Vulert Playground will analyze it for any known vulnerabilities, including this one.

No, there are no known workarounds for this vulnerability. It is recommended to upgrade to the fixed version of the secure-compare package.

There is no specific evidence of this vulnerability being exploited in the wild. However, given the nature of the vulnerability and its potential impact, it is important to address it promptly to ensure the security of your application.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Minimum fixed version

3.0.1

This is the first release that contains the fix.

npm install secure-compare@3.0.1

Tip — Not sure which version your app runs? Vulert can match this fix to it. 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