You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:
The 'certified' function in the CertifierHbbft contract contains a vulnerability in its logic for determining whether an address is certified. The function returns true for any address that has an associated staking address, without verifying if that staking address belongs to an active validator. This over-permissive validation could potentially allow unauthorized addresses to perform zero-gas transactions, compromising the intended access control of the system.
The address is explicitly certified(_certified[_who] is true)
The address has any non-zero staking address associated with it
The second condition is too permissive, as it doesn't verify if the staking address belongs to an active validator.
Proof-of-Concept:
it("should incorrectly certify an address with a non-zero staking address
that is not an active validator", async function () {
const { certifier, validatorSetHbbft } = await
loadFixture(deployContracts);
// Create a new address that is not a validator
const nonValidatorAddress = ethers.Wallet.createRandom().address;
// Set up a non-zero staking address for the non-validator
const fakeStakingAddress = ethers.Wallet.createRandom().address;
await validatorSetHbbft.setStakingAddressTest(nonValidatorAddress,
fakeStakingAddress);
// Ensure the address is not explicitly certified
expect(await
certifier.certifiedExplicitly(nonValidatorAddress)).to.be.false;
// Check if the address is incorrectly certified
expect(await certifier.certified(nonValidatorAddress)).to.be.true;
// Verify that the address is not actually a validator
expect(await
validatorSetHbbft.isValidator(fakeStakingAddress)).to.be.false;
});
✔ should incorrectly certify an address with a non-zero staking address that is not an active validator (257ms)
Implement at ime-based recertification mechanism:
a. Add an expiration timestamp to each certification.
b. Automatically revoke certifications that have expired.
c. Require validators to recertify periodically.
Implementanevent-drivencertificationupdatesystem:
a. Emit events when validator status changes (e.g.,becomes inactive,
banned).
b. Create a mechanism to revoke certifications based on these events.
The text was updated successfully, but these errors were encountered:
Likelihood: Medium
Description:
The 'certified' function in the CertifierHbbft contract contains a vulnerability in its logic for determining whether an address is certified. The function returns true for any address that has an associated staking address, without verifying if that staking address belongs to an active validator. This over-permissive validation could potentially allow unauthorized addresses to perform zero-gas transactions, compromising the intended access control of the system.
The vulnerable code is:
This function returns true if either:
The second condition is too permissive, as it doesn't verify if the staking address belongs to an active validator.
Proof-of-Concept:
✔ should incorrectly certify an address with a non-zero staking address that is not an active validator (257ms)
Recommendation:
a. Add an expiration timestamp to each certification.
b. Automatically revoke certifications that have expired.
c. Require validators to recertify periodically.
a. Emit events when validator status changes (e.g.,becomes inactive,
banned).
b. Create a mechanism to revoke certifications based on these events.
The text was updated successfully, but these errors were encountered: