Thursday, June 19, 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

‘Run It Back’ – Crypto Analyst Predicts Massive Rallies for Ethereum and Solana, Says October Will Be ‘Lit’

‘Run It Back’ – Crypto Analyst Predicts Massive Rallies for Ethereum and Solana, Says October Will Be ‘Lit’

September 12, 2024
Too many young people turn to crypto, says UK watchdog

Too many young people turn to crypto, says UK watchdog

March 26, 2025
Journalist Slams Bitcoin, Labels The Whole System A ‘Sack Of Sand’

Journalist Slams Bitcoin, Labels The Whole System A ‘Sack Of Sand’

February 10, 2024
300 Million Dogecoin (DOGE) Moved To Robinhood As Price Swells

300 Million Dogecoin (DOGE) Moved To Robinhood As Price Swells

December 16, 2023
What is vegetation management?  – IBM Blog

What is vegetation management?  – IBM Blog

January 29, 2024
Analyst Says These Factors Will Drive XRP Price To $1,000, But What Does Market Cap Say?

Analyst Says These Factors Will Drive XRP Price To $1,000, But What Does Market Cap Say?

May 8, 2025

Recent Posts

  • Ethereum Outperforms Bitcoin During Geopolitical Chaos – Is Altseason About To Ignite?
  • Telegram’s Durov Warns Of Irreparable Decline in France
  • Mapping Bitcoin’s road ahead: Is $93K or $107K next for BTC?

Categories

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

Recommended

Ethereum Outperforms Bitcoin During Geopolitical Chaos – Is Altseason About To Ignite?

Ethereum Outperforms Bitcoin During Geopolitical Chaos – Is Altseason About To Ignite?

June 19, 2025
Toncoin open interest soars 67% as Pavel Durov departs France

Telegram’s Durov Warns Of Irreparable Decline in France

June 19, 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