CVE-2026-2240 Details
Description
A vulnerability has been found in janet-lang janet up to 1.40.1. The impacted element is the function janetc_pop_funcdef of the file src/core/compile.c. Such manipulation leads to out-of-bounds read. The attack must be carried out locally. The exploit has been disclosed to the public and may be used. The name of the patch is 4dd08a4cdef5b1c42d9a2c19fc24412e97ef51d5. A patch should be applied to remediate this issue.
A heap-buffer-overflow vulnerability has been identified in Janet versions through 1.40.1. The issue occurs in the function janetc_pop_funcdef within the file src/core/compile.c. This vulnerability leads to an out-of-bounds read, with the error arising 24 bytes past the end of a 4-byte region allocated by calloc. The vulnerability was introduced when the compiler miscalculated the size of upvalue slots, allowing access to memory beyond the allocated buffer. This issue can be reproduced by building Janet with optimization and AddressSanitizer (ASan) enabled, and then running a specific test file that triggers the overflow during the compilation process.
Users can upgrade to Janet version 1.40.1 or apply the patch available in the official GitHub repository to address this vulnerability.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed Feb 9, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/janet-lang/janet/ | [email protected] | Product |
| https://github.com/janet-lang/janet/commit/4dd08a4cdef5b1c42d9a2c19fc24412e97ef51d5 | [email protected] | Patch |
| https://github.com/janet-lang/janet/issues/1702 | [email protected] | ExploitIssue Tracking |
| https://github.com/janet-lang/janet/issues/1702#issuecomment-3790473369 | [email protected] | ExploitIssue Tracking |
| https://github.com/oneafter/0123/blob/main/ja4/repro | [email protected] | Exploit |
| https://vuldb.com/?ctiid.344979 | [email protected] | Permissions RequiredVDB Entry |
| https://vuldb.com/?id.344979 | [email protected] | Third Party AdvisoryVDB Entry |
| https://vuldb.com/?submit.753155 | [email protected] | Third Party AdvisoryVDB Entry |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-125 | Out-of-bounds Read | [email protected] |
| CWE-119 | Improper Restriction of Operations within the Bounds of a Memory Buffer | [email protected] |
| CWE-125 | Out-of-bounds Read | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| janet-lang janet | <= 1.40.1 |
CPE
Remediation
| |
Change History
5 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Apr 29, 2026 | Data Remediation | [email protected] |
| Feb 25, 2026 | Initial Analysis | [email protected] |
| Feb 9, 2026 | New CVE Received | [email protected] |