{"id":18517,"date":"2026-03-21T15:38:00","date_gmt":"2026-03-21T15:38:00","guid":{"rendered":"https:\/\/cryptoted.net\/index.php\/2026\/03\/21\/solidity-bugfix-release-ethereum-foundation-blog\/"},"modified":"2026-03-21T15:38:00","modified_gmt":"2026-03-21T15:38:00","slug":"solidity-bugfix-release-ethereum-foundation-blog","status":"publish","type":"post","link":"https:\/\/cryptoted.net\/index.php\/2026\/03\/21\/solidity-bugfix-release-ethereum-foundation-blog\/","title":{"rendered":"Solidity Bugfix Release | Ethereum Foundation Blog"},"content":{"rendered":"<p> <br \/>\n<\/p>\n<div id=\"\">\n<p class=\"chakra-text css-gi02ar\">The latest <a target=\"_blank\" rel=\"noopener\" class=\"chakra-link css-vezwxf\" href=\"https:\/\/github.com\/ethereum\/solidity\/releases\/tag\/v0.4.25\">version 0.4.25 release of Solidity<\/a> fixes<br \/>\ntwo important bugs.<br \/>\nAnother important bug has already been fixed in version 0.4.22 but it was only discovered recently that the bug existed.<\/p>\n<p class=\"chakra-text css-gi02ar\">Note that the Ethereum Foundation runs a <a target=\"_blank\" rel=\"noopener\" class=\"chakra-link css-vezwxf\" href=\"https:\/\/bounty.ethereum.org\/\">bounty program<\/a> for the code generator part of Solidity.<\/p>\n<h2 class=\"chakra-heading group css-1kpzc4q\" id=\"cleanup-of-exponent-in-exponentiation\" data-group=\"true\"><a class=\"chakra-link css-128fqrf\" aria-label=\"cleanup of exponent in exponentiation permalink\" href=\"#cleanup-of-exponent-in-exponentiation\"><svg viewbox=\"0 0 24 24\" focusable=\"false\" class=\"chakra-icon css-173jpr1\"><g fill=\"currentColor\"><path d=\"M10.458,18.374,7.721,21.11a2.853,2.853,0,0,1-3.942,0l-.892-.891a2.787,2.787,0,0,1,0-3.941l5.8-5.8a2.789,2.789,0,0,1,3.942,0l.893.892A1,1,0,0,0,14.94,9.952l-.893-.892a4.791,4.791,0,0,0-6.771,0l-5.8,5.8a4.787,4.787,0,0,0,0,6.77l.892.891a4.785,4.785,0,0,0,6.771,0l2.736-2.735a1,1,0,1,0-1.414-1.415Z\"\/><path d=\"M22.526,2.363l-.892-.892a4.8,4.8,0,0,0-6.77,0l-2.905,2.9a1,1,0,0,0,1.414,1.414l2.9-2.9a2.79,2.79,0,0,1,3.941,0l.893.893a2.786,2.786,0,0,1,0,3.942l-5.8,5.8a2.769,2.769,0,0,1-1.971.817h0a2.766,2.766,0,0,1-1.969-.816,1,1,0,1,0-1.415,1.412,4.751,4.751,0,0,0,3.384,1.4h0a4.752,4.752,0,0,0,3.385-1.4l5.8-5.8a4.786,4.786,0,0,0,0-6.771Z\"\/><\/g><\/svg><\/a>Cleanup of Exponent in Exponentiation<\/h2>\n<ul role=\"list\" class=\"css-1ars4k6\">\n<li class=\"css-0\">Likelihood of occurrence: very low<\/li>\n<li class=\"css-0\">Exploitability: high<\/li>\n<li class=\"css-0\">Discoverability by tests: low<\/li>\n<li class=\"css-0\">Fixed in version: 0.4.25<\/li>\n<\/ul>\n<p class=\"chakra-text css-gi02ar\">Summary: Using short types in the exponent of an exponentiation operation can lead to invalid results.<\/p>\n<p class=\"chakra-text css-gi02ar\">The Solidity language allows integer types that are shorter than 256 bits, even though the Ethereum Virtual Machine<br \/>\nonly knows types of exactly 256 bits. Because of that, higher order bits need to be set to zero from time to time.<br \/>\nFor many operations, it is not relevant whether those bits are set to zero or not (addition is one example).<br \/>\nBecause of that, the Solidity compiler delays this cleanup until it is needed in order to save gas.<\/p>\n<p class=\"chakra-text css-gi02ar\">In the very special circumstance that the exponent of the <span class=\"chakra-text css-ons8vw\">**<\/span> operator has a type that is shorter<br \/>\nthan 256 bits, but not shorter than the type of the base and contains dirty higher order bits,<br \/>\nthis can lead to an incorrect result. Note that literal exponents like in <span class=\"chakra-text css-ons8vw\">x ** 2<\/span> as well as<br \/>\nthe case where the type of the base is <span class=\"chakra-text css-ons8vw\">uint256<\/span> or <span class=\"chakra-text css-ons8vw\">int256<\/span> are unaffected.<\/p>\n<p class=\"chakra-text css-gi02ar\">Note that a function parameter can have dirty higher order bits if called by a malicious entity,<br \/>\nand the same is true for data returned from functions of contracts deployed by malicious entities.<\/p>\n<p class=\"chakra-text css-gi02ar\">After having screened a large number of contracts, we deem this bug to affect only a very tiny number of<br \/>\nsmart contracts, if any at all, because the regular uses of the exponentiation operator do not lead to the bug.<\/p>\n<p class=\"chakra-text css-gi02ar\">This bug was found by <a target=\"_blank\" rel=\"noopener\" class=\"chakra-link css-vezwxf\" href=\"https:\/\/github.com\/nweller\">nweller<\/a>.<\/p>\n<h2 class=\"chakra-heading group css-1kpzc4q\" id=\"memory-corruption-in-multi-dimensional-array-decoder\" data-group=\"true\"><a class=\"chakra-link css-128fqrf\" aria-label=\"memory corruption in multi dimensional array decoder permalink\" href=\"#memory-corruption-in-multi-dimensional-array-decoder\"><svg viewbox=\"0 0 24 24\" focusable=\"false\" class=\"chakra-icon css-173jpr1\"><g fill=\"currentColor\"><path d=\"M10.458,18.374,7.721,21.11a2.853,2.853,0,0,1-3.942,0l-.892-.891a2.787,2.787,0,0,1,0-3.941l5.8-5.8a2.789,2.789,0,0,1,3.942,0l.893.892A1,1,0,0,0,14.94,9.952l-.893-.892a4.791,4.791,0,0,0-6.771,0l-5.8,5.8a4.787,4.787,0,0,0,0,6.77l.892.891a4.785,4.785,0,0,0,6.771,0l2.736-2.735a1,1,0,1,0-1.414-1.415Z\"\/><path d=\"M22.526,2.363l-.892-.892a4.8,4.8,0,0,0-6.77,0l-2.905,2.9a1,1,0,0,0,1.414,1.414l2.9-2.9a2.79,2.79,0,0,1,3.941,0l.893.893a2.786,2.786,0,0,1,0,3.942l-5.8,5.8a2.769,2.769,0,0,1-1.971.817h0a2.766,2.766,0,0,1-1.969-.816,1,1,0,1,0-1.415,1.412,4.751,4.751,0,0,0,3.384,1.4h0a4.752,4.752,0,0,0,3.385-1.4l5.8-5.8a4.786,4.786,0,0,0,0-6.771Z\"\/><\/g><\/svg><\/a>Memory Corruption in Multi-Dimensional Array Decoder<\/h2>\n<ul role=\"list\" class=\"css-1ars4k6\">\n<li class=\"css-0\">Likelihood of occurrence: low<\/li>\n<li class=\"css-0\">Exploitability: medium<\/li>\n<li class=\"css-0\">Discoverability by tests: high<\/li>\n<li class=\"css-0\">Introduced in version: 0.1.4<\/li>\n<li class=\"css-0\">Fixed in version: 0.4.22<\/li>\n<\/ul>\n<p class=\"chakra-text css-gi02ar\">Summary: Calling functions of other contracts that return multi-dimensional fixed-size arrays results in memory corruption.<\/p>\n<p class=\"chakra-text css-gi02ar\">If Solidity code calls a function that returns a multi-dimensional fixed-size array,<br \/>\nthe returned ABI-encoded data has to be converted to Solidity&#8217;s internal representation<br \/>\nof arrays. In Solidity, multi-dimensional arrays are implemented as arrays of<br \/>\nmemory pointers, while in the ABI, the data is encoded inline.<br \/>\nThe decoder did not take this difference into account with the result that the returned<br \/>\nelements are interpreted as memory pointers and thus can cause memory<br \/>\ncorruption if the return values are accessed. Calling functions with multi-dimensional<br \/>\nfixed-size array arguments is unaffected as is returning fixed-size arrays from function calls<br \/>\nif they are not used in a Solidity contract.<br \/>\nThe bug is only in the component that decodes a multi-dimensional fixed-size array<br \/>\nthat is returned from a function call from Solidity.<\/p>\n<p class=\"chakra-text css-gi02ar\">This bug was found by <a target=\"_blank\" rel=\"noopener\" class=\"chakra-link css-vezwxf\" href=\"https:\/\/github.com\/jmahhh\">jmahhh<\/a>.<\/p>\n<h2 class=\"chakra-heading group css-1kpzc4q\" id=\"invalid-encoding-of-structs-in-events\" data-group=\"true\"><a class=\"chakra-link css-128fqrf\" aria-label=\"invalid encoding of structs in events permalink\" href=\"#invalid-encoding-of-structs-in-events\"><svg viewbox=\"0 0 24 24\" focusable=\"false\" class=\"chakra-icon css-173jpr1\"><g fill=\"currentColor\"><path d=\"M10.458,18.374,7.721,21.11a2.853,2.853,0,0,1-3.942,0l-.892-.891a2.787,2.787,0,0,1,0-3.941l5.8-5.8a2.789,2.789,0,0,1,3.942,0l.893.892A1,1,0,0,0,14.94,9.952l-.893-.892a4.791,4.791,0,0,0-6.771,0l-5.8,5.8a4.787,4.787,0,0,0,0,6.77l.892.891a4.785,4.785,0,0,0,6.771,0l2.736-2.735a1,1,0,1,0-1.414-1.415Z\"\/><path d=\"M22.526,2.363l-.892-.892a4.8,4.8,0,0,0-6.77,0l-2.905,2.9a1,1,0,0,0,1.414,1.414l2.9-2.9a2.79,2.79,0,0,1,3.941,0l.893.893a2.786,2.786,0,0,1,0,3.942l-5.8,5.8a2.769,2.769,0,0,1-1.971.817h0a2.766,2.766,0,0,1-1.969-.816,1,1,0,1,0-1.415,1.412,4.751,4.751,0,0,0,3.384,1.4h0a4.752,4.752,0,0,0,3.385-1.4l5.8-5.8a4.786,4.786,0,0,0,0-6.771Z\"\/><\/g><\/svg><\/a>Invalid Encoding of Structs in Events<\/h2>\n<ul role=\"list\" class=\"css-1ars4k6\">\n<li class=\"css-0\">Likelihood of occurrence: low<\/li>\n<li class=\"css-0\">Exploitability: low<\/li>\n<li class=\"css-0\">Discoverability by tests: high<\/li>\n<li class=\"css-0\">Introduced in version: 0.4.17<\/li>\n<li class=\"css-0\">Fixed in version: 0.4.25<\/li>\n<\/ul>\n<p class=\"chakra-text css-gi02ar\">Summary: Structs as event parameters are not handled properly.<\/p>\n<p class=\"chakra-text css-gi02ar\">Structs were not meant to be supported as event parameters without the new ABI encoder.<br \/>\nThe compiler did accept them nevertheless, but encoded their memory address instead of their actual value.<br \/>\nEven with the new ABI encoder, structs cannot be <span class=\"chakra-text css-ons8vw\">indexed<\/span> event parameters.<\/p>\n<p class=\"chakra-text css-gi02ar\">Now, structs are properly disallowed for the old encoder and if they are indexed also for the new encoder.<\/p>\n<\/div>\n<p><br \/>\n<br \/><a href=\"https:\/\/blog.ethereum.org\/en\/2018\/09\/13\/solidity-bugfix-release\">Source link <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The latest version 0.4.25 release of Solidity fixes two important bugs. Another important bug has already been fixed in version 0.4.22 but it was only discovered recently that the bug existed. Note that the Ethereum Foundation runs a bounty program for the code generator part of Solidity. Cleanup of Exponent in Exponentiation Likelihood of occurrence: [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":18498,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"tdm_status":"","tdm_grid_status":"","footnotes":""},"categories":[24],"tags":[],"kronos_expire_date":[],"class_list":["post-18517","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ethereum"],"_links":{"self":[{"href":"https:\/\/cryptoted.net\/index.php\/wp-json\/wp\/v2\/posts\/18517","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cryptoted.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cryptoted.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cryptoted.net\/index.php\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/cryptoted.net\/index.php\/wp-json\/wp\/v2\/comments?post=18517"}],"version-history":[{"count":0,"href":"https:\/\/cryptoted.net\/index.php\/wp-json\/wp\/v2\/posts\/18517\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cryptoted.net\/index.php\/wp-json\/wp\/v2\/media\/18498"}],"wp:attachment":[{"href":"https:\/\/cryptoted.net\/index.php\/wp-json\/wp\/v2\/media?parent=18517"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cryptoted.net\/index.php\/wp-json\/wp\/v2\/categories?post=18517"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cryptoted.net\/index.php\/wp-json\/wp\/v2\/tags?post=18517"},{"taxonomy":"kronos_expire_date","embeddable":true,"href":"https:\/\/cryptoted.net\/index.php\/wp-json\/wp\/v2\/kronos_expire_date?post=18517"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}