You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A TOCTOU issue was reported by EF security in which two attestations
being validated at the same time may result in both of them being
forwarded. The spec says that we need to forward only the first one.
Copy file name to clipboardExpand all lines: beacon-chain/sync/validate_beacon_attestation.go
+13-4Lines changed: 13 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -104,7 +104,8 @@ func (s *Service) validateCommitteeIndexBeaconAttestation(
104
104
}
105
105
106
106
if!s.slasherEnabled {
107
-
// Verify this the first attestation received for the participating validator for the slot.
107
+
// Verify this the first attestation received for the participating validator for the slot. This verification is here to return early if we've already seen this attestation.
108
+
// This verification is carried again later after all other validations to avoid TOCTOU issues.
108
109
ifs.hasSeenUnaggregatedAtt(attKey) {
109
110
returnpubsub.ValidationIgnore, nil
110
111
}
@@ -228,7 +229,10 @@ func (s *Service) validateCommitteeIndexBeaconAttestation(
0 commit comments