Skip to content

TimelockController vulnerability in OpenZeppelin Contracts

Critical severity GitHub Reviewed Published Aug 26, 2021 in OpenZeppelin/openzeppelin-contracts-upgradeable • Updated Feb 1, 2023

Package

npm @openzeppelin/contracts-upgradeable (npm)

Affected versions

>= 4.0.0, < 4.3.1
>= 3.3.0, < 3.4.2

Patched versions

4.3.1
3.4.2

Description

Impact

A vulnerability in TimelockController allowed an actor with the executor role to take immediate control of the timelock, by resetting the delay to 0 and escalating privileges, thus gaining unrestricted access to assets held in the contract. Instances with the executor role set to "open" allow anyone to use the executor role, thus leaving the timelock at risk of being taken over by an attacker.

Patches

A fix is included in the following releases of @openzeppelin/contracts and @openzeppelin/contracts-upgradeable:

  • 4.3.1
  • 3.4.2
  • 3.4.2-solc-0.7

Deployed instances of TimelockController should be replaced with a fixed version by migrating all assets, ownership, and roles.

Workarounds

Revoke the executor role from accounts not strictly under the team's control. We recommend revoking all executors that are not also proposers. When applying this mitigation, ensure there is at least one proposer and executor remaining.

References

Post-mortem.

Credits

The issue was identified by an anonymous white hat hacker through Immunefi.

For more information

If you have any questions or comments about this advisory, or need assistance executing the mitigation, email us at [email protected].

References

Published by the National Vulnerability Database Aug 27, 2021
Reviewed Aug 27, 2021
Published to the GitHub Advisory Database Aug 30, 2021
Last updated Feb 1, 2023

Severity

Critical

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

EPSS score

0.245%
(65th percentile)

Weaknesses

CVE ID

CVE-2021-39168

GHSA ID

GHSA-vrw4-w73r-6mm8
Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.