Skip to content
Heist/ feed
Medium

Lean 4 before 4.32.2 Kernel Accepts Opaque Declaration With an Unbound Free Variable

Type: advisorySource: Official CVE List1 source record

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.

Announced Source revision 1
Original source ↗

CVE-2026-72711

Primary source · Revision 1

Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.

Security context

Source reference: cve:CVE-2026-72711

lean4

Source reference: /containers/cna/affected/0/product

Affected versions
Not stated in this record
Fixed versions
Not stated in this record
Prerequisites
Not stated in this record

Structured affected-version data

Original package identities and version rules from this source.

[
  {
    "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"
  }
]
Related CVEs
CVE-2026-72711

Source reference: /cveMetadata/cveId

Publisher severity

medium

Source reference: /containers/cna/metrics

Event
#952 · Revision 1
Added to Heist Feed
Publisher date
Read the original announcement