Remediation of Issues from Filecoin Solidity Audit by Zellic #66
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.
PR: Remediation of Issues from Filecoin Solidity Audit by Zellic
Overview
This PR implements fixes and improvements based on the security assessment conducted by Zellic for the Filecoin Solidity project. The audit identified seven issues, categorized as one medium, two low, and four informational. All findings have been remediated as detailed in the audit report.
Summary of Changes
The following changes were made to address the audit findings:
Replaced
assert
withif
checks +revert
using custom errorsPanic
exceptions and ensures proper error messaging.Errors.sol
:InvalidArrayLength(uint256 expected, uint256 actual)
InvalidBooleanType()
ExpectedMajorByteString()
ExpectedNegativeBigNumTag()
ExpectedLowValue27()
Commit 72285939
Standardized BigInt deserialization with
deserializeBytesBigInt
deserializeBigInt
withdeserializeBytesBigInt
across CBOR contracts.Commit 09f2f205
Commit ff0b3868
Fixed buffer allocation type mismatch in
serializeChangeWorkerAddressParams
uint256
touint64
to prevent truncation issues.Commit acf7e81e
Fixed capacity miscalculation in
serializeExtendClaimTermsParams
Commit 14d60cec
Enforced strict array length checks in deserialization
deserializeGetDealDataCommitmentReturn
to enforce expected array length instead of silently discarding extra entries.Commit 1eabac47
Added validation for BigInt sign byte in deserialization
0x00
or0x01
allowed).Commit 9bf88179
Fixed type mismatch in universal receiver params struct
UniversalReceiverParams.type_
asuint32
.Commit d6bc37bc
Audit Summary
Impact
These changes improve the robustness and security of the Filecoin Solidity library by: