An analysis of the provided security advisory and release information indicates that the vulnerability lies in Zebra's block validator, which undercounts transparent signature operations (sigops). This flaw could allow an attacker to create a block that is accepted by Zebra nodes but rejected by zcashd nodes, leading to a network split. The vulnerability has two components: the undercounting of legacy sigops in coinbase transactions and the failure to aggregate P2SH sigops during block validation.
The patches for this vulnerability were included in the Zebra v4.4.0 release. By comparing the git tags for versions v4.3.1 and v4.4.0, I was able to identify the commits included in the patch. The key changes are in the zebra-script crate, where the sigops counting logic was corrected.
Specifically, the Count implementation for Sigops was modified to correctly include coinbase inputs when counting legacy sigops. Additionally, a new method, p2sh_sigop_count, was added to the Transaction trait to properly calculate the sigops for P2SH scripts, which are now aggregated at the block level.
The vulnerable functions are those that were responsible for counting sigops before the patch. The primary function is zebra_script::Sigops::count, which previously ignored coinbase inputs. The exploitation of this vulnerability would involve this function, as well as the block validation process that relies on its output. The new p2sh_sigop_count function and the modifications to the Transaction trait are part of the mitigation and highlight the areas where the previous logic was deficient.