Close Menu
    Trending
    • Ethereum Reclaims $2,500 In Squeeze-Driven Rally
    • $1 Billion Filing by Bakkt Hints at Bitcoin Treasury Ambitions
    • Ripple and SEC End Legal Battle by Dropping Appeals
    • Fading Spot Volumes And Muted Futures Sentiment Threaten To Send Bitcoin Below $99,000 Again
    • FATF sounds alarm over rising stablecoin misuse as global crypto rules lag
    • Number of Large Bitcoin Investors Surge to Multi-Month Highs: Do They Know Something?
    • Why did Cantor Fitzgerald set a $30 target for Core Scientific after its CoreWeave deal?
    • Discover the Earning Potential of AI Master:
    Simon Crypto
    • Home
    • Crypto Market Trends
    • Bitcoin News
    • Crypto Mining
    • Cryptocurrency
    • Blockchain
    • More
      • Altcoins
      • Ethereum
    Simon Crypto
    Home»Ethereum»Solidity Storage Array Bugs | Ethereum Foundation Blog
    Ethereum

    Solidity Storage Array Bugs | Ethereum Foundation Blog

    Team_SimonCryptoBy Team_SimonCryptoJanuary 23, 2025No Comments5 Mins Read
    Share
    Facebook Twitter LinkedIn Pinterest Email


    Solidity Storage Array Bug Announcement

    This weblog publish is about two bugs related to storage arrays that are in any other case unrelated. Each have been current within the compiler for a very long time and have solely been found now regardless that a contract containing them ought to very possible present malfunctions in checks.

    Daenam Kim with assist from Nguyen Pham, each from Curvegrid found a problem the place invalid information is saved in reference to arrays of signed integers.

    This bug has been current since Solidity 0.4.7 and we take into account it the extra severe of the 2. If these arrays use damaging integers in a sure state of affairs, it’s going to trigger information corruption and thus the bug ought to be straightforward to detect.

    By way of the Ethereum bug bounty program, we acquired a report a couple of flaw inside the new experimental ABI encoder (known as ABIEncoderV2). The brand new ABI encoder continues to be marked as experimental, however we however suppose that this deserves a distinguished announcement since it’s already used on mainnet.
    Credit to Ming Chuan Lin (of https://www.secondstate.io) for each discovering and fixing the bug!

    The 0.5.10 release accommodates the fixes to the bugs.
    For the time being, we don’t plan to publish a repair to the legacy 0.4.x collection of Solidity, however we’d if there’s common demand.

    Each bugs ought to be simply seen in checks that contact the related code paths.

    Particulars concerning the two bugs might be discovered beneath.

    Signed Integer Array Bug

    Who ought to be involved

    When you’ve got deployed contracts which use signed integer arrays in storage and both instantly assign

    • a literal array with at the very least one damaging worth in it (x = [-1, -2, -3];) or
    • an current array of a totally different signed integer kind

    to it, it will result in information corruption within the storage array.

    Contracts that solely assign particular person array parts (i.e. with x[2] = -1;) will not be affected.

    Find out how to verify if contract is susceptible

    In case you use signed integer arrays in storage, attempt to run checks the place you utilize damaging values. The impact ought to be that the precise worth saved is constructive as an alternative of damaging.

    When you’ve got a contract that meets these situations, and need to confirm whether or not the contract is certainly susceptible, you possibly can attain out to us through security@ethereum.org.

    Technical particulars

    Storage arrays might be assigned from arrays of various kind. Throughout this copy and task operation, a sort conversion is carried out on every of the weather. Along with the conversion, particularly if the signed integer kind is shorter than 256 bits, sure bits of the worth need to be zeroed out in preparation for storing a number of values in the identical storage slot.

    Which bits to zero out was incorrectly decided from the supply and never the goal kind. This results in too many bits being zeroed out. Specifically, the signal bit will probably be zero which makes the worth constructive.

    ABIEncoderV2 Array Bug

    Who ought to be involved

    When you’ve got deployed contracts which use the experimental ABI encoder V2, then these may be affected. Because of this solely contracts which use the next directive inside the supply code might be affected:

    pragma experimental ABIEncoderV2;
    

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

    Find out how to verify if contract is susceptible

    The bug solely manifests itself when the entire following situations are met:

    • Storage information involving arrays or structs is shipped on to an exterior perform name, to abi.encode or to occasion information with out prior task to an area (reminiscence) variable AND
    • this information both accommodates an array of structs or an array of statically-sized arrays (i.e. at the very least two-dimensional).

    Along with that, within the following state of affairs, your code is NOT affected:

    • should you solely return such information and don’t use it in abi.encode, exterior calls or occasion information.

    Potential penalties

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

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

    Technical particulars

    In the course of the encoding course of, the experimental ABI encoder doesn’t correctly advance to the subsequent factor in an array in case the weather occupy greater than a single slot in storage.

    That is solely the case for parts which might be structs or statically-sized arrays. Arrays of dynamically-sized arrays or of elementary datatypes will not be affected.

    The particular impact you will notice is that information is “shifted” within the encoded array: When you’ve got an array of kind uint[2][] and it accommodates the information
    [[1, 2], [3, 4], [5, 6]], then it will likely be encoded as [[1, 2], [2, 3], [3, 4]] as a result of the encoder solely advances by a single slot between parts as an alternative of two.

    This publish was collectively composed by @axic, @chriseth, @holiman



    Source link

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email

    Related Posts

    FATF sounds alarm over rising stablecoin misuse as global crypto rules lag

    June 27, 2025

    Pepe meme creator’s NFT projects hit for $1 million as contract hijackers drain collections

    June 27, 2025

    Former Tether, Hut 8, Blackstone execs to launch $1B crypto treasury firm

    June 26, 2025

    Ethereum Builds Critical Pattern On Daily Chart, Volatility Ahead

    June 26, 2025
    Add A Comment
    Leave A Reply Cancel Reply

    Categories
    • Altcoins
    • Bitcoin News
    • Blockchain
    • Crypto Market Trends
    • Crypto Mining
    • Cryptocurrency
    • Ethereum
    Archives
    • June 2025
    • May 2025
    • April 2025
    • March 2025
    • February 2025
    • January 2025
    • December 2024
    • November 2024
    Archives
    • June 2025
    • May 2025
    • April 2025
    • March 2025
    • February 2025
    • January 2025
    • December 2024
    • November 2024
    Top Posts

    eth2 quick update no. 12

    January 12, 2025

    ad

    About us

    Welcome to SimonCrypto.in, your ultimate destination for everything crypto! Whether you’re a seasoned investor, a blockchain enthusiast, or just beginning your journey into the fascinating world of cryptocurrencies, we’re here to guide you every step of the way.

    At SimonCrypto.in, we are passionate about demystifying the complex world of digital currencies and blockchain technology. Our mission is to provide insightful, accurate, and up-to-date information to empower our readers to make informed decisions in the ever-evolving crypto space.

    Top Insights

    What does the USD1 stablecoin launch on TRON indicate about stablecoin competition?

    June 17, 2025

    Ethereum Price Drops Below $2,500: Investors Buy the Dip

    February 27, 2025

    F Street Announced Goal Of Accumulating $10 Million In Bitcoin

    June 11, 2025
    Categories
    • Altcoins
    • Bitcoin News
    • Blockchain
    • Crypto Market Trends
    • Crypto Mining
    • Cryptocurrency
    • Ethereum
    • Privacy Policy
    • Disclaimer
    • Terms and Conditions
    • About us
    • Contact us
    Copyright © 2024 SimonCrypto All Rights Reserved.

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