-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Security] Harden against seemingly valid BLS signature #555
Comments
Enable - Attestation - Beaconstate (minimal only) - Deposit - DepositData - ProposerSlashing Updates #518
Enable - Attestation - Beaconstate (minimal only) - Deposit - DepositData - ProposerSlashing Updates #518
Enable - Attestation - Beaconstate (minimal only) - Deposit - DepositData - ProposerSlashing Updates #518
* SSZ signature from EF are always opaque blobs (security issue - #555) Enable - Attestation - Beaconstate (minimal only) - Deposit - DepositData - ProposerSlashing Updates #518 * mv debug_ssz to helpers * Small reorg of the list types * Fix IndexedAttestation, AttesterSlashing and BeaconBlock * Deactivate on mainnet: AttesterSlashing, BeaconBlockBody, IndexedAttestation, Attestation, BeaconBlock * Fix Validators on minimal and mainnet
Because this signature is valid according to specification https://github.com/ethereum/eth2.0-specs/blob/dev/specs/bls_signature.md. Because
According to:
|
so.. what's the outcome here? how is it handled in libraries? |
It's an invalid encoding of an infinity point. The issue is that a signature is represented as a (G1, G1) with G1 using 381 bits out of 48 bytes (384 bits) and some of the extra 3 bits are used as flags according to the Zcash serialization spec: https://github.com/zcash/librustzcash/tree/f55f094e/pairing/src/bls12_381#serialization The Ethereum test generators has a 50% chance of setting this infinity bit to 1. But if it's set to 1, the rest of the bits should be set to 0. The NBC fix is that this was raised with test data for the SSZ test vectors, for this suite we only need opaque blob, we never need to deserialize the signatures. The crypto fix is to always reject invalid encoding of infinity points. In BLST this is done by copying the input bytes, then checking if they were all zeros: https://github.com/supranational/blst/blob/27d3083e/src/e2.c#L300-L307 This is not done in Milagro |
See chapter 3.1, we need to fix Milagro https://raw.githubusercontent.com/cryptosubtlety/zero/main/0.pdf Note: in terms of technical implications, we have all the validator pubkeys and they can't be zero so for individual signatures there is no issue. |
I added a new section 5 "A plausible attack scenario at the protocol layer" and its partial PoC attack (https://eprint.iacr.org/2021/323.pdf.) . I hope that the section can at least give you hints or ideas to improve attack or defend yourself. Cheers. |
Closed by #121 in Milagro/Miracl (never an issue in BLST or on mainnet as BLST was default before Dec 1, 2020). Dedicated test case scheduled in status-im/nim-blscurve#130 |
The following snippet will be parsed as a valid BLS signature but will be initialized as the infinity point:
see also: status-im/nim-blscurve#29
The text was updated successfully, but these errors were encountered: