CVE-2025-46688: CWE-131 Incorrect Calculation of Buffer Size in QuickJS Project QuickJS
quickjs-ng through 0.9.0 has an incorrect size calculation in JS_ReadBigInt for a BigInt, leading to a heap-based buffer overflow. QuickJS before 2025-04-26 is also affected.
AI Analysis
Technical Summary
CVE-2025-46688 is a medium severity vulnerability identified in the QuickJS project, specifically affecting versions up to and including 0.9.0 and any versions prior to 2025-04-26. The vulnerability arises from an incorrect calculation of buffer size in the JS_ReadBigInt function, which is responsible for reading BigInt values. This incorrect size calculation leads to a heap-based buffer overflow (CWE-131), where more data is written to a buffer than it can hold, potentially corrupting adjacent memory. The vulnerability impacts the confidentiality, integrity, and availability of systems running QuickJS by allowing an attacker to manipulate memory, which could lead to arbitrary code execution, data leakage, or application crashes. The CVSS 3.1 base score is 5.6, indicating a medium severity level. The vector string (CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:L) shows that the attack vector requires local access (AV:L), has high attack complexity (AC:H), requires no privileges (PR:N), and no user interaction (UI:N). The scope is changed (S:C), meaning the vulnerability affects resources beyond the initially vulnerable component. The impact on confidentiality, integrity, and availability is low but present. No known exploits are reported in the wild yet, and no official patches have been linked at the time of publication. QuickJS is a small and embeddable JavaScript engine used in various applications and devices, often in embedded systems or IoT devices, where BigInt support is required. The heap overflow could be triggered by maliciously crafted input processed by QuickJS, potentially leading to memory corruption and exploitation by local attackers or processes with access to the QuickJS engine environment.
Potential Impact
For European organizations, the impact of this vulnerability depends largely on the deployment of QuickJS within their software stack. QuickJS is commonly embedded in IoT devices, edge computing platforms, and some lightweight applications. Organizations in sectors such as manufacturing, telecommunications, and critical infrastructure that utilize embedded systems running QuickJS could face risks of local privilege escalation, data corruption, or denial of service. The heap overflow could be exploited to execute arbitrary code or cause system instability, potentially disrupting operations or leading to unauthorized data access. Given the local attack vector and high complexity, remote exploitation is unlikely without additional vulnerabilities or access. However, in environments where multiple components interact, this vulnerability could be chained with others to escalate impact. The confidentiality, integrity, and availability of systems could be compromised, especially in industrial control systems or devices with sensitive data processing. The medium severity rating suggests that while the threat is not immediately critical, it requires timely attention to prevent exploitation in sensitive environments.
Mitigation Recommendations
1. Immediate identification and inventory of all systems and applications embedding QuickJS, especially versions up to 0.9.0 and those released before 2025-04-26. 2. Apply patches or updates from the QuickJS project as soon as they become available; monitor official QuickJS repositories and security advisories for releases addressing CVE-2025-46688. 3. Where patching is not immediately possible, implement strict access controls to limit local access to systems running QuickJS, reducing the risk of local exploitation. 4. Employ runtime protections such as memory protection mechanisms (e.g., ASLR, DEP) and sandboxing to mitigate the impact of heap overflows. 5. Conduct code audits and fuzz testing on applications embedding QuickJS to detect similar or related memory handling issues. 6. Monitor logs and system behavior for anomalies indicative of exploitation attempts, such as unexpected crashes or memory corruption events. 7. For IoT and embedded devices, coordinate with vendors to ensure firmware updates include the necessary fixes. 8. Educate developers and system integrators about secure handling of BigInt data and proper buffer size calculations to prevent similar vulnerabilities in custom code.
Affected Countries
Germany, France, United Kingdom, Netherlands, Italy, Sweden, Finland
CVE-2025-46688: CWE-131 Incorrect Calculation of Buffer Size in QuickJS Project QuickJS
Description
quickjs-ng through 0.9.0 has an incorrect size calculation in JS_ReadBigInt for a BigInt, leading to a heap-based buffer overflow. QuickJS before 2025-04-26 is also affected.
AI-Powered Analysis
Technical Analysis
CVE-2025-46688 is a medium severity vulnerability identified in the QuickJS project, specifically affecting versions up to and including 0.9.0 and any versions prior to 2025-04-26. The vulnerability arises from an incorrect calculation of buffer size in the JS_ReadBigInt function, which is responsible for reading BigInt values. This incorrect size calculation leads to a heap-based buffer overflow (CWE-131), where more data is written to a buffer than it can hold, potentially corrupting adjacent memory. The vulnerability impacts the confidentiality, integrity, and availability of systems running QuickJS by allowing an attacker to manipulate memory, which could lead to arbitrary code execution, data leakage, or application crashes. The CVSS 3.1 base score is 5.6, indicating a medium severity level. The vector string (CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:L) shows that the attack vector requires local access (AV:L), has high attack complexity (AC:H), requires no privileges (PR:N), and no user interaction (UI:N). The scope is changed (S:C), meaning the vulnerability affects resources beyond the initially vulnerable component. The impact on confidentiality, integrity, and availability is low but present. No known exploits are reported in the wild yet, and no official patches have been linked at the time of publication. QuickJS is a small and embeddable JavaScript engine used in various applications and devices, often in embedded systems or IoT devices, where BigInt support is required. The heap overflow could be triggered by maliciously crafted input processed by QuickJS, potentially leading to memory corruption and exploitation by local attackers or processes with access to the QuickJS engine environment.
Potential Impact
For European organizations, the impact of this vulnerability depends largely on the deployment of QuickJS within their software stack. QuickJS is commonly embedded in IoT devices, edge computing platforms, and some lightweight applications. Organizations in sectors such as manufacturing, telecommunications, and critical infrastructure that utilize embedded systems running QuickJS could face risks of local privilege escalation, data corruption, or denial of service. The heap overflow could be exploited to execute arbitrary code or cause system instability, potentially disrupting operations or leading to unauthorized data access. Given the local attack vector and high complexity, remote exploitation is unlikely without additional vulnerabilities or access. However, in environments where multiple components interact, this vulnerability could be chained with others to escalate impact. The confidentiality, integrity, and availability of systems could be compromised, especially in industrial control systems or devices with sensitive data processing. The medium severity rating suggests that while the threat is not immediately critical, it requires timely attention to prevent exploitation in sensitive environments.
Mitigation Recommendations
1. Immediate identification and inventory of all systems and applications embedding QuickJS, especially versions up to 0.9.0 and those released before 2025-04-26. 2. Apply patches or updates from the QuickJS project as soon as they become available; monitor official QuickJS repositories and security advisories for releases addressing CVE-2025-46688. 3. Where patching is not immediately possible, implement strict access controls to limit local access to systems running QuickJS, reducing the risk of local exploitation. 4. Employ runtime protections such as memory protection mechanisms (e.g., ASLR, DEP) and sandboxing to mitigate the impact of heap overflows. 5. Conduct code audits and fuzz testing on applications embedding QuickJS to detect similar or related memory handling issues. 6. Monitor logs and system behavior for anomalies indicative of exploitation attempts, such as unexpected crashes or memory corruption events. 7. For IoT and embedded devices, coordinate with vendors to ensure firmware updates include the necessary fixes. 8. Educate developers and system integrators about secure handling of BigInt data and proper buffer size calculations to prevent similar vulnerabilities in custom code.
Affected Countries
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-27T00:00:00.000Z
- Cisa Enriched
- true
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 682d983dc4522896dcbef6de
Added to database: 5/21/2025, 9:09:17 AM
Last enriched: 6/24/2025, 7:50:33 PM
Last updated: 8/12/2025, 11:47:57 AM
Views: 19
Related Threats
CVE-2025-9012: SQL Injection in PHPGurukul Online Shopping Portal Project
MediumCVE-2025-9011: SQL Injection in PHPGurukul Online Shopping Portal Project
MediumCVE-2025-9010: SQL Injection in itsourcecode Online Tour and Travel Management System
MediumCVE-2025-9009: SQL Injection in itsourcecode Online Tour and Travel Management System
MediumCVE-2025-31961: CWE-1220 Insufficient Granularity of Access Control in HCL Software Connections
LowActions
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.