Back to Blog
critical SEVERITY9 min read

Critical CVE-2025-9287: How Cipher-Base Hash Manipulation Puts Your App at Risk

A critical vulnerability (CVE-2025-9287) was discovered in the `cipher-base` npm package that allows attackers to manipulate cryptographic hash operations, potentially compromising data integrity and security guarantees in affected applications. The fix, delivered in `cipher-base` version 1.0.5, patches this hash manipulation flaw and should be applied immediately by any project using the affected package. Understanding this vulnerability highlights why cryptographic dependencies deserve the sam

O
By Orbis AppSec
•Technically reviewed by Anupam Mediratta•Published May 6, 2026•Reviewed June 3, 2026

Answer Summary

CVE-2025-9287 is a critical hash manipulation vulnerability in the cipher-base npm package for Node.js that allows attackers to compromise cryptographic hash operations and data integrity. The vulnerability exists in cipher-base versions before 1.0.5 and can be exploited to manipulate hash outputs used for authentication, digital signatures, and data verification. The fix requires upgrading to cipher-base version 1.0.5 or later, which patches the hash manipulation flaw in the core cryptographic processing logic.

Vulnerability at a Glance

cweCWE-327 (Use of a Broken or Risky Cryptographic Algorithm)
fixUpgrade to cipher-base version 1.0.5 which patches the hash manipulation vulnerability
riskAttackers can manipulate hash operations to bypass authentication, forge signatures, or compromise data integrity checks
languageNode.js / JavaScript
root causeFlawed hash computation logic in cipher-base allowing state manipulation
vulnerabilityCryptographic Hash Manipulation

⚠️ Severity: CRITICAL | Affected Package: cipher-base < 1.0.5 | Fixed in: 1.0.5


Introduction

Cryptography is the bedrock of modern application security. We rely on it to protect passwords, verify data integrity, secure communications, and establish trust. So when a vulnerability lands squarely in a cryptographic primitive library, the consequences ripple outward in ways that are difficult to fully anticipate.

CVE-2025-9287 is one such vulnerability. It affects cipher-base, a foundational npm package that serves as a base class for cipher and hash stream implementations in the Node.js ecosystem. The vulnerability enables hash manipulation — an attacker's ability to interfere with the integrity of cryptographic hash operations — earning it a critical severity rating.

If your project uses cipher-base (directly or as a transitive dependency through packages like browserify, crypto-browserify, create-hash, or create-hmac), you need to understand what this means and act quickly.


What Is cipher-base?

Before diving into the vulnerability, let's understand what cipher-base actually does.

cipher-base is a lightweight npm package that provides a base class for implementing cipher and hash algorithms in JavaScript. It's the scaffolding that many popular cryptographic packages build upon. Think of it as the abstract foundation that packages like md5, sha.js, des.js, and others extend to implement their specific algorithms.

// Example: How cipher-base is typically used under the hood
const CipherBase = require('cipher-base');

class MyHash extends CipherBase {
  constructor() {
    super('digest'); // 'digest' mode for hash functions
  }

  _update(data) {
    // process incoming data chunks
  }

  _final() {
    // return the final hash value
  }
}

Because cipher-base sits so low in the dependency tree, a vulnerability here has an outsized blast radius — it can affect dozens of downstream packages and thousands of applications that never directly imported cipher-base themselves.


The Vulnerability Explained

What Is Hash Manipulation?

Hash manipulation refers to an attacker's ability to interfere with, predict, or control the output of a cryptographic hash function in ways the developer never intended. In a correctly functioning hash implementation:

  • The same input always produces the same output
  • Different inputs produce different outputs (collision resistance)
  • You cannot reverse a hash to find the original input
  • You cannot control what output a given input produces

When hash manipulation is possible, one or more of these guarantees breaks down.

How CVE-2025-9287 Works

The vulnerability in cipher-base versions prior to 1.0.5 introduces a flaw in how the library handles hash state or processes data streams. While the full technical disclosure details are captured in the CVE record, the class of vulnerability — hash manipulation — typically manifests in one of several ways:

1. State Pollution via Improper Input Handling

