Retroactive Grant Application - Two Critical Zebra Consensus Vulnerabilities

Hello Zcash community,

I have submitted a Q4 retroactive grant application on GitHub (#77), requesting $300,000 USD for two Critical Zebra consensus vulnerabilities that I found and privately reported before they shipped. In a release, either one would have split the Zcash network.

Read the full technical write-up here:

What I found

PR #10461 replaced Zebra’s own transaction parser with the shared zcash_primitives library. Two rules that every Zcash node must enforce were lost in the move:

  • C-01: anyone could split the network with one transaction. Zebra’s main branch accepted about 2.1 billion invalid nExpiryHeight values above the ZIP 203 maximum. No mining and no authentication were needed.

  • C-02: any miner could split the network with one block. The coinbase scriptSig length rule (2 to 100 bytes) was no longer enforced.

These are two separate findings: they break different rules, different people could trigger them, and each would have split the network on its own. ZF fixed them in separate commits.

Upgraded Zebra nodes would have accepted these transactions and blocks, while Zakura and older Zebra nodes would have rejected them. Once the split passed Zebra’s 1,000-block rollback limit (about 21 hours), ending it would have taken a resync of every affected node or a hard fork.

How I found them: Zakura v1.3.1 never adopted the refactor, so I used it as a reference: any transaction or block that Zakura rejects and Zebra main accepts is a consensus divergence. I used LLM-assisted code review to map the refactor and generate leads, confirmed both findings by hand with deterministic tests, and reported them privately on 2 September with the split scenario and a suggested fix.

What the Zcash Foundation did

ZF made both findings a release blocker, merged the fix six days after my report (PR #11387), and shipped Zebra 6.4.0 with both rules enforced. No release ever carried them.

“Both findings identified and responsibly disclosed by @ouicate. We appreciate your contribution in identifying and mitigating what would have been a nasty consensus bug in Zebra before we shipped it.”
— Zcash Foundation, Issue #11383

ZF also added a permanent Zebra Book chapter, Refactoring Consensus-Critical Code, “distilled from this incident”, and credited me in its engineering update.

Why $150,000 per finding

Coinholders approved these Critical security applications in Q3 (finalized tally):

I use the same method as #58: the $150,000 Core Node Critical base for each sole-reporter consensus finding, with no bonus.

  • ZF rates bugs like these Critical. ZF publishes severity ratings in advisories for affected releases, so these two never received one. When consensus divergences like these did ship, ZF rated them Critical: GHSA-cwfq-rfcr-8hmp, GHSA-2prc-cj5x-4443 and GHSA-jv4h-j224-23cc, all three part of #58.

  • The difference is timing, not severity. One of the #58 findings was live for about 20 hours. ZF rated it Critical, and coinholders approved $150,000 for it. I reported mine 21 days before the release that would have carried them.

  • They would have shipped. ZF made the fix a blocker for the next release, and that refactor did ship another bug: ZF’s advisory GHSA-7jp4-mq53-4cvq (High) says it was “introduced by the Transaction newtype refactor, PR #10461”, and it affected Zebra 6.4.0 to 6.4.2.

  • A discount would reward waiting. A bug reported after release earns a published advisory, a severity rating and a CVE. The same bug reported on the development branch earns a GitHub issue. If it also earns less, the next researcher has every reason to wait. I reported early, and said publicly before any grant was on the table that this is what the ecosystem should encourage.

Finding Credit Requested
C-01: nExpiryHeight above the ZIP 203 maximum accepted Sole reporter $150,000
C-02: coinbase scriptSig length rule not enforced Sole reporter $150,000
Total $300,000

Nothing has been paid for these findings, and there was no bounty route: ZCG closed its bounty program in May, three months before the refactor was merged.

Evidence

Thank you to the Zebra team for fixing these within days, to the coinholders who funded Zebra security research in Q3, and to you for reading. I’m happy to answer questions about the findings and the evidence in this thread.

5 Likes

thanks for great work

I think this proposal also raises an interesting question for coinholders:
Should bounties be paid for critical bugs found in the develop branch?

Personally, I think it could set a good precedent, given that it ultimately helped protect the Zcash network :mechanical_arm:

But, it’s definitely not the kind of credit we’d typically see on platforms like Immunefi lol. Because a lot of projects on those platforms try to avoid paying out bounties whenever they can, often using excuses like “Only bugs that are live on mainnet are eligible,” or “We’re still waiting for an audit,” and so on lol.

2 Likes

Thanks @sangsoo. You’re the right person to ask, because your own findings answer it.

My answer is yes: pay them at the same rate as shipped bugs, as long as they were really headed for a release.

1. Prevention is what coinholders pay for either way. Your #58 put it best: “Prevention is the completed security outcome.” You didn’t claim any of the five was exploited, and coinholders approved it with 96.33%. They paid for splits that never happened. A Critical caught on main is the same prevention, finished earlier.

2. Timing only changes how long the network is exposed. Your GHSA-2prc-cj5x-4443 shows it. Zebra 4.5.0 carried it for about 20 hours before 4.5.1 shipped, and every node that hadn’t upgraded stayed exposed after that. You found it fast and ZF fixed it the same day, which was the best possible outcome once 4.5.0 was out. The only better outcome is the same bug caught before the release: same severity, zero hours of exposure. It would be strange to pay that version less.

3. A discount pays researchers to wait. If a pre-release Critical earns less than a shipped one, the rational move is to hold it until the release goes out. The researcher collects the difference and the network carries the risk. That’s what an “only bugs live on mainnet” rule does: it protects the payer’s budget, not the network.

ZF already asks for early reports. Zebra’s security policy says: “Reports against main are welcome and part of how we catch issues before they ship.” The Zebra team also wrote to me about my two findings: “Catching it before the release that would first carry it is exactly the kind of review we value. Thanks again for the careful work.” The policy only changes the paperwork: there’s no advisory or CVE, because “advisories exist to tell operators whether they are exposed”, and no operator was. ZF doesn’t pay for reports and ZCG’s bounty program has closed, so whether early reporting gets rewarded is up to coinholders.

Mine were really headed for a release. #11383 made them “a release blocker for the next release cut from main” and credited me with “identifying and mitigating what would have been a nasty consensus bug in Zebra before we shipped it”. The same refactor did ship a different bug, GHSA-7jp4-mq53-4cvq (High), in Zebra 6.4.0.

They’re just as serious, too: each has a twin among your Critical advisories. C-01 takes the same mempool-to-getblocktemplate-to-block path as GHSA-cwfq-rfcr-8hmp, and C-02 is a miner-built block that only Zebra’s main accepted, like GHSA-jv4h-j224-23cc.

If anything, catching a Critical before release is the better result: no emergency release, no operator upgrades, no exposure window. I’m still only asking for the same per-finding amount as a shipped Critical.

4 Likes

yeah, it would be a terrible case to have to wait until the release is out, hoping the developers don’t catch the bug :rofl:

1 Like

Great work!

Supporting this. ZF’s tracking issue credits @ouicate for both bugs and made the fix a release blocker, and Zebra 6.4.0 shipped with both rules enforced. Catching consensus bugs before release is exactly what we want researchers to do.

3 Likes