We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [security]

Questions relating to application security, safety, trust, and attacks against the Ethereum software stack and blockchain system.

Filter by
Sorted by
Tagged with
0
votes
1answer
26 views

ERC20 vulnerability? Executing transferFrom undesirably

Say I have a contract called MyContract, and I require to send 100000 DAI to it. Ideally, I'd firstly call approve(<address of A>, 100000e18) in DAI's contract itself. Secondly, I'd execute, for ...
1
vote
1answer
50 views

In the case the Zerofunctionselector bug, how to know which function NAME as a 0 selector?

Normally, If a smart contract is not affected by the Zerofunctionselector bug, then at the end of the code which makes jump to the target function lies a 0xfe opcode (which result in the smart ...
0
votes
2answers
65 views

What bad things could happens if Geth RPC is public?

Geth does not ship with RPC support. By default Geth enables modules ["net", "web3", "eth", "shh"]. In case the RPC get compromised, what kind of bad things could happens? Money lost will definitely ...
0
votes
2answers
531 views

Division/Percentages in Solidity (a workaround)

Division/percentages is a required part of many applications but is difficult to implement since fixed and ufixed are not supported yet in Solidity. I've come up with this workaround: pragma ...
22
votes
2answers
2k views

What are effective techniques to encrypt/decrypt data stored in a smart contract?

Rather than sending and storing plain text in a smart contract, the use case objective is to encrypt first and then subsequently access the data and decrypt at the point of use. What is the most ...
0
votes
1answer
28 views

How dangerous the 'short address' attack is as of 2019, October and what ways there are to mitigate it?

From what I read there's a well public knowledge of reantrancy and underflows/overflows due to the cases of documented hacks and stolen ether - yet the short address attack seems less known. I know in ...
0
votes
3answers
34 views

How to prevent someone running a transaction before me?

Let's say I have the following in my smart contract: string passwordHash; uint money; function checkPassword(string cleanPassword, string newPasswordHash)[...] When running the function ...
0
votes
1answer
54 views

Proxy function clashing - what kind of danger comes exactly with it?

I read that if I am using proxy, there is a chance of function clashing. Let's say in my contract there is a function with a signature: proxyOwner() ...
0
votes
1answer
51 views

User anonymity while submitting data in smart contract

I've written a smart contract, that is a crowd sensing system. Where post posting a task user view that task and if they have what I'm asking for/and meet the task requirements they submit certain ...
0
votes
1answer
66 views

Automatically test who can withdraw Ether from a smart contract

Is there any way I can automatically test who can withdraw ether from a smart contract? I need to perform this test automatically. So I cannot manually inspect the instructions. Can I design a smart ...
0
votes
2answers
29 views

Is there a way to create double-spending transactions and submit them to different nodes?

I'm trying to create two transactions with the same nonce and send those transactions to two different nodes. Such as: const Web3 = require('web3'); const web3_1 = new Web3(rpcURL1); // node 1 const ...
0
votes
1answer
104 views

Security Implications of allowing remote RPC connections to Geth Node

What are the security Implications of allowing remote RPC connections to Geth Node? If one absolutely needs to allow remote rpc connections for web3 connection, how can one do this while securing the ...
0
votes
1answer
106 views

Quorum Consensus - BAR (Byzantine Altruistic Rational) Fault Tolerance / BAR Fault Tolerance / BAR Model

I refer to http://www.cs.utexas.edu/~dahlin/projects/bft/ http://www.cs.cornell.edu/lorenzo/papers/sosp05.pdf http://www.cs.northwestern.edu/~fabianb/classes/cs-443-w07/BAR.pdf https://blog.ethereum....
0
votes
1answer
32 views

How to build security into Dapps?

I am building a loan dapp. The functionality is not easy to build but relatively straightforward. My question is though does anyone have any suggestions of how to build in user logins and security? ...
0
votes
0answers
12 views

Hidding IP address behind sentry nodes

I would like to know how to set up an Ethereum node behind sentries (proxy nodes). I know there are several ways to approach this issue as mentioned here. https://medium.com/@kidinamoto/tech-choices-...
0
votes
1answer
13 views

Can a miner delay a transaction?

Say that my wallet is connected to a malicious miner. Of course this miner can DoS me and ignore all my transactions, but can they withhold it and release it to the network in the future? Or is the ...
0
votes
1answer
33 views

Gas optimisation for my art experiment spacecans.com

so I was microdosing some research chems and the thought came to me that I need to do some artsy blockchain stuff for once. It's two tin cans floating in space that you can advertise your so-called ...
0
votes
0answers
24 views

Can you verify transaction data by matching it to the transaction hash

TlDr; Can you use the transaction hash to confirm the integrity of the data components of a transaction (post data, addresses, nonce, etc). In my application, I have a connection to the Ethereum ...
0
votes
1answer
22 views

Risk of Messages Not Having a Signature

As per my understanding transactions are signed before sending to Ethereum. Else, no transfer of Ether will happen. However, messages sent to Smart Contracts (SC) aren't signed (e.g., using methods....
1
vote
1answer
168 views

Using Hardware Security Modules to generate and store private keys on private ethereum / quorum

For a private ethereum networks, has anyone used Hardware Security Modules (HSM) to generate and store Ethereum private keys? I am keen to know how public/private keys are managed without a PKI (...
154
votes
17answers
43k views

How can I securely generate a random number in my smart contract?

If I am writing a smart contract for some kind of (gambling) game, how can I generate a random number securely? What are the best practises and security trade-offs to be aware of?
0
votes
1answer
131 views

Are there any security issues to send token in fallback function?

I want to have a contract that releases an erc-20 token as soon as someone pays ether to contract. Let's call this contract Bid Contract. The abstract code goes like: function askForTokens() public ...
1
vote
1answer
165 views

Implication of hacking into an ethereum node on proof of stake

It is my understanding that in proof of stake, the validator puts up a stake that gets slashed if they don't respond to requests truthfully. In the scenario that someone hacks into your node, wouldn't ...
0
votes
1answer
28 views

dApp design and security question

I'm designing a dApp where users can submit work they've done (files) to ipfs/swarm. To get credit for the work they then reference the hash of the files when calling a smart contract. What are some ...
0
votes
1answer
195 views

transfer/send error cases

I have a (noob) question on the usage of transfer and send. I have seen that transfer is equivalent to require(x.send(k)); When I use send() I know that I have to check whether there was an error ...
0
votes
1answer
254 views

Threat Model Question - Code Injection / ROP possible in Ethereum Smart Contracts?

I am trying to understand a basic threat model for Ethereum Smart Contracts, to perform some research on how existing attacks techniques may be applied here as well. Is there a risk of a contract with ...
0
votes
1answer
187 views

Web wallet best practices

I'm putting together an ether/erc20 token wallet in a chrome extension but would like to follow best practices with regards to private key security. I'm using localstorage to handle login and its ...
4
votes
1answer
37 views

Why is the subcall gas limit set to 63/64th of the remaining gas?

From the solidity docs: Calls are limited to a depth of 1024, which means that for more complex operations, loops should be preferred over recursive calls. Furthermore, only 63/64th of the gas can ...
1
vote
0answers
24 views

Is there a curated list of known security vulnerabilities related to escrow?

In Factories Improve Smart Contract Security, Steve Marx says that: This bug was hand-picked to show the benefit, but this bug is representative of a large class of bugs around escrow. In my ...
5
votes
5answers
771 views

how to easily transfer ERC20 token from 1000+ accounts which has no ETH in it initially?

I have a requirement to have 1000+ ethereum addresses, which in fact used to store small amounts of various ERC20 tokens. I want to move all these crypto assets in all these 1000+ wallets into a ...
1
vote
1answer
22 views

Why OpenZepplin always use private visibility for state variables?

Why OpenZepplin always use private visibility with getter functions for its state variables? I can't find a reason why they are not using public, is there any potential security or gas cost difference ...
2
votes
1answer
33 views

Getter functions for loop security

Is there any security issue when making for-loops inside getter functions ? Let's say the array is very large, and it takes a long time to loop through the array. Is it a potential threat or I can ...
1
vote
0answers
35 views

Help hacking this contract

This is a very simple contract that I can't hack and I'm stuck, I need some help to get the concepts right. pragma solidity ^0.4.10; contract SimpleToken { mapping(address => uint) public ...
1
vote
1answer
856 views

ETH stolen from two MEW wallets & moved to an unknown address & then to ShapeShift

I recently found out that my ETH funds were stolen from two MEW wallets and moved to an unknown address. Below are addresses of my two MEW wallets. 1) 0x16bf750Ee569F0A173BCCfD7b3F92F9Bb46c6AfC (...
1
vote
1answer
23 views

How mining happen in private and permissioned blockchain?

In public blockchain a miner gets rewarded for mining a block. But in a private or permissioned blockchain, if there are no rewarding facilities available, how does the mining happen? Also, is it ...
1
vote
2answers
373 views

Automatic transaction

I would like to know if it was possible to automatically send any ETH amout to an address "B" just after receiving them on an address "A"? Maybe via a script? I need help
1
vote
2answers
34 views

Dos with revert

While I was reading a guide on smart contract security (by consensys) I found this: // INSECURE contract Auction { address currentLeader; uint highestBid; function bid() payable { ...
0
votes
1answer
17 views

Is it safe to share my signed transaction publicly?

If someone got hold of my Ethereum signed transaction, is my wallet still safe? Can they extract the raw transaction from the signed transaction to get my private key?
21
votes
2answers
4k views

Is each Ethereum address shared by (theoretically) 2 ** 96 private keys?

Summary This is an extended question to How are ethereum addresses generated?. In Ethereum, a private key is 256-bit long, but an address is only 160-bit long. By "Pigeonhole Principle", it ...
1
vote
1answer
55 views

Access manager in Smart Contract

I'm building a service where one can publish a crypted file on the internet which can be accessed and decrypted by people allowed. I don't want to store any crypted key on a server or something. For ...
1
vote
1answer
48 views

Off-chain authorization system

I'm working on a dapp and am running into a dilemma regarding how to balance trustlessness with the cost of transactions for users. In order to reduce gas usage by users, I want to be able to able to ...
48
votes
3answers
32k views

<address>.send vs <address>.transfer best practice usage?

I noticed that address's offer two member functions that perform the transfer of ether to the specified address. send returns false upon failure and transfer raises an exception. In the Solidity ...
0
votes
1answer
51 views

Solidity: extract data from signed message?

In an effort to reduce gas costs for users, I'm looking for a way to delegate certain transactions to a contract owner so that the owner makes a transactions that would have been otherwise sent by the ...
1
vote
1answer
36 views

adaptive vs. non-adaptive adversaries? Is there a precise, unique and general definition? (Updated)

In this Ethereum github page (Link to the page: https://github.com/ethereum/wiki/wiki/Sharding-FAQ#what-are-the-security-models-that-we-are-operating-under) there is a very brief definition of the ...
1
vote
0answers
13 views

How exactly theᴅᴀᴏ reentrancy hack was performed without having weiGiven>0 nor IsAllowed(WithdrawAddress)?

The well known ᴅᴀᴏ hack didn’t affect ether balances of theᴅᴀᴏ but balances of rewardAccount. That’s why I’m talking about the hack version which affected contract balances of theᴅᴀᴏ itself. With ...
4
votes
2answers
762 views

Why and how does the “low security” functions affect the biggest multi signature contract?

People use this contract everyday http://github.com/ethereum/dapp-bin/blob/master/wallet/wallet.sol and it's also the contract with most ethereums right now. Also you can create a multisig account on ...
1
vote
1answer
25 views

Is it possible to manipulate maximum callstack size in solidity?

I'm a student learning about solidity language. According to solidity's official docs, the maximum callstack size is 1024. But, I am wondering, can a developer change the maximum callstack size in ...
0
votes
1answer
451 views

Setting up MyEtherWallet on iOS device from Coinbase

Can I securely set up and store a MyEthereumWallet on iOS only without an computer? I want to transfer ethers from Coinbase.
0
votes
1answer
13 views

Can I rely on certain oracle to know the precise and reliable timestamp?

I am learning the security impact of smart contract on system properties like block.timestamp and block.number. I understood that block.timestamp can be controlled by the miner to certain degree and ...
0
votes
1answer
12 views

What does this payment fragment mean?

I am trying to comprehend the following snippet of payment code: if (collectedFees >= minFeePayout) { if (!owner.send(collectedFees)) { // Potentially sending ...