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

Security Alert – Solidity – Variables can be overwritten in storage

n70products by n70products
February 22, 2025
in Ethereum
0
Security Alert – Solidity – Variables can be overwritten in storage
0
SHARES
0
VIEWS
Share on FacebookShare on Twitter


Abstract: In some conditions, variables can overwrite different variables in storage.

Affected Solidity compiler variations: 0.1.6 to 0.4.3 (together with 0.4.4 pre-release variations)

Detailed description:

Storage variables which are smaller than 256 bits are packed collectively into the identical 256 bit slot if they’ll match. If a price bigger than what’s allowed by the sort is assigned to the primary variable, that worth will overwrite the second variable.

This implies if an attacker may cause an overflow within the worth of the primary variable, then the second variable may be modified. Creating an overflow within the first variable is feasible utilizing arithmetics or by immediately passing in a price from the decision knowledge (values in name knowledge are aligned to 32 bytes, and padding is neither verified nor enforced).

Contracts that solely use the kinds listed under for state variables are not affected. Arrays, mappings and structs (based mostly on these following sorts) are additionally not affected:

  • signed integers, together with sizes smaller than 256 bits
  • bytesNN sorts, together with sizes smaller than 256 bits
  • unsigned integers (uint) of 256 bits

Contracts with sorts smaller than 256 bits which are by no means subsequent to one another (word that state variables of base contracts are “pulled in”) are not affected.

The Ethereum multisignature pockets contract is not affected.
Observe that addresses take up 160 bits, so contracts that solely use addresses and 256-bit sorts are secure. Moreover, addresses and booleans are virtually by no means manipulated by way of arithmetic operations in apply, so contracts utilizing solely addresses, booleans and 256 bit sorts also needs to be secure.

The next contracts could also be affected:
Contracts containing two or extra contiguous state variables the place the sum of their sizes is lower than 256 bits and the primary state variable shouldn’t be a signed integer and never of bytesNN kind.

Varieties smaller than 256 bits embrace:
bool, enums, uint8, …, uint248, int8, …, int248, tackle, any contract kind

Beneficial motion:

  • Recompile contracts that haven’t but been deployed utilizing at the least Solidity launch 0.4.4 (not the pre-release or nightly model).
  • Deactivate, take away funds from, or improve already deployed contracts.

This vulnerability was discovered by [github.com/catageek](https://github.com/catageek): [https://github.com/ethereum/solidity/issues/1306](https://github.com/ethereum/solidity/points/1306)



Source link

Tags: AlertoverwrittenSecuritySolidityStorageVariables
Previous Post

Analyst Predicts Dogecoin Price Surge To $4 — Here’s How

Next Post

Montana Bitcoin (BTC) Reserve Bill Passes Out of Committee Stage, Heads Toward State House Floor Vote

Next Post
Montana Bitcoin (BTC) Reserve Bill Passes Out of Committee Stage, Heads Toward State House Floor Vote

Montana Bitcoin (BTC) Reserve Bill Passes Out of Committee Stage, Heads Toward State House Floor Vote

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Premium Content

$1.2B In Ethereum Withdrawn From CEXs – Strong Accumulation Signal

$1.2B In Ethereum Withdrawn From CEXs – Strong Accumulation Signal

May 15, 2025
Coinbase Terminates USDC Yield Program for Users in the European Economic Area Citing New EU Regulations

Coinbase Terminates USDC Yield Program for Users in the European Economic Area Citing New EU Regulations

November 30, 2024
Finalized no. 24 | Ethereum Foundation Blog

Finalized no. 24 | Ethereum Foundation Blog

August 24, 2024
Is Bitcoin Price Turning Bullish Or Bearish? Crypto Analyst Reveals Critical Levels To Watch

Is Bitcoin Price Turning Bullish Or Bearish? Crypto Analyst Reveals Critical Levels To Watch

May 16, 2025
Bitcoin Price Regains Strength – Why BTC Could Still Remain In Range Before 2024

Bitcoin Price Reclaims $48K But Can Bulls Pump BTC To $50K?

February 13, 2024
Bitcoin Price Accumulation – Risk of Pullback Escalates Below $52K

Bitcoin Price At Risk of Another Downside Thrust Before Higher

March 7, 2024

Recent Posts

  • Ethereum in practice part 2: how to build a better democracy in under a 100 lines of code
  • New Decentralized Gaming Token Skyrockets Following Binance Listing
  • Here is why Bitcoin price is stuck below $105K

Categories

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

Recommended

Audit Results for the Pectra System Contracts

Ethereum in practice part 2: how to build a better democracy in under a 100 lines of code

May 16, 2025
New Decentralized Gaming Token Skyrockets Following Binance Listing

New Decentralized Gaming Token Skyrockets Following Binance Listing

May 16, 2025

© 2023 Dollar-Bitcoin | All Rights Reserved

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

© 2023 Dollar-Bitcoin | All Rights Reserved

Are you sure want to unlock this post?
Unlock left : 0
Are you sure want to cancel subscription?
Go to mobile version