Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Fix security bug in proof-checking code #60

Merged
merged 4 commits into from
Jan 9, 2019

Conversation

henrycg
Copy link
Collaborator

@henrycg henrycg commented Jan 8, 2019

Short version: This PR fixes a small security bug in libprio. The bug would have taken quite a bit of work to exploit, but is a bug nonetheless.

Long version: Per Appendix D.2 of the full version of the Prio paper, the servers should evaluate the polynomials f, g, and h at a random point r in the set {M+1, ..., modulus-1}, where M is the number of multiplication gates in the "Valid" circuit. The implementation previously—and incorrectly—sampled the point r from the larger set {0, ..., modulus-1}.

The probability that a random point r would fall into the "bad set" {0, ..., M} is only (M+1)/(modulus size). Since we are using a 72-bit modulus, this probability would be no more than ~1/2^{60} for the data sizes that libprio currently supports. So, with probability ~1/2^{60}, the implementation could leak some bits of information about a client's private data to the servers. This is a pretty small failure probability, but this patch should nonetheless remove it entirely.

Henry Corrigan-Gibbs added 4 commits January 7, 2019 21:10
Per Appendix D.2 of the full version of the Prio paper, the servers
should evaluate the polynomials f, g, and h at a random point r in the
set {M+1, ..., modulus-1}, where M is the number of multiplication gates
in the "Valid" circuit. The implementation previously sampled the point
r from the larger set {0, ..., modulus-1}.
@henrycg henrycg requested a review from rhelmer January 8, 2019 05:40
@rhelmer
Copy link
Contributor

rhelmer commented Jan 9, 2019

Travis-CI is failing in some way that looks unrelated to this patch. I will take a look at that separately.

@rhelmer
Copy link
Contributor

rhelmer commented Jan 9, 2019

Travis-CI is failing in some way that looks unrelated to this patch. I will take a look at that separately.

Opened PR #61 to fix.

@rhelmer rhelmer merged commit 981e09e into mozilla:master Jan 9, 2019
@rhelmer
Copy link
Contributor

rhelmer commented Jan 9, 2019

I'm going to tag version 1.3 so we can pull this change into Firefox. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants