The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2021-41117

CVE-2021-41117: Keypair Information Disclosure Flaw

CVE-2021-41117 is an information disclosure vulnerability in Keypair_project Keypair that generates predictable RSA keys due to poor random number generation. This article covers the technical details, affected versions, impact, and mitigation strategies.

Published: February 25, 2026

CVE-2021-41117 Overview

CVE-2021-41117 is a critical insecure random number generation vulnerability in keypair, a JavaScript RSA PEM key generator library. The vulnerability stems from multiple flaws in the library's cryptographic random number generation implementation, causing it to generate identical RSA keys. This deficiency allows attackers to potentially guess private keys, enabling them to decrypt confidential messages or gain unauthorized access to victim accounts.

Critical Impact

The keypair library generates RSA keys with severely weakened entropy due to improper CSPRNG implementation, resulting in predictable and duplicate private keys that can be exploited to compromise encrypted communications and authentication systems.

Affected Products

  • keypair_project keypair (all versions prior to patch)

Discovery Timeline

  • 2021-10-11 - CVE CVE-2021-41117 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2021-41117

Vulnerability Analysis

This vulnerability represents a severe breakdown in cryptographic security fundamentals. The keypair library was discovered to be generating identical RSA keys—a condition that should be statistically impossible with properly implemented RSA-2048 key generation. Identical P, Q, and N values appearing repeatedly indicates fundamental problems with random number generation or CSPRNG output handling.

The impact is devastating from a security perspective: RSA's security model relies entirely on the computational difficulty of factoring large composite numbers derived from randomly chosen primes. When the same primes are reused across multiple key pairs, the entire security model collapses, allowing attackers to derive private keys and compromise any system relying on these generated keys.

Root Cause

The vulnerability originates from three interconnected issues in the library's random number generation:

Issue 1 (GHSL-2021-1012): The library implements its own counter-based CMAC approach instead of relying entirely on platform-provided CSPRNGs. The seeding mechanism in the defaultSeedFile function has critical flaws depending on the execution environment.

Issue 2: In NodeJS environments, despite having access to a strong CSPRNG, the library fails to use it because a variable named crypto is declared and set to null, shadowing node's crypto module. This forces the fallback path to be taken.

Issue 3: The fallback path uses a Lehmer LCG seeded with Math.random, and critically, the output encoding contains a bug. The line b.putByte(String.fromCharCode(next & 0xFF)) combined with putByte's definition results in a double String.fromCharCode call. This causes 97% of the LCG output to be converted to zeros (only values 48-57 produce meaningful bytes), dramatically reducing seed entropy.

Attack Vector

The vulnerability is exploitable over the network without authentication or user interaction. An attacker targeting systems using keypair-generated RSA keys can:

  1. Generate a collection of weak keys using the same flawed library implementation
  2. Attempt to match generated keys against observed public keys in target systems
  3. Once a match is found, the attacker possesses the corresponding private key
  4. Use the private key to decrypt intercepted communications or authenticate as the victim

The flawed encoding logic that causes the double String.fromCharCode call results in deterministic, predictable key material. Since each seed byte has a 97% probability of being zero, the actual entropy of generated keys is drastically lower than expected for RSA-2048.

Detection Methods for CVE-2021-41117

Indicators of Compromise

  • Presence of the vulnerable keypair library in package.json or node_modules directories
  • Multiple systems or services using identical RSA public keys where uniqueness is expected
  • SSH authorized_keys files containing duplicate entries across different hosts
  • Cryptographic operations failing due to key collisions in certificate stores

Detection Strategies

  • Audit all Node.js projects for dependencies on the keypair package using npm audit or similar tools
  • Compare generated RSA public keys across environments to identify duplicates that indicate vulnerable key generation
  • Review application logs for cryptographic errors or warnings related to key generation
  • Implement software composition analysis (SCA) to flag vulnerable library versions in CI/CD pipelines

Monitoring Recommendations

  • Deploy SentinelOne Singularity to detect and alert on vulnerable software components within your infrastructure
  • Configure dependency scanning tools to continuously monitor for outdated or vulnerable npm packages
  • Establish baseline cryptographic key inventories and alert on anomalous key reuse patterns
  • Monitor authentication logs for successful logins using keys that should not be valid

How to Mitigate CVE-2021-41117

Immediate Actions Required

  • Identify all applications and services using the keypair library and prioritize remediation
  • Regenerate all RSA keys that were created using vulnerable versions of keypair with a properly secured library
  • Revoke and replace SSH keys, TLS certificates, and any other cryptographic credentials generated by the vulnerable library
  • Update the keypair dependency to the patched version immediately

Patch Information

The vulnerability was addressed by the keypair project maintainers. Security patches are available through the GitHub Security Advisory. Users should update to the latest version of the keypair package that includes fixes for the random number generation issues. Additional technical details are available in the GitHub Security Lab Advisory.

Workarounds

  • Replace keypair with alternative RSA key generation libraries that properly utilize platform CSPRNGs
  • In Node.js environments, use the native crypto.generateKeyPairSync() function for RSA key generation
  • For browser environments, ensure window.crypto.getRandomValues() is available before generating keys
  • Implement key generation validation that checks for duplicate keys before deployment
bash
# Configuration example
# Audit your project for vulnerable keypair versions
npm audit

# Update keypair to the latest patched version
npm update keypair

# Alternatively, replace with Node.js native crypto for key generation
# In your application code, use:
# const { generateKeyPairSync } = require('crypto');
# const { publicKey, privateKey } = generateKeyPairSync('rsa', { modulusLength: 2048 });

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeInformation Disclosure

  • Vendor/TechKeypair

  • SeverityCRITICAL

  • CVSS Score9.1

  • EPSS Probability0.30%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityNone
  • CWE References
  • CWE-335
  • Technical References
  • GitHub Security Lab Advisory
  • Vendor Resources
  • GitHub Security Advisory
  • Latest CVEs
  • CVE-2025-70797: LimeSurvey XSS Vulnerability

  • CVE-2025-30650: Juniper Junos OS Auth Bypass Vulnerability

  • CVE-2026-35471: Goshs Path Traversal Vulnerability

  • CVE-2026-35393: Goshs Path Traversal Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English