Lean 4 before 4.32.2 Kernel Accepts Opaque Declaration With an Unbound Free Variable
The Lean 4 kernel does not check that the body of an opaque declaration is closed. environment::add_opaque omits the check_no_metavar_no_fvar call that the definition and theorem paths perform, so a value containing a free variable that is absent from the local context is not rejected outright. A metaprogram can first cause the kernel to create a temporary local of type False and record its type in the type checker's inference cache, then restore the local context while that cache entry persists on the same type checker instance, and finally submit an opaque declaration whose value is the now-unbound variable. The cache lookup answers before the branch that would test membership of the local context, so the kernel infers the cached type and admits an opaque constant of type False, from which any proposition follows. The declaration is accepted through the ordinary checked path at maximum kernel checking, without sorry, unsafeCast, debug.skipKernelTC, addDeclWithoutChecking, foreign code or a modified .olean file, and the result carries no axioms. Fixed in 4.32.2 by adding the missing closure check.
- Products
- lean4
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2026-72711
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 29 Oct 2026, 07:55 UTC · Revision 2
Source evidence
Lean 4 before 4.32.2 Kernel Accepts Opaque Declaration With an Unbound Free Variable
core-cve · Original sourcePublished 24 Aug 2026, 20:08 UTC
The Lean 4 kernel does not check that the body of an opaque declaration is closed. environment::add_opaque omits the check_no_metavar_no_fvar call that the definition and theorem paths perform, so a value containing a free variable that is absent from the local context is not rejected outright. A metaprogram can first cause the kernel to create a temporary local of type False and record its type in the type checker's inference cache, then restore the local context while that cache entry persists on the same type checker instance, and finally submit an opaque declaration whose value is the now-unbound variable. The cache lookup answers before the branch that would test membership of the local context, so the kernel infers the cached type and admits an opaque constant of type False, from which any proposition follows. The declaration is accepted through the ordinary checked path at maximum kernel checking, without sorry, unsafeCast, debug.skipKernelTC, addDeclWithoutChecking, foreign code or a modified .olean file, and the result carries no axioms. Fixed in 4.32.2 by adding the missing closure check.
cve:CVE-2026-72711
lean4
Fixed versions: Not specified
Complete source record
{
"id": "b7df20970118f1b6991cac88e42f07a6d0a2965dbaedb6a81593773052acc561",
"url": "https://www.cve.org/CVERecord?id=CVE-2026-72711",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "Lean 4 before 4.32.2 Kernel Accepts Opaque Declaration With an Unbound Free Variable",
"summary": "The Lean 4 kernel does not check that the body of an opaque declaration is closed. environment::add_opaque omits the check_no_metavar_no_fvar call that the definition and theorem paths perform, so a value containing a free variable that is absent from the local context is not rejected outright. A metaprogram can first cause the kernel to create a temporary local of type False and record its type in the type checker's inference cache, then restore the local context while that cache entry persists on the same type checker instance, and finally submit an opaque declaration whose value is the now-unbound variable. The cache lookup answers before the branch that would test membership of the local context, so the kernel infers the cached type and admits an opaque constant of type False, from which any proposition follows. The declaration is accepted through the ordinary checked path at maximum kernel checking, without sorry, unsafeCast, debug.skipKernelTC, addDeclWithoutChecking, foreign code or a modified .olean file, and the result carries no axioms. Fixed in 4.32.2 by adding the missing closure check.",
"evidence": "cve:CVE-2026-72711",
"products": [
{
"name": {
"value": "lean4",
"evidence": "/containers/cna/affected/0/product"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": []
}
],
"severity": "medium",
"structured": {
"id": "CVE-2026-72711",
"aliases": [
"CVE-2026-72711"
],
"metrics": [
{
"format": "CVSS",
"cvssV4_0": {
"version": "4.0",
"baseScore": 6.8,
"attackVector": "LOCAL",
"baseSeverity": "MEDIUM",
"vectorString": "CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N",
"userInteraction": "PASSIVE",
"attackComplexity": "LOW",
"attackRequirements": "NONE",
"privilegesRequired": "NONE",
"subIntegrityImpact": "NONE",
"vulnIntegrityImpact": "HIGH",
"subAvailabilityImpact": "NONE",
"vulnAvailabilityImpact": "NONE",
"subConfidentialityImpact": "NONE",
"vulnConfidentialityImpact": "NONE"
}
},
{
"format": "CVSS",
"cvssV3_1": {
"scope": "CHANGED",
"version": "3.1",
"baseScore": 6.3,
"attackVector": "LOCAL",
"baseSeverity": "MEDIUM",
"vectorString": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:N/I:H/A:N",
"integrityImpact": "HIGH",
"userInteraction": "REQUIRED",
"attackComplexity": "LOW",
"availabilityImpact": "NONE",
"privilegesRequired": "NONE",
"confidentialityImpact": "NONE"
}
}
],
"affected": [
{
"repo": "https://github.com/leanprover/lean4",
"vendor": "leanprover",
"product": "lean4",
"versions": [
{
"status": "affected",
"version": "0",
"lessThan": "4.32.2",
"versionType": "semver"
}
],
"packageURL": "pkg:github/leanprover/lean4",
"defaultStatus": "unaffected"
}
],
"modified": "2026-10-26T01:23:57.370Z",
"provider": "cve",
"references": [
"https://github.com/leanprover/lean4",
"https://github.com/leanprover/lean4/issues/14484",
"https://github.com/leanprover/lean4/pull/14498",
"https://github.com/endrazine/lean-cve-poc-14484",
"https://www.vulncheck.com/advisories/lean-4-before-kernel-accepts-opaque-declaration-with-an-unbound-free-variable"
],
"provider_metadata": {
"adp": [
{
"title": "CISA ADP Vulnrichment",
"metrics": [
{
"other": {
"type": "ssvc",
"content": {
"id": "CVE-2026-72711",
"role": "CISA Coordinator",
"options": [
{
"Exploitation": "poc"
},
{
"Automatable": "no"
},
{
"Technical Impact": "partial"
}
],
"version": "2.0.3",
"timestamp": "2026-08-24T20:14:31.474084Z"
}
}
}
],
"providerMetadata": {
"orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
"shortName": "CISA-ADP",
"dateUpdated": "2026-08-24T20:14:41.969Z"
}
},
{
"title": "CVE Program Container",
"references": [
{
"url": "http://www.openwall.com/lists/oss-security/2026/10/26/3"
}
],
"providerMetadata": {
"orgId": "af854a3a-2127-422b-91ae-364da2661108",
"shortName": "CVE",
"dateUpdated": "2026-10-26T01:23:57.370Z"
}
}
],
"cna": {
"orgId": "83251b91-4cc7-4094-a5c7-464a1b83ea10",
"shortName": "VulnCheck",
"dateUpdated": "2026-09-24T14:18:53.683Z"
}
}
},
"related_cves": [
{
"value": "CVE-2026-72711",
"evidence": "/cveMetadata/cveId"
}
],
"security_relevant": true,
"severity_evidence": "/containers/cna/metrics"
},
"source_id": "core-cve",
"document_id": 231505,
"published_at": "2026-08-24T20:08:33.219+00:00"
}