added unsecure signatures vulnerability #100
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related Issue
Checklist
Describe the changes you've made:
This contribution adds a new vulnerability section titled Unsecure Signatures. The submission explains the potential risks associated with the improper use of the
ecrecover
function, including:ecrecover
to returnaddress(0)
and pass validation checks under certain circumstances.r
ands
.Additionally, I propose the use of EIP-712 and OpenZeppelin’s ECDSA library as a mitigation to these risks. This update explains how adopting structured data signing with EIP-712 ensures that signatures are unique to the contract, chain, and message, preventing unauthorized actions through signature replay or manipulation.
The submission includes:
ecrecover
in an ownership-changing function.Type of change
Additional Information
This vulnerability could either fit under existing categories such as "Authorization" or "Signature Validation", or it may require a new category/tag like Unsecure Signatures or Signature Replay Vulnerabilities. Please advise if a new tag is needed for better categorization.
Additionally, the code examples and mitigations highlight the importance of using canonical signatures and ensuring that all contracts are immune to replay and front-running attacks, especially when
ecrecover
is involved. This contribution also introduces a section explaining the relevance of nonce management to protect against front-running.