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

BNB Price Breaks $600, Why Bulls Could Now Aim New ATH

BNB Price Breaks $600, Why Bulls Could Now Aim New ATH

March 14, 2024
Is Bitcoin in a ‘stealth bear market’ relative to gold? Peter Schiff believes…

Is Bitcoin in a ‘stealth bear market’ relative to gold? Peter Schiff believes…

March 16, 2025
MicroStrategy Could Be Forced To Dump Bitcoin Under These Circumstances, Michael Saylor Responds

MicroStrategy Could Be Forced To Dump Bitcoin Under These Circumstances, Michael Saylor Responds

April 11, 2025
PayPal’s PYUSD to Be Integrated into Aave Following Vote

PayPal’s PYUSD to Be Integrated into Aave Following Vote

January 11, 2024
XRP Price Rebound in Jeopardy: Recovery May Falter

XRP Price Rebound in Jeopardy: Recovery May Falter

August 3, 2024
Ethereum Price Eyes Major Resistance At $2,100 As Analyst Reveals Bullish Price Range

Ethereum Price Eyes Major Resistance At $2,100 As Analyst Reveals Bullish Price Range

March 28, 2025

Recent Posts

  • XRP Price Sinks Lower, But Chart Whisperers See a Trap for The Bears
  • Binance’s Ethereum Reserves Drop By Nearly 300,000 ETH In A Month – Is A Massive Rally Coming?
  • Fund management needs to make digital shift

Categories

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

Recommended

XRP Price Gears Up—Can It Overcome Key Resistance Levels?

XRP Price Sinks Lower, But Chart Whisperers See a Trap for The Bears

May 16, 2025
Binance’s Ethereum Reserves Drop By Nearly 300,000 ETH In A Month – Is A Massive Rally Coming?

Binance’s Ethereum Reserves Drop By Nearly 300,000 ETH In A Month – Is A Massive Rally Coming?

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