Skip to content
FlawDB
Sign in
Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

CVE-2026-41197

CRITICAL 9.3EPSS 37%

Brillig: Heap corruption in foreign call results with nested tuple arrays

Also known as GHSA-jj7c-x25r-r8r3

Mitigation

  • Upgrade brillig to 1.0.0-beta.19 or later.

Who should check

  • Projects that depend on crates.io package brillig (< 1.0.0-beta.19)
  • Anyone running noir-lang noir < 1.0.0-beta.19

Vulnerability facts

Affected
brillig < 1.0.0-beta.19
Fixed in
1.0.0-beta.19
Exploited in the wild
Not in CISA KEV
Public exploit / PoC
None known
Remote exploitation
Remote, no login needed
CVSS
9.3 (v4.0, CNA)CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:NOpen in CVSS calculator
Show all 11 CVSS metrics
  • Attack vector: Network
  • Attack complexity: Low
  • Attack requirements: None
  • Privileges required: None
  • User interaction: None
  • Confidentiality impact: High
  • Integrity impact: High
  • Availability impact: High
  • Confidentiality impact on other systems: None
  • Integrity impact on other systems: None
  • Availability impact on other systems: None
EPSS
0.51% chance of exploitation in 30 days (percentile 37, 2026-11-26)
CWE
CWE-131
Published
Modified

Description

Noir is a Domain Specific Language for SNARK proving systems that is designed to use any ACIR compatible proving system, and Brillig is the bytecode ACIR uses for non-determinism. Noir programs can invoke external functions through foreign calls. When compiling to Brillig bytecode, the SSA instructions are processed block-by-block in `BrilligBlock::compile_block()`. When the compiler encounters an `Instruction::Call` with a `Value::ForeignFunction` target, it invokes `codegen_call()` in `brillig_call/code_gen_call.rs`, which dispatches to `convert_ssa_foreign_call()`. Before emitting the foreign call opcode, the compiler must pre-allocate memory for any array results the call will return. This happens through `allocate_external_call_results()`, which iterates over the result types. For `Type::Array` results, it delegates to `allocate_foreign_call_result_array()` to recursively allocate memory on the heap for nested arrays. The `BrilligArray` struct is the internal representation of a Noir array in Brillig IR. Its `size` field represents the semi-flattened size, the total number of memory slots the array occupies, accounting for the fact that composite types like tuples consume multiple slots per element. This size is computed by `compute_array_length()` in `brillig_block_variables.rs`. For the outer array, `allocate_external_call_results()` correctly uses `define_variable()`, which internally calls `allocate_value_with_type()`. This function applies the formula above, producing the correct semi-flattened size. However, for nested arrays, `allocate_foreign_call_result_array()` contains a bug. The pattern `Type::Array(_, nested_size)` discards the inner types with `_` and uses only `nested_size`, the semantic length of the nested array (the number of logical elements), not the semi-flattened size. For simple element types this works correctly, but for composite element types it under-allocates. Foreign calls returning nested arrays of tuples or other composite types corrupt the Brillig VM heap. Version 1.0.0-beta.19 fixes this issue.

Affected and fixed versions

Package / productAffectedFixedSource
crates.io brillig< 1.0.0-beta.191.0.0-beta.19osv
noir-lang noir< 1.0.0-beta.19—cvelist

Check your systems with an agent

Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.

Check whether anything I run is affected by CVE-2026-41197. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-41197.md
Affected: brillig < 1.0.0-beta.19
Fixed in: 1.0.0-beta.19

Steps:
1. Search this machine and project for brillig (crates.io), noir-lang noir: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.

References

FAQ

Is CVE-2026-41197 being exploited?

There is no confirmed exploitation: CVE-2026-41197 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.51% chance of exploitation in the next 30 days (as of 2026-11-26).

How serious is CVE-2026-41197?

Critical: CVSS 9.3 (v4.0, scored by CNA). Remote, no login needed.

Which versions are affected by CVE-2026-41197?

brillig < 1.0.0-beta.19.

Is there a fix for CVE-2026-41197?

Yes. Fixed in 1.0.0-beta.19. Upgrade brillig to 1.0.0-beta.19 or later.

How do I check if I'm affected by CVE-2026-41197?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

Sponsors