Election-Tech-Initiative / Election-Tech-Initiative/electionguard

✨ Add ballot validation to verifier's Validation Steps in the specification.

Open
#243 1 comment 0 reactions 0 assignees View on GitHub
enhancement question
Dominant language
Python
Stars
872
Forks
131
PR merge metrics
No merged PRs in 30d

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Suggestion

The method **CiphertextBallot.is_valid_encryption()** should be called on each SubmittedBallot before tallying. This is done in CiphertextTally.batch_append(). However there is nothing in the spec that mentions the need for this, nor is it part of the "Validation steps" for an election verifier.

This check prevents the SubmittedBallot from being modified after encryption and before tallying, in a way that would affect the tallied results. Adding this test to the verifier would ensure that the verifier would catch any such problem.

__

### Possible Implementation

```
For each selection in the ballot:
selection.crypto_hash = H(object_id, description_hash, ciphertext.crypto_hash())

For each contest in the ballot:
contest.crypto_hash = H(object_id, description_hash, List[selection.crypto_hash])

For each ballot:
crypto_hash = H(object_id, manifest_hash, List[contest.crypto_hash])
```

### Anything else?

The ballot chaining is necessary to prevent this vulnerability also.

3.3.4 Tracking codes (spec 1.0) has this sentence implying the hash chain is optional:

` In addition, if the election definition file specifies a hash chain (the second option above) ...
`

If there is no hash chain, one would need to ensure that the SubmittedBallot.crypto_hash was not modified in some other way.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.