Close Menu
    Trending
    • Ethereum aims to stop rogue AI agents from stealing trust with new ERC-8004
    • Strategy ($MSTR) Hits 52-Week Low As Bitcoin Crashes To $83k
    • What It Means for Cardano’s Price
    • How Low Can ETH Price Go in February?
    • Analyst Shares Simple Framework That Points Higher
    • Banks may lose up to $500B after Fidelity’s official token launches on Ethereum with freeze powers
    • Bitcoin Price Crashes 6% To $84,000 In Sharp Sell-Off
    • Bitcoin Price Plunges to 6-Week Low as Liquidations Explode Amid Iran Strike Fears
    CryptoGate
    • Home
    • Bitcoin News
    • Cryptocurrency
    • Crypto Market Trends
    • Altcoins
    • Ethereum
    • Blockchain
    • en
      • en
      • fr
      • de
      • it
      • ja
    CryptoGate
    Home»Ethereum»Solidity Optimizer and ABIEncoderV2 Bug
    Ethereum

    Solidity Optimizer and ABIEncoderV2 Bug

    CryptoGateBy CryptoGateDecember 15, 2025No Comments8 Mins Read
    Share
    Facebook Twitter LinkedIn Pinterest Email


    Solidity Optimizer and ABIEncoderV2 Bug Announcement

    By the Ethereum bug bounty program, we acquired a report a couple of flaw throughout the new experimental ABI encoder (known as ABIEncoderV2). Upon investigation, it was discovered that the element suffers from a number of completely different variations of the identical kind. The primary a part of this announcement explains this bug intimately. The brand new ABI encoder continues to be marked as experimental, however we nonetheless suppose that this deserves a distinguished announcement since it’s already used on mainnet.

    Moreover, two low-impact bugs within the optimizer have been recognized over the previous two weeks, certainly one of which was mounted with Solidity v0.5.6. Each had been launched with model 0.5.5. See the second a part of this announcement for particulars.

    The 0.5.7 release incorporates the fixes to all bugs defined on this weblog put up.

    All of the bugs talked about right here ought to be simply seen in checks that contact the related code paths, no less than when run with all combos of zero and nonzero values.

    Credit to Melonport group (Travis Jacobs & Jenna Zenk) and the Melon Council (Nick Munoz-McDonald, Martin Lundfall, Matt di Ferrante & Adam Kolar), who reported this through the Ethereum bug bounty program!

    Who ought to be involved

    When you have deployed contracts which use the experimental ABI encoder V2, then these is likely to be affected. Because of this solely contracts which use the next directive throughout the supply code could be affected:

    pragma experimental ABIEncoderV2;
    

    Moreover, there are a selection of necessities for the bug to set off. See technical particulars additional beneath for extra data.

    So far as we are able to inform, there are about 2500 contracts stay on mainnet that use the experimental ABIEncoderV2. It’s not clear what number of of them comprise the bug.

    The best way to test if contract is susceptible

    The bug solely manifests itself when all the following circumstances are met:

    • Storage information involving arrays or structs is distributed on to an exterior operate name, to abi.encode or to occasion information with out prior project to an area (reminiscence) variable AND
    • there may be an array that incorporates components with measurement lower than 32 bytes or a struct that has components that share a storage slot or members of kind bytesNN shorter than 32 bytes.

    Along with that, within the following conditions, your code is NOT affected:

    • if all of your structs or arrays solely use uint256 or int256 varieties
    • in the event you solely use integer varieties (that could be shorter) and solely encode at most one array at a time
    • in the event you solely return such information and don’t use it in abi.encode, exterior calls or occasion information.

    When you have a contract that meets these circumstances, and need to confirm whether or not the contract is certainly susceptible, you may attain out to us through security@ethereum.org.

    The best way to stop a lot of these flaws sooner or later

    With a view to be conservative about adjustments, the experimental ABI encoder has been obtainable solely when explicitly enabled, to permit folks to work together with it and take a look at it with out placing an excessive amount of belief in it earlier than it’s thought of steady.

    We do our greatest to make sure top quality, and have not too long ago began engaged on ‘semantic’ fuzzing of sure components on OSS-Fuzz (we’ve got beforehand crash-fuzzed the compiler, however that didn’t take a look at compiler correctness).

    For builders — bugs throughout the Solidity compiler are tough to detect with instruments like vulnerability detectors, since instruments which function on supply code or AST-representations don’t detect flaws which might be launched solely into the compiled bytecode.

    The easiest way to guard in opposition to a lot of these flaws is to have a rigorous set of end-to-end checks in your contracts (verifying all code paths), since bugs in a compiler very possible usually are not “silent” and as an alternative manifest in invalid information.

    Doable penalties

    Naturally, any bug can have wildly various penalties relying on this system management circulate, however we count on that that is extra more likely to result in malfunction than exploitability.

    The bug, when triggered, will underneath sure circumstances ship corrupt parameters on technique invocations to different contracts.

    Timeline

    2019-03-16:

    • Report through bug bounty, about corruption induced when studying from arrays of booleans immediately from storage into ABI encoder.

    2019-03-16 to 2019-03-21:

    • Investigation of root trigger, evaluation of affected contracts. An unexpectedly excessive depend of contracts compiled with the experimental encoder had been discovered deployed on mainnet, many with out verified source-code.
    • Investigation of bug discovered extra methods to set off the bug, e.g. utilizing structs. Moreover, an array overflow bug was present in the identical routine.
    • A handful of contracts discovered on Github had been checked, and none had been discovered to be affected.
    • A bugfix to the ABI encoder was made.

    2019-03-20:

    • Choice to make data public.
    • Reasoning: It might not be possible to detect all susceptible contracts and attain out to all authors in a well timed method, and it could be good to forestall additional proliferation of susceptible contracts on mainnet.

    2019-03-26:

    • New compiler launch, model 0.5.7.
    • This put up launched.

    Technical particulars

    Background

    The Contract ABI is a specification how information could be exchanged with contracts from the skin (a Dapp) or when interacting between contracts. It helps a wide range of kinds of information, together with easy values like numbers, bytes and strings, in addition to extra complicated information varieties, together with arrays and structs.

    When a contract receives enter information, it should decode that (that is performed by the “ABI decoder”) and previous to returning information or sending information to a different contract, it should encode it (that is performed by the “ABI encoder”). The Solidity compiler generates these two items of code for every outlined operate in a contract (and in addition for abi.encode and abi.decode). Within the Solidity compiler the subsystem producing the encoder and decoder is known as the “ABI encoder”.

    In mid-2017 the Solidity group began to work on a contemporary implementation named “ABI encoder V2” with the aim of getting a extra versatile, secure, performant and auditable code generator. This experimental code generator, when explicitly enabled, has been supplied to customers for the reason that finish of 2017 with the 0.4.19 launch.

    The flaw

    The experimental ABI encoder doesn’t deal with non-integer values shorter than 32 bytes correctly. This is applicable to bytesNN varieties, bool, enum and different varieties when they’re a part of an array or a struct and encoded immediately from storage. This implies these storage references have for use immediately inside abi.encode(…), as arguments in exterior operate calls or in occasion information with out prior project to an area variable. Utilizing return doesn’t set off the bug. The kinds bytesNN and bool will end in corrupted information whereas enum may result in an invalid revert.

    Moreover, arrays with components shorter than 32 bytes is probably not dealt with appropriately even when the bottom kind is an integer kind. Encoding such arrays in the way in which described above can result in different information within the encoding being overwritten if the variety of components encoded just isn’t a a number of of the variety of components that match a single slot. If nothing follows the array within the encoding (notice that dynamically-sized arrays are all the time encoded after statically-sized arrays with statically-sized content material), or if solely a single array is encoded, no different information is overwritten.

    Unrelated to the ABI encoder subject defined above, two bugs have been discovered within the optimiser. Each have been launched with 0.5.5 (launched on fifth of March). They’re unlikely to happen in code generated by the compiler, until inline meeting is used.

    These two bugs have been recognized by means of the latest addition of Solidity to OSS-Fuzz – a safety toolkit for locating discrepancies or points in a wide range of tasks. For Solidity we’ve got included a number of completely different fuzzers testing completely different points of the compiler.

    1. The optimizer turns opcode sequences like ((x , the place a and b are compile-time constants, into (x whereas not dealing with overflow within the addition correctly.
    2. The optimizer incorrectly handles the byte opcode if the fixed 31 is used as second argument. This will occur when performing index entry on bytesNN varieties with a compile-time fixed worth (not index) of 31 or when utilizing the byte opcode in inline meeting.

    This put up was collectively composed by @axic, @chriseth, @holiman



    Source link

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    CryptoGate
    • Website
    • Pinterest

    Related Posts

    Ethereum aims to stop rogue AI agents from stealing trust with new ERC-8004

    January 29, 2026

    Banks may lose up to $500B after Fidelity’s official token launches on Ethereum with freeze powers

    January 29, 2026

    Ethereum Foundation is hiring an Executive Director

    January 29, 2026

    Ethereum And Solana Are Flashing Caution Signals With Negative Buy/Sell Pressure Data – What This Means

    January 29, 2026
    Add A Comment
    Leave A Reply Cancel Reply

    Top Posts

    BlackRock warns crypto’s love affair with AI is over as an energy war with Bitcoin miners begins

    January 10, 2026

    Staked SEI ETF Next? Canary Edges SEC Approval Via DTCC

    November 16, 2025

    Bitcoin tumbles as whale investor shifts billions to Ethereum

    August 25, 2025

    Turn Your Smartphone into a “Pocket Mining Farm”?

    January 23, 2026

    Could A Supreme Court Ruling Against Trump Crash Bitcoin?

    January 9, 2026
    Categories
    • Altcoins
    • Bitcoin News
    • Blockchain
    • Crypto Market Trends
    • Crypto Mining
    • Cryptocurrency
    • Ethereum
    About us

    Welcome to cryptogate.info — your trusted gateway to the latest and most reliable news in the world of cryptocurrency. Whether you’re a seasoned trader, a blockchain enthusiast, or just curious about the future of digital finance, we’re here to keep you informed and ahead of the curve.

    At cryptogate.info, we are passionate about delivering timely, accurate, and insightful updates on everything crypto — from market trends, new coin launches, and regulatory developments to expert analysis and educational content. Our mission is to empower you with knowledge that helps you navigate the fast-paced and ever-evolving crypto landscape with confidence.

    Top Insights

    Ethereum Foundation Sets Ambitious Goals For the Next 10 Years In New Blog

    August 1, 2025

    Ethereum Exit Queue Crosses 2.6 Million ETH With 44-Day Wait Time, Is A $12 Billion Sell-Off Coming?

    September 20, 2025

    XRP Price Declines Further – Is a Bigger Crash on the Horizon?

    September 1, 2025
    Categories
    • Altcoins
    • Bitcoin News
    • Blockchain
    • Crypto Market Trends
    • Crypto Mining
    • Cryptocurrency
    • Ethereum
    YouTube
    • Privacy Policy
    • Disclaimer
    • Terms and Conditions
    • Impressum
    • About us
    • Contact us
    Copyright © 2025 CryptoGate All Rights Reserved.

    Type above and press Enter to search. Press Esc to cancel.