// Vulnerable pattern: insufficient validation allows
// crafted input to corrupt internal hash state
hashInstance.update(maliciousBuffer);
// Internal state is now corrupted or predictable
const result = hashInstance.digest('hex');
// Result no longer reflects the true hash of input data

2. Prototype Pollution or Object Manipulation

Since cipher-base uses JavaScript class inheritance, vulnerabilities in how the base class handles object properties can allow attackers to inject properties that alter behavior:

// Attacker-controlled input could manipulate
// the prototype chain or internal state object
const payload = JSON.parse('{"__proto__": {"_finalState": "attacker_controlled"}}');

3. Stream Processing Bypass

The library operates as a Node.js Transform stream. Flaws in how it handles stream events or buffering could allow an attacker to inject data into the hash computation outside of normal channels.

Real-World Attack Scenarios

Scenario 1: File Integrity Bypass

Imagine a content delivery system that hashes files to verify integrity before serving them:

const hash = createHash('sha256');
hash.update(fileContent);
const checksum = hash.digest('hex');

// Store checksum, later verify:
if (computedChecksum !== storedChecksum) {
  throw new Error('File integrity check failed!');
}

With hash manipulation, an attacker who can influence the fileContent input or the hash computation itself could cause a tampered file to produce the same checksum as the original — completely defeating the integrity check.

Scenario 2: HMAC Forgery

Applications using HMAC for API request signing are particularly at risk:

// Server generates HMAC to sign API responses
const hmac = createHmac('sha256', secretKey);
hmac.update(responseBody);
const signature = hmac.digest('hex');

If the underlying hash can be manipulated, an attacker might be able to forge valid signatures without knowing the secret key, allowing them to craft malicious API responses that pass verification.

Scenario 3: Password Hash Collision

Systems that use hash functions (outside of purpose-built password hashing like bcrypt) for credential storage could be vulnerable to crafted inputs that produce hash collisions, potentially allowing authentication bypass.

Why Is This Rated CRITICAL?

The critical severity rating reflects several compounding factors:

Factor Impact
Breadth Affects all downstream packages using cipher-base
Trust violation Breaks fundamental cryptographic guarantees
Attack surface Any application processing untrusted input through affected hash functions
Detectability Hash manipulation attacks often leave no obvious traces
Consequence Data integrity failures, authentication bypasses, signature forgeries

The Fix

What Changed in cipher-base 1.0.5?

The fix was delivered by upgrading cipher-base from version 1.0.4 to 1.0.5. The patch addresses the hash manipulation vulnerability by hardening the internal state management and input processing logic within the base class.

How to Apply the Fix

The fix involves updating your package.json and regenerating your yarn.lock (or package-lock.json) file.

For Yarn projects:

# Update the dependency
yarn upgrade cipher-base --latest

# Or if it's a transitive dependency, force resolution
# Add to package.json:
{
  "resolutions": {
    "cipher-base": "^1.0.5"
  }
}

# Then run:
yarn install

For npm projects:

# Update directly if it's a direct dependency
npm update cipher-base

# For transitive dependencies, use overrides in package.json:
{
  "overrides": {
    "cipher-base": "^1.0.5"
  }
}

npm install

Verifying the fix:

# Check what version is installed
npm ls cipher-base
# or
yarn why cipher-base

# Run a security audit
npm audit
# or with Trivy
trivy fs --security-checks vuln .

Before and After

# yarn.lock (simplified)

- cipher-base@^1.0.3:
-   version "1.0.4"
-   resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz"
-   integrity sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1dA==

+ cipher-base@^1.0.5:
+   version "1.0.5"
+   resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.5.tgz"
+   integrity sha512-[updated-integrity-hash]

The lock file update ensures that every developer on your team and every CI/CD pipeline uses the patched version, not just your local environment.


A Note on Supply Chain Security

CVE-2025-9287 is also a reminder of the software supply chain risk inherent in modern JavaScript development. The average Node.js application has hundreds or thousands of transitive dependencies. cipher-base is a perfect example — most developers affected by this CVE never intentionally installed it.

This is why supply chain security practices matter:

Your App
  └── crypto-browserify
        └── create-hash
              └── cipher-base  ← Vulnerability here

