← All insights
ECOSYSTEMShielded Labs

Put publicly exposed zcashd behind Zebra

Exchanges and custodians running publicly exposed zcashd are advised to put Zebra in front of it to reduce exposure to network-based attacks.

Shielded Labs advised everyone running an externally accessible zcashd, such as exchanges, custodians and infrastructure providers, to put Zebra in front of it to reduce the attack surface. It describes this as a simple, low-risk change that greatly lowers exposure to network-based attacks without changing how zcashd is used. The background is the recent vulnerability discoveries. In March, a white-hat researcher used AI to find a critical zcashd vulnerability that had gone undiscovered for almost six years, and it was quickly patched.

Afterward, the same researcher found additional lower-severity vulnerabilities in zcashd and Zebra, and ZODL, the Zcash Foundation and Shielded Labs triaged them. The author expects that more bugs will be found with the help of AI, and may be exploited in practice. The recommendation is that zcashd not talk directly to peers on the internet but connect only to your own Zebra node. Zebra handles all P2P connections, doing message parsing, block header validation and peer management in memory-safe Rust.

This setup holds even if Zebra has a bug. If Zebra crashes or stops relaying, zcashd keeps handling local requests but is cut off from the internet, a fail-stop state. In a chain fork, if the maximum-hashpower chain is incompatible with zcashd, zcashd rejects all blocks and is effectively cut off, and if it is incompatible with Zebra, zcashd follows the minority chain and updates slow down for hours to days, a fail-slow state. If a bug in a low-level cryptographic library shared by both implementations merely halts the node, that is also fail-stop.

For setup, once you have a synced Zebra node, just add one line, connect=127.0.0.1:8233, to zcash.conf. Zebra listens on port 8233 (mainnet) by default so no extra configuration is needed, and with connect, zcashd does not open a listening port, so there is no port conflict even on the same machine. After restarting both nodes, check with getpeerinfo that the only peer is 127.0.0.1. zcashd behaves as before, and you just need to monitor the new Zebra node's status.

This summary is based on the original; check the original for exact details.