opendp / smartnoise-core

Differential privacy validator and runtime
MIT License
290 stars 33 forks source link

hardened geometric mechanism #358

Closed Shoeboxam closed 2 years ago

Shoeboxam commented 3 years ago

There are two minor vulnerabilities in the geometric mechanism and one minor utility bug.

  1. The noise is buffered in an i64, so the noise can be at most i64::MAX / 2. Sampling a value greater than this is nearly computationally infeasible and vanishingly unlikely to happen.
  2. The input to the geometric should be clamped to keep the probability bin at the tail of the censored geometric from being within the output domain. This can only happen if custom clamp bounds are set that are tighter than the input datum.
  3. Overflow or underflow of noise addition should not wrap, it should saturate. This is a minor loss in utility, as underflow or overflow are unlikely on an i64. This does not violate privacy.