Skip to main content
Vulnerability Database/CVE-2026-112041

CVE-2026-112041: Diem Project Weak PRNG RCE Vulnerability

CVE-2026-112041 is a cryptographically weak PRNG flaw in diem-project diem that enables remote code execution through the dmString::random function. This article covers technical details, exploitation methods, and security measures.

Published:

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

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-112041 Overview

CVE-2026-112041 affects the diem-project diem content management framework, specifically commits up to 116974edfb9a5b8bd69cb13586dc62bcdbb485ad. The flaw resides in the dmString::random function implemented in dmCorePlugin/lib/basic/dmString.php. The function relies on a cryptographically weak pseudo-random number generator (PRNG), categorized under [CWE-331]. An attacker on the network can predict values generated by this routine, undermining any secret or token derived from it. Exploitation requires high attack complexity, and public exploit details are available through VulDB. The project uses a rolling release model, so no fixed version has been published.

Critical Impact

Predictable randomness in dmString::random can be used to anticipate security-sensitive tokens produced by the framework, with confidentiality impact rated low.

Affected Products

  • diem-project diem up to commit 116974edfb9a5b8bd69cb13586dc62bcdbb485ad
  • Component: dmCorePlugin/lib/basic/dmString.php
  • Function: dmString::random

Discovery Timeline

  • 2026-10-19 - CVE-2026-112041 published to the National Vulnerability Database (NVD)
  • 2026-10-19 - Last updated in NVD database

Technical Details for CVE-2026-112041

Vulnerability Analysis

The vulnerability lies in the dmString::random routine of the diem framework. The function is intended to produce random strings that other components may use for tokens, identifiers, or similar values. Because the implementation uses a non-cryptographic PRNG, the output is statistically predictable to an attacker with sufficient samples or knowledge of the seeding state.

An attacker who can observe or request generated values across the network may reconstruct the internal PRNG state. Once the state is recovered, subsequent outputs of dmString::random can be predicted. This degrades the strength of any downstream security control that depends on unpredictability.

Root Cause

The root cause is reliance on a cryptographically weak PRNG inside dmString::random ([CWE-331]). PHP's standard rand and mt_rand functions are not suitable for security contexts because their outputs can be reproduced once the seed is known or inferred.

Attack Vector

Exploitation is remote and does not require authentication or user interaction. The attack complexity is high because the adversary must collect enough random outputs or related state information to recover the PRNG seed. The exploit is referenced as publicly available on VulDB. The diem project was notified through an issue report but has not responded.

No verified exploit code is published in a form suitable for inclusion. See the GitHub Issue #458 Discussion and VulDB CVE-2026-112041 Details for technical references.

Stop Remote Code Execution Before It Runs

Singularity™ Endpoint detects and blocks exploit attempts at machine speed, including zero-days and novel attack techniques.

Stop Exploit Attempts

Detection Methods for CVE-2026-112041

Indicators of Compromise

  • Repeated requests to endpoints that return tokens, session identifiers, or password-reset links generated via dmString::random.
  • Successful authentication or privilege use associated with session tokens that were not issued through normal login flows.
  • Access patterns that scrape multiple random-value endpoints in short succession, consistent with PRNG state recovery.

Detection Strategies

  • Audit the diem codebase and dependent plugins for calls to dmString::random and classify each call site by whether the output is used in a security-sensitive context.
  • Inspect application logs for high-rate enumeration of endpoints that expose random outputs, including password reset, invite, or share-link routes.
  • Correlate token issuance events with subsequent authentication or authorization events to identify tokens used from unexpected IP addresses.

Monitoring Recommendations

  • Alert on bursts of requests to token-producing endpoints originating from a single source.
  • Monitor for authentication using tokens or links that were never clicked by the intended recipient.
  • Track changes to files under dmCorePlugin/lib/basic/ in production deployments to detect unauthorized patches or rollbacks.

How to Mitigate CVE-2026-112041

Immediate Actions Required

  • Identify every security-sensitive consumer of dmString::random and replace it with a cryptographically secure source such as PHP's random_bytes or random_int.
  • Invalidate any tokens, session identifiers, or reset links previously issued through the weak PRNG and force regeneration.
  • Restrict public access to endpoints that emit random values until the generator is remediated.

Patch Information

The diem project uses a rolling release model and has not published a fixed version at the time of CVE assignment. Monitor the GitHub Diem Project Repository and GitHub Issue #458 Discussion for an upstream fix. Until a patch is available, apply a local patch replacing mt_rand-based logic with random_bytes within dmCorePlugin/lib/basic/dmString.php.

Workarounds

  • Override dmString::random in a local plugin to call bin2hex(random_bytes($length)) for all security-sensitive calls.
  • Reduce the lifetime of any secret derived from the function so a predicted value expires before it can be used.
  • Add rate limiting and anomaly detection on endpoints that expose random outputs to raise the cost of PRNG state recovery.
bash
# Configuration example: local override snippet to replace weak PRNG usage
# File: dmCorePlugin/lib/basic/dmString.php (local patch)
# Replace the existing random() implementation with:
#
#   public static function random($length = 16)
#   {
#       return substr(bin2hex(random_bytes($length)), 0, $length);
#   }

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

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.