A single vulnerable package buried four levels deep can compromise your entire application's cryptographic guarantees. Tools like Socket.dev and automated security platforms like OrbisAI Security help surface these risks before they become incidents.


Conclusion

CVE-2025-9287 serves as a critical reminder that cryptographic security is only as strong as its weakest dependency. The cipher-base hash manipulation vulnerability demonstrates how a flaw in a low-level utility package can have far-reaching consequences for applications that depend on cryptographic integrity guarantees.

The key takeaways from this vulnerability:

  1. Act immediately — Upgrade cipher-base to 1.0.5 or later right now
  2. Audit your tree — Check if cipher-base is in your dependency graph with npm ls cipher-base
  3. Automate scanning — Don't rely on manual checks; integrate vulnerability scanning into your CI/CD pipeline
  4. Use lock files — Ensure deterministic, auditable dependency resolution across all environments
  5. Stay informed — Subscribe to CVE feeds and security advisories for packages in your ecosystem

Cryptographic vulnerabilities are among the most serious class of security flaws because they undermine the trust mechanisms we build everything else upon. When a hash can be manipulated, signatures can be forged, integrity checks can be bypassed, and the security guarantees your users rely on evaporate silently.

The good news? This one has a fix. Apply it today.


This security fix was automatically detected and patched by OrbisAI Security. Automated security tooling helps teams stay ahead of vulnerabilities without relying solely on manual dependency audits.


References:
- CVE-2025-9287 on NVD
- cipher-base on npm
- OWASP Top 10: Cryptographic Failures
- CWE-327: Use of a Broken or Risky Cryptographic Algorithm
- npm Audit Documentation

Prevention and further reading

Related Articles

medium

path-to-regexp 0.1.12 DoS: Catastrophic Backtracking on Malformed URL

path-to-regexp version 0.1.12 contains a regular expression engine vulnerability where maliciously crafted URL parameters trigger exponential backtracking, causing CPU exhaustion and service unavailability. Upgrading to version 0.1.13 eliminates the vulnerable pattern from the parsing logic.

critical

CVE-2026-59873: node-tar 7.5.11 DoS via Crafted Gzip Bomb

node-tar versions 7.5.11 through 7.5.18 are vulnerable to a denial-of-service attack through maliciously crafted gzip archives that decompress to disproportionately large sizes. An attacker can exploit this to exhaust memory and CPU resources by submitting a small, highly compressed archive that expands beyond configured limits during extraction.

high

MapManager.get() Race Condition Duplicates API Requests

The MapManager's `get(mapUid, cache)` method used a check-then-act pattern that permitted multiple concurrent requests to pass the cache miss check simultaneously, triggering redundant API calls and risking cache corruption. The fix introduces a `_pending` promise map to deduplicate in-flight fetches for identical map UIDs.

critical

Lampa Desktop Auto-Update Heuristic Bypass: Execution of Unverified

Lampa Desktop's auto-update mechanism downloaded JavaScript and CSS from `raw.githubusercontent.com` using only heuristic validation—file size thresholds and string pattern matching—that attackers could trivially satisfy. The fix introduces cryptographic integrity verification by cross-referencing Git blob hashes from the GitHub Contents API, ensuring downloaded code matches the repository's authoritative state before execution.

high

adm-zip 0.6.0 Preserves SUID Bits From ZIPs: CVE-2026-102282

The `adm-zip` dependency resolved to 0.6.0 in this project's dependency tree, a version affected by CVE-2026-102282: during extraction it applies the Unix permission bits stored in each ZIP entry's external file attributes verbatim, including the setuid (`04000`), setgid (`02000`), and sticky bits. An attacker who controls an archive passed to `extractAllTo()` or `extractEntryTo()` can therefore have the extractor create a setuid binary owned by whatever user the extraction process runs as. The

high

requestInput() Type Confusion: NaN and Object Bypass in JavaScript

The `requestInput()` utility function lacked validation on its `type` parameter and failed to handle `NaN` results from float conversions, creating a type confusion weakness. An attacker could supply malformed inputs that propagate unhandled `NaN` values or unexpected object types through the type system. The fix adds explicit guards against `NaN` type parameters and rejects non-primitive type values.