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
function submitCommitment(
bytes calldata snarkProof,
bytes calldata grandSumProof,
uint256[] memory totalBalances,
uint256 timestamp // @audit : Future timestamp can be used. This can be used to manipulate
timestamp is expected to be time at which the exchange has taken snapshot of all the balances but this timestamp is not validated. As this can be set to a future timestamp. This may lead to potential manipulations by the exchange owner by combining off-chain and on-chain processes:
Creates inconsistencies/confusion by not maintaining a chronological order in the commitment.
Delaying the proof verification by promising a future commitment.
To mitigate this add the following vallidation checks to timestamp
Add a check to make sure the timestamp is not in the future.
Store the last submitted timestamp and check the new timestamp is larger than the previous timestamp.
Fixed cryptocurrencyNames and cryptocurrencyChains:
cryptocurrencyNames and cryptocurrencyChains are currently set within the summa config inside the constructor. However this could limit flexibility if the currencies or the chains changes over time. Allow for dynamic resizing of cryptocurrencyNames and cryptocurrencyChains.
While this may require commitment versioning so as to not impact the previous versions of commitments when the currency count changes.
No validation for cryptocurrencyChains of the reported balances in a commitment:
Commitment submissions do check if the cryptocurrencyChains that the reported totalBalances from the respective chains or even checked against the chains parameters within address ownership proofs within submitProofOfAddressOwnership .
The following sanity check : require(bytes(cryptocurrencies[i].chain).length <= config.cryptocurrencyChains.length, "Cryptocurrency chain mismatch");
The text was updated successfully, but these errors were encountered:
timestamp
is expected to be time at which the exchange has taken snapshot of all the balances but this timestamp is not validated. As this can be set to a future timestamp. This may lead to potential manipulations by the exchange owner by combining off-chain and on-chain processes:To mitigate this add the following vallidation checks to
timestamp
timestamp
is not in the future.Fixed
cryptocurrencyNames
andcryptocurrencyChains
:cryptocurrencyNames and cryptocurrencyChains are currently set within the summa config inside the constructor. However this could limit flexibility if the currencies or the chains changes over time. Allow for dynamic resizing of
cryptocurrencyNames
andcryptocurrencyChains
.While this may require commitment versioning so as to not impact the previous versions of commitments when the currency count changes.
No validation for cryptocurrencyChains of the reported balances in a commitment:
Commitment submissions do check if the
cryptocurrencyChains
that the reported totalBalances from the respective chains or even checked against the chains parameters within address ownership proofs withinsubmitProofOfAddressOwnership
.The following sanity check :
require(bytes(cryptocurrencies[i].chain).length <= config.cryptocurrencyChains.length, "Cryptocurrency chain mismatch");
The text was updated successfully, but these errors were encountered: