{"id":"CVE-2026-2240","summary":"janet-lang janet compile.c janetc_pop_funcdef out-of-bounds","details":"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.","modified":"2026-08-12T15:31:38.473966Z","published":"2026-02-09T15:32:10.307Z","database_specific":{"cna_assigner":"VulDB","cwe_ids":["CWE-119","CWE-125"],"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/2xxx/CVE-2026-2240.json"},"references":[{"type":"WEB","url":"https://github.com/janet-lang/janet/"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/2xxx/CVE-2026-2240.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-2240"},{"type":"ADVISORY","url":"https://vuldb.com/?id.344979"},{"type":"ADVISORY","url":"https://vuldb.com/?submit.753155"},{"type":"REPORT","url":"https://github.com/janet-lang/janet/issues/1702"},{"type":"REPORT","url":"https://github.com/janet-lang/janet/issues/1702#issuecomment-3790473369"},{"type":"REPORT","url":"https://vuldb.com/?ctiid.344979"},{"type":"FIX","url":"https://github.com/janet-lang/janet/commit/4dd08a4cdef5b1c42d9a2c19fc24412e97ef51d5"},{"type":"EVIDENCE","url":"https://github.com/oneafter/0123/blob/main/ja4/repro"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/janet-lang/janet","events":[{"introduced":"0"},{"fixed":"4dd08a4cdef5b1c42d9a2c19fc24412e97ef51d5"}],"database_specific":{"cpe":"cpe:2.3:a:janet-lang:janet:*:*:*:*:*:*:*:*","extracted_events":[{"introduced":"0"},{"last_affected":"1.40.1"}],"source":["CPE_RANGE","REFERENCES"]}}],"versions":["1.40.0","1.40.1","v1.38.0","v1.40.1","v1.40.0","v1.39.1","v1.39.0","v1.37.1","v1.37.0","v1.36.0","v1.35.2","v1.35.1","v1.35.0","v1.34.0","v1.33.0","v1.32.1","v1.32.0","v1.31.0","v1.30.0","v1.29.1","v1.29.0","v1.28.0","v1.27.0","v1.26.0","v1.25.1","v1.25.0","v1.24.1","v1.24.0","v1.23.0","v1.22.0","v1.21.2","v1.21.1","v1.21.0","v1.20.0","v1.19.2","v1.19.1","1.19.1-rc1","v1.19.0","v1.18.1","v1.18.0","v1.17.2","v1.17.1","v1.17.0","v1.16.1","v1.16.0","v1.15.5","v1.15.4","v1.15.3","v1.15.2","v1.15.1","v1.15.0","v1.14.2","v1.14.1","v1.13.1","v1.13.0","v1.9.1","v1.9.0","v1.8.1","v1.8.0","v1.7.0","v1.6.0","v1.5.1","v1.5.0","v1.4.0","v1.2.0","v1.1.0","v1.0.0","v0.6.0","v0.5.0","v0.4.1","v0.4.0","0.3.0","0.2.0","0.1.0"],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-2240.json","vanir_signatures_modified":"2026-08-12T15:31:38Z","vanir_signatures":[{"signature_type":"Function","signature_version":"v1","source":"https://github.com/janet-lang/janet/commit/4dd08a4cdef5b1c42d9a2c19fc24412e97ef51d5","target":{"function":"janet_dynprintf","file":"src/core/io.c"},"deprecated":false,"digest":{"function_hash":"214190959972194526235716830265561870328","length":1116},"id":"CVE-2026-2240-018d563a"},{"deprecated":false,"digest":{"function_hash":"32326709762157823266090130667596064746","length":3765},"id":"CVE-2026-2240-1949eac5","signature_type":"Function","signature_version":"v1","source":"https://github.com/janet-lang/janet/commit/4dd08a4cdef5b1c42d9a2c19fc24412e97ef51d5","target":{"file":"src/core/compile.c","function":"janetc_pop_funcdef"}},{"deprecated":false,"digest":{"function_hash":"129974172248156411833689488678535627705","length":343},"id":"CVE-2026-2240-2ea0244e","signature_type":"Function","signature_version":"v1","source":"https://github.com/janet-lang/janet/commit/4dd08a4cdef5b1c42d9a2c19fc24412e97ef51d5","target":{"file":"src/mainclient/shell.c","function":"savehistory"}},{"signature_version":"v1","source":"https://github.com/janet-lang/janet/commit/4dd08a4cdef5b1c42d9a2c19fc24412e97ef51d5","target":{"file":"src/core/io.c"},"deprecated":false,"digest":{"threshold":0.9,"line_hashes":["101787241100834466017908988923848359954","242226077026452114764669332311655084445","24257182039059199003417950454958484776","185063801959956441004938115134755199383"]},"id":"CVE-2026-2240-2fd86e35","signature_type":"Line"},{"signature_version":"v1","source":"https://github.com/janet-lang/janet/commit/4dd08a4cdef5b1c42d9a2c19fc24412e97ef51d5","target":{"file":"src/core/compile.c"},"deprecated":false,"digest":{"line_hashes":["329320749035855979406612586541100938939","330133427121041722600053945692365024221","41715594008354400220783834437480755309","67983710413322016106816538753725412786","98048863920160825096524601563683997678"],"threshold":0.9},"id":"CVE-2026-2240-6ce8f497","signature_type":"Line"},{"signature_type":"Line","signature_version":"v1","source":"https://github.com/janet-lang/janet/commit/4dd08a4cdef5b1c42d9a2c19fc24412e97ef51d5","target":{"file":"src/mainclient/shell.c"},"deprecated":false,"digest":{"line_hashes":["292535847021121797384379015677985504527","152945569975190055018400356135222682900","35338272386683302072103242016952696209","66644456928388379379016150498362920016"],"threshold":0.9},"id":"CVE-2026-2240-a8ab9ed6"}]}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:P"}]}