Integer Overflow or Wraparound Affecting @ensdomains/ens-contracts package, versions <0.0.22


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
0.07% (31st percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-JS-ENSDOMAINSENSCONTRACTS-5813754
  • published2 Aug 2023
  • disclosed1 Aug 2023
  • creditUnknown

Introduced: 1 Aug 2023

CVE-2023-38698  (opens in a new tab)
CWE-190  (opens in a new tab)

How to fix?

Upgrade @ensdomains/ens-contracts to version 0.0.22 or higher.

Overview

@ensdomains/ens-contracts is an ENS contracts

Affected versions of this package are vulnerable to Integer Overflow or Wraparound. According to the documentation, controllers are allowed to register new domains and extend the expiry of existing domains, but they cannot change the ownership or reduce the expiration time of existing domains. However, a preliminary analysis suggests that an attacker-controlled controller may be able to reduce the expiration time of existing domains due to an integer overflow in the renew function.

The vulnerable line of code is:

require(
            expiries[id] + duration + GRACE_PERIOD > duration + GRACE_PERIOD
        ); // Prevent future overflow

CVSS Scores

version 3.1