CVE-2025-46653: CWE-338 Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG) in node-formidable Formidable
Formidable (aka node-formidable) 2.1.0 through 3.x before 3.5.3 relies on hexoid to prevent guessing of filenames for untrusted executable content; however, hexoid is documented as not "cryptographically secure." (Also, there is a scenario in which only the last two characters of a hexoid string need to be guessed, but this is not often relevant.) NOTE: this does not imply that, in a typical use case, attackers will be able to exploit any hexoid behavior to upload and execute their own content.
AI Analysis
Technical Summary
CVE-2025-46653 identifies a vulnerability in the node-formidable package, specifically versions 2.1.0 through 3.x prior to 3.5.3. Formidable is a widely used Node.js module for parsing form data, including file uploads. The vulnerability stems from its reliance on the hexoid library to generate filenames for uploaded files to prevent guessing or collision. Hexoid, however, is documented as not being cryptographically secure, meaning the pseudo-random number generator (PRNG) it uses can be predicted or brute-forced under certain conditions. This weakness is classified under CWE-338, which concerns the use of cryptographically weak PRNGs. The risk is that an attacker might be able to guess or predict the generated filenames of uploaded files, potentially allowing them to overwrite or access untrusted executable content if the application does not implement additional safeguards. The description notes a scenario where only the last two characters of the hexoid string need to be guessed, although this is not commonly relevant. Importantly, typical use cases do not guarantee that an attacker can exploit this vulnerability to upload and execute arbitrary code, as other controls and context matter. The CVSS 3.1 base score is 3.1 (low severity), reflecting a network attack vector, high attack complexity, low privileges required, no user interaction, unchanged scope, no confidentiality or availability impact, and limited integrity impact. No known exploits are reported in the wild as of the publication date (April 26, 2025). No official patches are linked yet, but upgrading to version 3.5.3 or later is implied to remediate the issue. Overall, this vulnerability highlights a weakness in randomness quality for filename generation in a popular Node.js library, which could be leveraged in specific scenarios to facilitate unauthorized file access or manipulation.
Potential Impact
For European organizations using node-formidable in their web applications, especially those handling file uploads, this vulnerability could lead to limited integrity risks. An attacker might guess filenames of uploaded files, potentially overwriting or accessing files that should remain protected. While the direct impact on confidentiality and availability is negligible, the integrity compromise could facilitate further attacks, such as webshell uploads or unauthorized code execution, if combined with other vulnerabilities or misconfigurations. Organizations in sectors with high web application usage—such as e-commerce, finance, healthcare, and public services—may face increased risk if they rely on vulnerable versions of Formidable without additional mitigations. The low CVSS score and absence of known exploits suggest the threat is currently low, but the potential for chained attacks or targeted exploitation in sensitive environments warrants attention. European organizations with strict data protection regulations (e.g., GDPR) must consider the risk of unauthorized file manipulation as a compliance concern. The impact is more pronounced in environments where uploaded files are executed or processed without strict validation or sandboxing.
Mitigation Recommendations
1. Upgrade node-formidable to version 3.5.3 or later, where the use of cryptographically weak PRNGs for filename generation has been addressed. 2. Implement additional filename randomization or hashing mechanisms using cryptographically secure PRNGs (e.g., Node.js crypto.randomBytes) at the application level to override default filename generation. 3. Enforce strict validation and sanitization of uploaded files, including file type checks, size limits, and content scanning to prevent malicious uploads. 4. Apply access controls and sandboxing to uploaded files to prevent execution or unauthorized access, such as storing uploads outside the web root or using dedicated storage services. 5. Monitor logs for unusual file access patterns or repeated failed attempts to guess filenames, which could indicate exploitation attempts. 6. Conduct regular dependency audits and vulnerability scans to detect use of vulnerable Formidable versions. 7. Educate developers about the risks of weak randomness in security-critical contexts and encourage use of cryptographically secure libraries. These mitigations go beyond generic advice by focusing on layered defenses, secure coding practices, and operational monitoring tailored to the specific weakness in filename generation.
Affected Countries
Germany, France, United Kingdom, Netherlands, Italy, Spain, Sweden, Poland, Belgium, Ireland
CVE-2025-46653: CWE-338 Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG) in node-formidable Formidable
Description
Formidable (aka node-formidable) 2.1.0 through 3.x before 3.5.3 relies on hexoid to prevent guessing of filenames for untrusted executable content; however, hexoid is documented as not "cryptographically secure." (Also, there is a scenario in which only the last two characters of a hexoid string need to be guessed, but this is not often relevant.) NOTE: this does not imply that, in a typical use case, attackers will be able to exploit any hexoid behavior to upload and execute their own content.
AI-Powered Analysis
Technical Analysis
CVE-2025-46653 identifies a vulnerability in the node-formidable package, specifically versions 2.1.0 through 3.x prior to 3.5.3. Formidable is a widely used Node.js module for parsing form data, including file uploads. The vulnerability stems from its reliance on the hexoid library to generate filenames for uploaded files to prevent guessing or collision. Hexoid, however, is documented as not being cryptographically secure, meaning the pseudo-random number generator (PRNG) it uses can be predicted or brute-forced under certain conditions. This weakness is classified under CWE-338, which concerns the use of cryptographically weak PRNGs. The risk is that an attacker might be able to guess or predict the generated filenames of uploaded files, potentially allowing them to overwrite or access untrusted executable content if the application does not implement additional safeguards. The description notes a scenario where only the last two characters of the hexoid string need to be guessed, although this is not commonly relevant. Importantly, typical use cases do not guarantee that an attacker can exploit this vulnerability to upload and execute arbitrary code, as other controls and context matter. The CVSS 3.1 base score is 3.1 (low severity), reflecting a network attack vector, high attack complexity, low privileges required, no user interaction, unchanged scope, no confidentiality or availability impact, and limited integrity impact. No known exploits are reported in the wild as of the publication date (April 26, 2025). No official patches are linked yet, but upgrading to version 3.5.3 or later is implied to remediate the issue. Overall, this vulnerability highlights a weakness in randomness quality for filename generation in a popular Node.js library, which could be leveraged in specific scenarios to facilitate unauthorized file access or manipulation.
Potential Impact
For European organizations using node-formidable in their web applications, especially those handling file uploads, this vulnerability could lead to limited integrity risks. An attacker might guess filenames of uploaded files, potentially overwriting or accessing files that should remain protected. While the direct impact on confidentiality and availability is negligible, the integrity compromise could facilitate further attacks, such as webshell uploads or unauthorized code execution, if combined with other vulnerabilities or misconfigurations. Organizations in sectors with high web application usage—such as e-commerce, finance, healthcare, and public services—may face increased risk if they rely on vulnerable versions of Formidable without additional mitigations. The low CVSS score and absence of known exploits suggest the threat is currently low, but the potential for chained attacks or targeted exploitation in sensitive environments warrants attention. European organizations with strict data protection regulations (e.g., GDPR) must consider the risk of unauthorized file manipulation as a compliance concern. The impact is more pronounced in environments where uploaded files are executed or processed without strict validation or sandboxing.
Mitigation Recommendations
1. Upgrade node-formidable to version 3.5.3 or later, where the use of cryptographically weak PRNGs for filename generation has been addressed. 2. Implement additional filename randomization or hashing mechanisms using cryptographically secure PRNGs (e.g., Node.js crypto.randomBytes) at the application level to override default filename generation. 3. Enforce strict validation and sanitization of uploaded files, including file type checks, size limits, and content scanning to prevent malicious uploads. 4. Apply access controls and sandboxing to uploaded files to prevent execution or unauthorized access, such as storing uploads outside the web root or using dedicated storage services. 5. Monitor logs for unusual file access patterns or repeated failed attempts to guess filenames, which could indicate exploitation attempts. 6. Conduct regular dependency audits and vulnerability scans to detect use of vulnerable Formidable versions. 7. Educate developers about the risks of weak randomness in security-critical contexts and encourage use of cryptographically secure libraries. These mitigations go beyond generic advice by focusing on layered defenses, secure coding practices, and operational monitoring tailored to the specific weakness in filename generation.
For access to advanced analysis and higher rate limits, contact root@offseq.com
Technical Details
- Data Version
- 5.1
- Assigner Short Name
- mitre
- Date Reserved
- 2025-04-26T00:00:00.000Z
- Cisa Enriched
- true
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 682d983cc4522896dcbeec7c
Added to database: 5/21/2025, 9:09:16 AM
Last enriched: 6/25/2025, 12:49:37 AM
Last updated: 8/15/2025, 2:01:25 AM
Views: 28
Related Threats
CVE-2025-9008: SQL Injection in itsourcecode Online Tour and Travel Management System
MediumCVE-2025-9007: Buffer Overflow in Tenda CH22
HighCVE-2025-9006: Buffer Overflow in Tenda CH22
HighCVE-2025-9005: Information Exposure Through Error Message in mtons mblog
MediumCVE-2025-9004: Improper Restriction of Excessive Authentication Attempts in mtons mblog
MediumActions
Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.
External Links
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.