Wednesday, June 18, 2025
  • Home
  • Cryptocurrency
  • Bitcoin
  • Blockchain
  • Market & Analysis
  • Altcoin
  • More
    • Ethereum
    • DeFi
    • XRP
    • Dogecoin
    • NFTs
    • Regulations
  • Shop
    • Bitcoin Book
    • Bitcoin Coin
    • Bitcoin Hat
    • Bitcoin Merch
    • Bitcoin Miner
    • Bitcoin Miner Machine
    • Bitcoin Shirt
    • Bitcoin Standard
    • Bitcoin Wallet
Finance Bitcoin
Shop
No Result
View All Result
Finance Bitcoin
No Result
View All Result
Home Ethereum

Solidity Storage Array Bugs | Ethereum Foundation Blog

by n70products
June 14, 2025
in Ethereum
0
Ethereum Muir Glacier Upgrade Announcement
189
SHARES
1.5k
VIEWS
Share on FacebookShare on Twitter


Solidity Storage Array Bug Announcement

This weblog submit is about two bugs linked 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 probably present malfunctions in assessments.

Daenam Kim with assist from Nguyen Pham, each from Curvegrid found a difficulty the place invalid knowledge 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 critical of the 2. If these arrays use damaging integers in a sure scenario, it is going to trigger knowledge corruption and thus the bug must be simple to detect.

Via the Ethereum bug bounty program, we obtained 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 assume 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 incorporates the fixes to the bugs.
In the meanwhile, we don’t plan to publish a repair to the legacy 0.4.x collection of Solidity, however we would if there may be common demand.

Each bugs must be simply seen in assessments that contact the related code paths.

Particulars concerning the two bugs could be discovered under.

Signed Integer Array Bug

Who must be involved

In case you have deployed contracts which use signed integer arrays in storage and both immediately assign

  • a literal array with not less than one damaging worth in it (x = [-1, -2, -3];) or
  • an current array of a completely different signed integer kind

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

Contracts that solely assign particular person array components (i.e. with x[2] = -1;) usually are not affected.

Methods to verify if contract is weak

In case you use signed integer arrays in storage, attempt to run assessments the place you utilize damaging values. The impact must be that the precise worth saved is optimistic as a substitute of damaging.

In case you have a contract that meets these situations, and need to confirm whether or not the contract is certainly weak, you’ll be able to attain out to us through security@ethereum.org.

Technical particulars

Storage arrays could be assigned from arrays of various kind. Throughout this copy and project 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 should 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 optimistic.

ABIEncoderV2 Array Bug

Who must be involved

In case you have deployed contracts which use the experimental ABI encoder V2, then these is perhaps affected. Which means that solely contracts which use the next directive inside the supply code could be affected:

pragma experimental ABIEncoderV2;

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

Methods to verify if contract is weak

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

  • Storage knowledge involving arrays or structs is distributed on to an exterior operate name, to abi.encode or to occasion knowledge with out prior project to a neighborhood (reminiscence) variable AND
  • this knowledge both incorporates an array of structs or an array of statically-sized arrays (i.e. not less than two-dimensional).

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

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

Attainable penalties

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

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

Technical particulars

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

That is solely the case for components which can be structs or statically-sized arrays. Arrays of dynamically-sized arrays or of elementary datatypes usually are not affected.

The particular impact you will notice is that knowledge is “shifted” within the encoded array: In case you have an array of kind uint[2][] and it incorporates the information
[[1, 2], [3, 4], [5, 6]], then it is going to be encoded as [[1, 2], [2, 3], [3, 4]] as a result of the encoder solely advances by a single slot between components as a substitute of two.

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



Source link

Tags: ArrayBlogBugsEthereumFoundationSolidityStorage
  • Trending
  • Comments
  • Latest
Liquidation Alert As High-Risk Loans On Aave Reach $1 Billion – Details

Liquidation Alert As High-Risk Loans On Aave Reach $1 Billion – Details

December 19, 2024
Slumping Memecoin Pepe Could Witness Nearly 50% Collapse, Warns Crypto Trader

Slumping Memecoin Pepe Could Witness Nearly 50% Collapse, Warns Crypto Trader

December 16, 2024
Devconnect Istanbul 2023 – A celebration of progress and the Ethereum community

Devconnect Istanbul 2023 – A celebration of progress and the Ethereum community

December 16, 2024
XRP Primed for 90% Rally to $1.2, According to Top Analyst

XRP Primed for 90% Rally to $1.2, According to Top Analyst

December 16, 2024
iStock 1252711675

Peter Schiff Questions True Agenda Behind MicroStrategy’s Bitcoin Acquisition

0
Decentralized Oracle Network Chainlink Leads the Crypto Space in Terms of Recent Development Activity: Santiment

Decentralized Oracle Network Chainlink Leads the Crypto Space in Terms of Recent Development Activity: Santiment

0
Migrate and modernize enterprise integration using IBM Cloud Pak for Integration with Red Hat OpenShift Service on AWS (ROSA)

Migrate and modernize enterprise integration using IBM Cloud Pak for Integration with Red Hat OpenShift Service on AWS (ROSA)

0
A16z Crypto Lawyer Unleashes Scathing Attack On US SEC, Spot Ethereum ETF In Danger?

A16z Crypto Lawyer Unleashes Scathing Attack On US SEC, Spot Ethereum ETF In Danger?

0
Bitcoin Volume Surges 100% Amid War Threats – What To Expect

Bitcoin Volume Surges 100% Amid War Threats – What To Expect

June 18, 2025
Pro-crypto Democrats pull support for stablecoin bill in last minute

GENIUS Act Opens Door for Stablecoin Bank Settlements, Institutional Adoption

June 18, 2025
XRP Price Slides Under Support Level, Selling Pressure Intensifies

XRP Price Slides Under Support Level, Selling Pressure Intensifies

June 18, 2025
Ethereum Muir Glacier Upgrade Announcement

Beginning a new ethereum.org | Ethereum Foundation Blog

June 18, 2025

Recent News

Bitcoin Volume Surges 100% Amid War Threats – What To Expect

Bitcoin Volume Surges 100% Amid War Threats – What To Expect

June 18, 2025
Pro-crypto Democrats pull support for stablecoin bill in last minute

GENIUS Act Opens Door for Stablecoin Bank Settlements, Institutional Adoption

June 18, 2025

Categories

  • Altcoin
  • Bitcoin
  • Blockchain
  • Cryptocurrency
  • DeFi
  • Dogecoin
  • Ethereum
  • Market & Analysis
  • NFTs
  • Regulations
  • XRP

Recommended

  • Bitcoin Volume Surges 100% Amid War Threats – What To Expect
  • GENIUS Act Opens Door for Stablecoin Bank Settlements, Institutional Adoption
  • XRP Price Slides Under Support Level, Selling Pressure Intensifies
  • Beginning a new ethereum.org | Ethereum Foundation Blog

© 2024 Finance Bitcoin | All Rights Reserved

No Result
View All Result
  • Home
  • Cryptocurrency
  • Bitcoin
  • Blockchain
  • Market & Analysis
  • Altcoin
  • More
    • Ethereum
    • DeFi
    • XRP
    • Dogecoin
    • NFTs
    • Regulations
  • Shop
    • Bitcoin Book
    • Bitcoin Coin
    • Bitcoin Hat
    • Bitcoin Merch
    • Bitcoin Miner
    • Bitcoin Miner Machine
    • Bitcoin Shirt
    • Bitcoin Standard
    • Bitcoin Wallet

© 2024 Finance Bitcoin | All Rights Reserved

Go to mobile version