▐ homomorph ▌

rules / HM012

HM012 public-handle-exposure HIGH

Per-user confidential value made publicly decryptable

Why it matters

`FHE.makePubliclyDecryptable` on an entry of `mapping(address => euintX)` publishes one user's private balance, bid or position to the whole world, permanently. This is almost never intended: public decryption is for aggregate results (a tally, an auction clearing price), while individual values should only be shared with their owner through `FHE.allow` and the user-decrypt flow.

Fix

Use `FHE.allow(balances[user], user)` so only the owner can decrypt. If a per-user value must become public (a winner reveal), decrypt a dedicated, explicitly copied handle after the protocol state permits it.

Check locally

homomorph scan . --rules HM012