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
nonceThresh
The invalidateNonce and invalidateUpToNonce functions in the smart contract allow users to invalidate specific nonces or a range of nonces. However, these functions do not account for the nonceThreshold set by setNonceThreshold. This creates inconsistencies and potential vulnerabilities in the nonce management mechanism, as users may invalidate nonces above the threshold, potentially causing confusion and weakening security.
The contract includes three functions that interact with the nonce system:
invalidateNonce: Invalidates the current nonce for the caller.
invalidateUpToNonce: Invalidates all nonces up to a specified newNonce for the callernoncnonsetNonceThreshold: Sets a nonceThreshold, which likely represents the minimum valid nonce, invalidating all nonces below this threshold to protect against replay attacks.
However, invalidateNonce and invalidateUpToNonce allow users to invalidate nonces above the nonceThreshold, which undermines the purpose of the threshold as a limit on valid nonces. Without alignment across these functions, nonce management is inconsistent, and users can potentially circumvent the nonceThreshold.
Recommendation
Add require statements in both invalidateNonce and invalidateUpToNonce to prevent invalidating nonces above nonceThreshold.
The text was updated successfully, but these errors were encountered:
sherlock-admin4
changed the title
Mysterious Red Grasshopper - Threshold not used!
EFCCWEB3 - Threshold not used!
Nov 19, 2024
EFCCWEB3
Medium
Threshold not used!
nonceThresh
The invalidateNonce and invalidateUpToNonce functions in the smart contract allow users to invalidate specific nonces or a range of nonces. However, these functions do not account for the nonceThreshold set by setNonceThreshold. This creates inconsistencies and potential vulnerabilities in the nonce management mechanism, as users may invalidate nonces above the threshold, potentially causing confusion and weakening security.
Vulnerability Details
The contract includes three functions that interact with the nonce system:
invalidateNonce: Invalidates the current nonce for the caller.
invalidateUpToNonce: Invalidates all nonces up to a specified newNonce for the callernoncnonsetNonceThreshold: Sets a nonceThreshold, which likely represents the minimum valid nonce, invalidating all nonces below this threshold to protect against replay attacks.
However, invalidateNonce and invalidateUpToNonce allow users to invalidate nonces above the nonceThreshold, which undermines the purpose of the threshold as a limit on valid nonces. Without alignment across these functions, nonce management is inconsistent, and users can potentially circumvent the nonceThreshold.
Recommendation
Add require statements in both invalidateNonce and invalidateUpToNonce to prevent invalidating nonces above nonceThreshold.
The text was updated successfully, but these errors were encountered: