Skip to content

Incomplete Transaction Receipt Status Inspection

Description

A transaction receipt's status is inspected without considering the potential failure of calls within the transaction. This can lead to incorrect assumptions about the transaction's success, especially in high-risk environments such as bridges and exchanges. Review the related code to ensure the receipt's success is not used as a verification measure and the transaction being inspected is from a finalized block.

Examples

Insecure Code

go
receiptStatus := receipt.Status()
if receiptStatus == types.ReceiptStatusSuccessful {
    // Potential incorrect assumption about transaction success
}

Secure Code

go
receiptStatus := receipt.Status()
if receiptStatus == types.ReceiptStatusSuccessful && isTransactionInFinalizedBlock(transaction) {
    // More accurate assessment of transaction success
}

Remediation

Verify the transaction receipt's status in conjunction with other factors, such as the transaction's inclusion in a finalized block, to ensure accurate assessment of the transaction's success.

Rule Details

FieldValue
IDCODE-0761
CategoryBlockchain
SeverityHIGH
CWECWE-437
ConfidenceLOW
ImpactHIGH
LikelihoodMEDIUM
ExploitabilityMODERATE
Tagstransaction receipt, blockchain security
OWASPN/A

References