Inconsistent order_id
type in ORDER_TYPE
definition and encodeOrder
function for EIP-712
#7
Labels
bug
Something isn't working
downgraded by judge
Judge downgraded the risk level of this issue
edited-by-warden
grade-a
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
🤖_primary
AI based primary recommendation
sponsor acknowledged
Technically the issue is correct, but we're not going to resolve it for XYZ reasons
Lines of code
https://github.com/code-423n4/2024-11-ethena-labs/blob/main/contracts/ustb/UStbMinting.sol#L32-L35
https://github.com/code-423n4/2024-11-ethena-labs/blob/main/contracts/ustb/UStbMinting.sol#L442-L456
Vulnerability details
Impact
The mismatch between the
order_id
type (string
inORDER_TYPE
andbytes32
inencodeOrder
) can cause unexpected behavior during order hashing and EIP712 signature verification. This inconsistency could result in order verification failures, even if the provided signature is correct. It could prevent valid minting and redemption orders from processing, thereby impacting users who depend on this contract’s stablecoin services.Proof of Concept
In the
UStbMinting
contract:ORDER_TYPE
constant onUStbMinting.sol#L32
expectsorder_id
as astring
:encodeOrder
function onUStbMinting.sol#L442-L456
, theorder_id
is converted tobytes32
:In https://eips.ethereum.org/EIPS/eip-712#definition-of-typed-structured-data-%F0%9D%95%8A
Definition: The dynamic types are bytes and string. These are like the atomic types for the purposed of type declaration, but their treatment in encoding is different.
Recommended Mitigation Steps
The text was updated successfully, but these errors were encountered: