{"id":"CVE-2023-38698","aliases":["CVE-2023-38698","GHSA-rrxv-q8m4-wch3"],"related":[],"kind":"vulnerability","state":"published","title":".eth registrar controller can shorten the duration of registered names","summary":"Ethereum Name Service (ENS) is a distributed, open, and extensible naming system based on the Ethereum blockchain. 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 vulnerability resides `@ensdomains/ens-contracts` prior to version 0.0.22.\n\nIf successfully exploited, this vulnerability would enable attackers to force the expiration of any ENS record, ultimately allowing them to claim the affected domains for themselves. Currently, it would require a malicious DAO to exploit it. Nevertheless, any vulnerability present in the controllers could potentially render this issue exploitable in the future. An additional concern is the possibility of renewal discounts. Should ENS decide to implement a system that offers unlimited .eth domains for a fixed fee in the future, the vulnerability could become exploitable by any user due to the reduced attack cost.\n\nVersion 0.0.22 contains a patch for this issue. As long as registration cost remains linear or superlinear based on registration duration, or limited to a reasonable maximum (eg, 1 million years), this vulnerability could only be exploited by a malicious DAO. The interim workaround is thus to take no action.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Ethereum Name Service (ENS) is a distributed, open, and extensible naming system based on the Ethereum blockchain. 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 vulnerability resides `@ensdomains/ens-contracts` prior to version 0.0.22.\n\nIf successfully exploited, this vulnerability would enable attackers to force the expiration of any ENS record, ultimately allowing them to claim the affected domains for themselves. Currently, it would require a malicious DAO to exploit it. Nevertheless, any vulnerability present in the controllers could potentially render this issue exploitable in the future. An additional concern is the possibility of renewal discounts. Should ENS decide to implement a system that offers unlimited .eth domains for a fixed fee in the future, the vulnerability could become exploitable by any user due to the reduced attack cost.\n\nVersion 0.0.22 contains a patch for this issue. As long as registration cost remains linear or superlinear based on registration duration, or limited to a reasonable maximum (eg, 1 million years), this vulnerability could only be exploited by a malicious DAO. The interim workaround is thus to take no action.","source":"cvelist"},{"lang":"en","text":"### Description\nAccording 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.\n\nThe vulnerability resides in the following GitHub repository: https://github.com/ensdomains/ens-contracts/blob/master/contracts/ethregistrar/BaseRegistrarImplementation.sol#L171 \n\nThe vulnerable line of code is:\n```js\nrequire(\n            expiries[id] + duration + GRACE_PERIOD > duration + GRACE_PERIOD\n        ); // Prevent future overflow\n```\n\nIn this code snippet, the `duration` variable is user-supplied, making it possible to provide a value that would cause an overflow on both sides of the '>' expression, ultimately rendering the condition true. Specifically, when the duration is set to `2^256 - GRACE_PERIOD`, the subsequent line `expiries[id] += duration;` also experiences an overflow, as `expiries[id]` is greater than `GRACE_PERIOD`. This results in the reduction of `expiries[id]` by `GRACE_PERIOD`. By repeatedly calling the renew function, an attacker could potentially force the expiration of an ENS record.\n\nYou can find the PoC included in the attached document. To execute the test, please use the following command:\n```\nforge test -vvv --match-contract RegistrarExploit --fork-url <alchemy_url>\n```\n\nReplace `<alchemy_url>` with your Alchemy API URL. This command will run the Foundry test file and demonstrate the potential vulnerability.\n\n### Impact\nIf successfully exploited, this vulnerability would enable attackers to force the expiration of any ENS record, ultimately allowing them to claim the affected domains for themselves.\n\nCurrently, it would require a malicious DAO to exploit it. Nevertheless, any vulnerability present in the controllers could potentially render this issue exploitable in the future.\n\nAn additional concern is the possibility of renewal discounts. Should ENS decide to implement a system that offers unlimited .eth domains for a fixed fee in the future, the vulnerability could become exploitable by any user due to the reduced attack cost.\n\n### Patches\nA mitigation is being developed.\n\n### Workarounds\nAs long as registration cost remains linear or superlinear based on registration duration, or limited to a reasonable maximum (eg, 1 million years), this vulnerability could only be exploited by a malicious DAO. The interim workaround is thus to take no action.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Ethereum Name Service (ENS) es un sistema de nombres distribuido, abierto y extensible basado en la blockchain de Ethereum. Según la documentación, los controladores pueden registrar nuevos dominios y ampliar la caducidad de los existentes, pero no pueden cambiar la titularidad ni reducir el tiempo de caducidad de los dominios existentes. Sin embargo, un análisis preliminar sugiere que un controlador controlado por un atacante puede ser capaz de reducir el tiempo de expiración de los dominios existentes debido a un desbordamiento de enteros en la función renew. La vulnerabilidad reside en `@ensdomains/ens-contracts` anterior a la versión 0.0.22.\n\nSi se explota con éxito, esta vulnerabilidad permitiría a los atacantes forzar la expiración de cualquier registro ENS, permitiéndoles en última instancia reclamar para sí los dominios afectados. Actualmente, se requeriría un DAO malicioso para explotarla. No obstante, cualquier vulnerabilidad presente en los controladores podría hacer que este problema pudiera explotarse en el futuro. Una preocupación adicional es la posibilidad de descuentos en la renovación. Si ENS decide implementar un sistema que ofrezca dominios .eth ilimitados por una tarifa fija en el futuro, la vulnerabilidad podría ser explotable por cualquier usuario debido al reducido coste de ataque.\n\nLa versión 0.0.22 contiene un parche para este problema. Mientras el coste de registro siga siendo lineal o superlineal en función de la duración del registro, o limitado a un máximo razonable (por ejemplo, 1 millón de años), esta vulnerabilidad sólo podría ser explotada por una DAO maliciosa. Por lo tanto, la solución provisional es no tomar ninguna medida.","source":"nvd"}],"published":"2023-08-01T19:48:31.000Z","modified":"2026-09-10T03:49:57.769Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:N","score":4.9,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:N","score":4.9,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:N","score":4.9,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N","score":6.5,"rating":"MEDIUM"}],"cwes":["CWE-190"],"affected":[{"ranges":[{"version":"<= 0.0.21","status":"affected"}],"vendor":"ensdomains","product":"ens-contracts","source":"cvelist"},{"ranges":[{"type":"custom","introduced":"0","lastAffected":"0.0.21","status":"affected"}],"vendor":"ens.domains","product":"ethereum_name_service","cpe":"cpe:2.3:a:ens.domains:ethereum_name_service:*:*:*:*:*:*:*:*","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.0.22"}],"ecosystem":"npm","package":"@ensdomains/ens-contracts","purl":"pkg:npm/%40ensdomains/ens-contracts","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"0.0.22"}],"vendor":"ens.domains","product":"ethereum_name_service","cpe":"cpe:2.3:a:ens.domains:ethereum_name_service:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/ensdomains/ens-contracts/security/advisories/GHSA-rrxv-q8m4-wch3","tags":["exploit","vendor-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/ensdomains/ens-contracts/commit/e6b136e979084de3761c125142620304173990ca","tags":["patch","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/ensdomains/ens-contracts/blob/master/contracts/ethregistrar/BaseRegistrarImplementation.sol#L171","tags":["product","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2023-38698","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/ensdomains/ens-contracts","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2024-10-03T18:12:20.434Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2023-38698","url":"https://www.cve.org/CVERecord?id=CVE-2023-38698","licence":"CVE Terms of Use","modified":"2024-10-03T18:13:44.326Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-rrxv-q8m4-wch3","url":"https://github.com/advisories/GHSA-rrxv-q8m4-wch3","licence":"CC-BY-4.0","modified":"2026-09-10T03:49:57.769Z"},{"source":"nvd","name":"NVD","id":"CVE-2023-38698","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-38698","licence":"Public domain","modified":"2026-06-17T06:10:58.587Z"}],"updatedAt":"2026-11-25T22:58:26.769Z","epss":{"score":0.00848,"percentile":0.59211,"date":"2026-12-01T12:00:22.000Z"}}