Overview
This report covers the security review for Secured Finance, the issuer of the USDFC stablecoin, a USD-pegged stablecoin on Filecoin Network. This review covered an incremental update introducing EIP-3009.
Our security assessment was a full review of the updates, spanning a total of 3 days. During our review, we did not identify any major or minor severity vulnerabilities.
We did identify several code optimisations.
All of our reported issues were fixed by the development team and consequently validated by us. We can confidently say that the overall security and code quality have increased af ter completion of our audit.
Scope
The analyzed resources are located on:
The issues described in this report were fixed in the following commit:
https://github.com/Secured-Finance/stablecoin-contracts
Commit: c819e45531d1e3dae7670d7ed897a14818135a56
Summary
Weaknesses
This section contains the list of discovered weaknesses.
SECFIN2-1 | ECDSA SIGNATURE NORMALIZATION (LOW-S/V RANGE) NOT ENFORCED (BEST PRACTICE)
Severity:
Status:
Fixed
Path:
contracts/DebtToken.sol
Description:
Several signature recoveries rely on ecrecover without enforcing low-s (s ≤ secp256k1n/2) and strict v-range (27 or 28). This does not bypass nonce-based replay protections but deviates from common best practices and may lead to signature malleability or interoperability inconsistencies.
Affected areas include:
DebtToken:_recoverused bypermit,transferWithAuthorization,receiveWithAuthorization, andcancelAuthorization.ProtocolToken:permitusesecrecoverdirectly without low-s/v validation.
function _recover(
uint8 _v,
bytes32 _r,
bytes32 _s,
bytes memory _typeHashAndData
) internal view returns (address) {
bytes32 digest = keccak256(
abi.encodePacked("\x19\x01", domainSeparator(), keccak256(_typeHashAndData))
);
address recovered = ecrecover(digest, _v, _r, _s);
require(recovered != address(0), "EIP712: invalid signature");
return recovered;
}
Remediation:
Prefer ECDSA.recover from OpenZeppelin, which enforces low-s and validates v. Alternatively, add explicit checks:
- require(uint256(s) <= SECP256K1N_HALF)
- require(v == 27 || v == 28)
SECFIN2-2 | CODE CLARITY INCONSISTENCIES (NO-OP STATEMENT, MISSING EMIT)
Severity:
Status:
Fixed
Description:
Minor clarity issues reduce readability and can hinder observability:
- No-op statement in
BorrowerOperations.openTrove(a standalonevars.debtTokenFee;has no effect). - Missing
emitkeyword on event emissions:ActivePool.increaseDebt/decreaseDebtcallActivePoolDebtUpdated(debt)withoutemit.SortedTroves._removecallsNodeRemoved(_id)withoutemit, while the interface defines it as an event. While not security-impacting, these patterns can cause confusion, compilation issues.
Remediation:
- Remove the no-op line in
BorrowerOperations.openTrove - Add
emitto all event emissions (e.g., emitActivePoolDebtUpdated(debt), emitNodeRemoved(_id))