CVE-2026-40504: CWE-122 Heap-based Buffer Overflow in marcobambini gravity
Creolabs Gravity before 0.9.6 contains a heap buffer overflow vulnerability in the gravity_vm_exec function that allows attackers to write out-of-bounds memory by crafting scripts with many string literals at global scope. Attackers can exploit insufficient bounds checking in gravity_fiber_reassign() to corrupt heap metadata and achieve arbitrary code execution in applications that evaluate untrusted scripts.
AI Analysis
Technical Summary
CVE-2026-40504 is a critical heap buffer overflow vulnerability in Creolabs Gravity prior to version 0.9.6. The vulnerability exists in the gravity_vm_exec function, where processing scripts with numerous global string literals can cause out-of-bounds writes. Additionally, the gravity_fiber_reassign() function lacks sufficient bounds checking, enabling heap metadata corruption. Successful exploitation can result in arbitrary code execution within applications that run untrusted Gravity scripts.
Potential Impact
An attacker can exploit this vulnerability remotely without authentication to execute arbitrary code on the affected system. This can lead to full compromise of applications embedding the vulnerable Gravity engine, potentially allowing control over the host environment. The CVSS 4.0 base score is 9.3, indicating critical severity with high impact on confidentiality, integrity, and availability.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, avoid evaluating untrusted Gravity scripts or restrict script inputs to trusted sources. Monitor vendor channels for updates regarding patches or official mitigations.
CVE-2026-40504: CWE-122 Heap-based Buffer Overflow in marcobambini gravity
Description
Creolabs Gravity before 0.9.6 contains a heap buffer overflow vulnerability in the gravity_vm_exec function that allows attackers to write out-of-bounds memory by crafting scripts with many string literals at global scope. Attackers can exploit insufficient bounds checking in gravity_fiber_reassign() to corrupt heap metadata and achieve arbitrary code execution in applications that evaluate untrusted scripts.
CVSS v4.0
Score 9.3critical
Affected software
pkg:github/marcobambini/gravityRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
CVE-2026-40504 is a critical heap buffer overflow vulnerability in Creolabs Gravity prior to version 0.9.6. The vulnerability exists in the gravity_vm_exec function, where processing scripts with numerous global string literals can cause out-of-bounds writes. Additionally, the gravity_fiber_reassign() function lacks sufficient bounds checking, enabling heap metadata corruption. Successful exploitation can result in arbitrary code execution within applications that run untrusted Gravity scripts.
Potential Impact
An attacker can exploit this vulnerability remotely without authentication to execute arbitrary code on the affected system. This can lead to full compromise of applications embedding the vulnerable Gravity engine, potentially allowing control over the host environment. The CVSS 4.0 base score is 9.3, indicating critical severity with high impact on confidentiality, integrity, and availability.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, avoid evaluating untrusted Gravity scripts or restrict script inputs to trusted sources. Monitor vendor channels for updates regarding patches or official mitigations.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- VulnCheck
- Date Reserved
- 2026-04-13T20:29:02.808Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 69e03f8c82d89c981fff3a61
Added to database: 04/16/2026, 01:46:52 UTC
Last enriched: 07/15/2026, 10:27:46 UTC
Last updated: 07/31/2026, 19:22:58 UTC
Views: 163
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.