# CVE-2026-40504: Creolabs Gravity < 0.9.6 Heap Buffer Overflow via gravity_vm_exec

- Severity: Critical 9.3 (CVSS:4.0, scored by VulnCheck) `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.66%, higher than 53% of CVEs (2026-12-01)
- Published: 2026-04-16T01:10:27.364Z
- Modified: 2026-11-08T14:02:50.663Z
- Weaknesses: CWE-122
- SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact total
- Assigned by: VulnCheck

## 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.

(As written by CVE List.)

## Affected

- marcobambini gravity: before 0.9.6; before 18b9195598d9b944376754c6d1ad76e38a4adca1

## Every score

- VulnCheck: CVSS:4.0 9.3 Critical `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N`
- VulnCheck: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`

## References

- <https://github.com/marcobambini/gravity/releases/tag/0.9.6> (release-notes)
- <https://github.com/marcobambini/gravity/issues/437> (issue-tracking)
- <https://github.com/marcobambini/gravity/commit/18b9195598d9b944376754c6d1ad76e38a4adca1> (patch)
- <https://www.vulncheck.com/advisories/creolabs-gravity-heap-buffer-overflow-via-gravity-vm-exec> (third-party-advisory)

## Sources

- CVE List: [CVE-2026-40504](https://www.cve.org/CVERecord?id=CVE-2026-40504), CVE Terms of Use, modified 2026-11-08
- NVD: [CVE-2026-40504](https://nvd.nist.gov/vuln/detail/CVE-2026-40504), Public domain, modified 2026-10-26

---

Page: https://cve.day/CVE-2026-40504 · Whole record: https://cve.day/CVE-2026-40504.json · Rebuilt by cve.day 2026-11-25T22:59:18.887Z
