SlideShare a Scribd company logo
Brief Introduction To Blockchain Security
Johnson Zhang
1
Blockchain - Hacker’s ATM Machine
“More than 980,000 bitcoins have been
stolen from exchanges, which would be
worth more than USD $15 billion at current
exchange rates.”
Reuters on 7 December 2017
“Roughly USD $1.1 billion worth of crypto-
currency was stolen in the first half of
2018.”
Carbon Black on 7 June 2018
2
Total crypto market cap: Around 250 billion
Hacker’s Objective
To Hackers:
Cryptocurrency = Money
How?
Steal Cryptocurrency Directly
or
Steal Private Key to Obtain Cryptocurrency
3
Classic Attack: 51 % Attack
● In PoW blockchain (like Bitcoin): Longest Chain Wins
○ When the node see two versions of blockchain, the longer chain
would be picked, and the shorter one would be discarded
● In theory, if the hacker can control 51% (or more) of the
overall hashpower, he can produce new blocks faster
than the public network
4
Classic Attack: 51 % Attack
● The hacker will do mining without broadcast to the public
○ A secret version of the chain will exist
● When hacker broadcasts the secret chain, the original
chain would get discarded, because Longest Chain Wins
● The hacker can include transaction in the original chain,
and later force everyone on to the new chain
5
Classic Attack: 51 % Attack
● Very difficult and expensive to perform on Bitcoin chain
○ Need to control HUGE hashpower
● But not impossible …
○ 56.3% of the hashpower “controlled” by Bitmain
○ Lack the motivation to conduct the attack
■ Miners can switch mining pool at will
■ Act honestly can earn more consistently
owned
lead the
investment
Alliance
6
Classic Attack: 51 % Attack
● But not so difficult on less popular chains…
○ https://www.crypto51.app/
○ Real attacks did happen on some of the smaller coins like Bitcoin Gold, Verge,
etc.
7
How Hackers Attack the Blockchain
Hack the protocol
● Design issue
● Code flaw
● Vulnerable node
● Logic errors Hack the exchange
● Application
vulnerability
● Employee computer
compromise
● Cloud infrastructure
compromise
● DNS service hijack
● Rogue insider
● Customer
credentials
compromise
● Denial of Service
attack
Hack the miner / mining
pool
● Physical breach
● Malware
● Hosting account
compromise
● Rogue insider
Hack the wallet
● Design flaw
● Social
engineering
● Credential theft
● Malware
Not in the diagram
● ICO Scam
● Cloud mining scam
● Hacked scam
● Kidnap and violence
● ...
8
Crypto Institution Hacks In The Past
Data source: https://magoo.github.io/Blockchain-Graveyard/
The security of blockchain not only depends on blockchain
concepts like decentralization, consensus and smart
contract, it’s also closely related to traditional cyber security
mechanisms.
9
Case Study 1: Exchange Hack
Mt Gox Hack in 2011-2013
● BitcoinCore before 0.4.0 (released in Sep 2011) doesn’t
support native private key encryption
● Mt Gox’s wallet.dat file (contains private key for the hot
wallet in plaintext) was stolen via remote hacking or insider
theft
● Mt Gox wasn’t aware of the key theft for years
● Users keeps depositing into the hot wallet
● In total 744,000 Bitcoins had been lost (6% of the total 12.4
mil Bitcoin in circulation in Q4 2013)
References:
https://bitcoin.org/en/release/v0.4.0
https://blog.wizsec.jp/2017/07/breaking-open-mtg
ox-1.html
10
Case Study 2: Exchange User Hack
Binance Attack in March 2018
● Hackers using URLs like www.biṇaṇce.com to steal user credentials
● Bypass 2FA by double login, and create API for auto trading
● In 48 hours, BTC drop 20%, global crypto market cap drop 15%
1. User login with
credentials and OTP
2. Hacker redirect user to the real
Binance
3. Hacker login using valid OTP
within 30 sec
Altcoins BTC VIA
VIA BTC
Withdraw
(Failed)
Compromised accounts
Hacker’s accounts
Phishing
API
Trading
Reference: https://cryptobriefing.com/binance-suspends-withdrawals-after-possible-api-breach/
11
Case Study 3: Mining Pool Hack
Slush Pool hack in March 2012
● Early days of CPU/GPU mining era, Slush pool has a mining
market share of 13%
● Slush Pool’s cloud infrastructure provider, Linode, got
hacked
● According to Linode “an intruder accessed a web-based
Linode customer service portal”
● Hackers compromised Slush Pool’s hot wallet that
contained 3000+ BTC
● The Linode hack also affected the community, including:
○ Gavin Andersen, founder of Bitcoin Foundation
○ Bitcoinica, a  well known Bitcoin trading platform
● Total loss up to 46,703 BTC (0.5% of the world’s total BTC at
the time of the hack)
References:
http://archive.is/tRQ9#selection-78.10-78.14
https://blog.trezor.io/how-trezor-was-born-from-a-hacking-attack-that-affected-slush-pool-7a538f03fd8f
12
Case Study 4: Wallet Hack
MyEtherWallet Hack in April 2018
● MyEtherWallet is a popular online service for
cryptocurrency transactions
○ An interface to interact with the blockchain
○ User upload private key in order to make a transaction
○ MyEtherWallet won’t hold user’s funds/private key
● Hackers hacked into the BGP router in the ISP
● Users were redirected by false DNS record to a fake
website, and wallets got emptied
AWS
ISP
Server
Hacked
BGP
Router
Fake site
MyEtherWallet
server in
Russia
DNS redirect to
AWS Route 53
User
13
Lessons Learned from Case 1-4
● Blockchain is effectively decentralized, but the solutions
built around blockchain is still centralized (also the
infrastructure…)
○ Exchange
○ Mining pool
○ …
● Problems of centralization:
Single Point of Failure
● Possible solutions:
Decentralized Everything?
14
Case Study 5: Protocol Hack
BEC Overflow Vulnerability in April 2018
BEC is a ERC20 token written in Solidity
● Problematic function: batchTransfer
○ Send a fixed amount of token (_value) to an array of receivers
(_receivers), the number of receivers in the array is (cnt)
● Maximum value for an uint256 parameter is 2^256-1
● Hackers set _value=2^255, cnt=2, amount overflowed to be 0
● require(_value > 0 && balances[msg.sender] >= amount) Always
true! function batchTransfer(address[] _receivers, uint256 _value) public returns
(bool) {
uint cnt = _receivers.length;
// Total number tokens withdrawn from the sender.
uint256 amount = uint256(cnt) * _value;
require(cnt > 0 && cnt <= 20);
// Check if the sender can afford it.
require(_value > 0 && balances[msg.sender] >= amount);
// Withdraw the amount from sender.
balances[msg.sender] = balances[msg.sender].sub(amount);
for (uint i = 0; i < cnt; i++) {
// Transfer _value to each of the receiver.
balances[_receivers[i]] = balances[_receivers[i]].add(_value);
Transfer(msg.sender, _receivers[i], _value);
}
// Succeeds or die.
return true;
}
Result:
● Sender sent 0
token!
● Receiver each get
2^255 tokens!
15
16
Lessons learned from Case 5
● Security is often the least concerned aspect for a
startup (which is the reality but not the right thing to
do in blockchain field)
● Smart contracts were often developed by developers
without a security mindset
● Security frameworks for references
○ OpenZeppelin
(https://github.com/OpenZeppelin/openzeppelin-solidity)
○ CryptoCurrency Security Standard
(https://cryptoconsortium.org/standards/CCSS)
○ Smart Contract Best Practices
(https://github.com/ConsenSys/smart-contract-best-practi
ces)
Reference:
https://etherscan.io/token/0xc5d105e63711398af9bbff092d4b6769c82f793d?a=0xb4d30cac5124b46c2df0cf3e3e1be05f42119033

More Related Content

What's hot

Blockchain Security Issues and Challenges
Blockchain Security Issues and Challenges Blockchain Security Issues and Challenges
Blockchain Security Issues and Challenges
Merlec Mpyana
 
Blockchain based Security Architectures - A Review
Blockchain based Security Architectures - A ReviewBlockchain based Security Architectures - A Review
Blockchain based Security Architectures - A Review
Gokul Alex
 
Getting Started in Blockchain Security and Smart Contract Auditing
Getting Started in Blockchain Security and Smart Contract AuditingGetting Started in Blockchain Security and Smart Contract Auditing
Getting Started in Blockchain Security and Smart Contract Auditing
Beau Bullock
 
Blockchain Technologies
Blockchain TechnologiesBlockchain Technologies
Blockchain Technologies
Adri Jovin
 
Hyperledger Sawtooth Lake Intel's OSS Contribution to Enterprise Blockchain
Hyperledger Sawtooth Lake Intel's OSS Contribution to Enterprise BlockchainHyperledger Sawtooth Lake Intel's OSS Contribution to Enterprise Blockchain
Hyperledger Sawtooth Lake Intel's OSS Contribution to Enterprise Blockchain
Altoros
 
Blockchains and Smart Contracts: Architecture Design and Model-Driven Develop...
Blockchains and Smart Contracts: Architecture Design and Model-Driven Develop...Blockchains and Smart Contracts: Architecture Design and Model-Driven Develop...
Blockchains and Smart Contracts: Architecture Design and Model-Driven Develop...
Ingo Weber
 
1. ibm blockchain explained
1. ibm blockchain explained1. ibm blockchain explained
1. ibm blockchain explained
Diego Alberto Tamayo
 
Build your first blockchain
Build your first blockchainBuild your first blockchain
Build your first blockchain
Đoàn Thái Thiên Lộc
 
03 - An introduction to hyperledger composer
03 - An introduction to hyperledger composer03 - An introduction to hyperledger composer
03 - An introduction to hyperledger composer
Merlec Mpyana
 
Use case of block chain unit 4 AKTU
Use case of block chain unit 4 AKTUUse case of block chain unit 4 AKTU
Use case of block chain unit 4 AKTU
Rohit Verma
 
Testing in the blockchain
Testing in the blockchainTesting in the blockchain
Testing in the blockchain
Craig Risi
 
Blockchain for Business
Blockchain for BusinessBlockchain for Business
Blockchain for Business
Ahmad Gohar
 
01 what is blockchain
01 what is blockchain01 what is blockchain
01 what is blockchain
BastianBlankenburg
 
Analysing Data from Blockchains - Keynote @ SOCCA 2020
Analysing Data from Blockchains - Keynote @ SOCCA 2020Analysing Data from Blockchains - Keynote @ SOCCA 2020
Analysing Data from Blockchains - Keynote @ SOCCA 2020
Ingo Weber
 
DEFCON28_2020_EthereumSecurity_PreventingDDoS_VDF
DEFCON28_2020_EthereumSecurity_PreventingDDoS_VDFDEFCON28_2020_EthereumSecurity_PreventingDDoS_VDF
DEFCON28_2020_EthereumSecurity_PreventingDDoS_VDF
Gokul Alex
 
Blockchain tutorial
Blockchain tutorial Blockchain tutorial
Blockchain tutorial
Rohit Verma
 
The Blockchain as a Software Connector
The Blockchain as a Software ConnectorThe Blockchain as a Software Connector
The Blockchain as a Software Connector
Cesare Pautasso
 
Blockchain a-new-disruption-in-financial-servies - IBM
Blockchain a-new-disruption-in-financial-servies - IBMBlockchain a-new-disruption-in-financial-servies - IBM
Blockchain a-new-disruption-in-financial-servies - IBM
Diego Alberto Tamayo
 
Blockchain Scalability - Architectures and Algorithms
Blockchain Scalability - Architectures and AlgorithmsBlockchain Scalability - Architectures and Algorithms
Blockchain Scalability - Architectures and Algorithms
Gokul Alex
 
Blockchain Essentials - Harnessing the Technology for Banking Industry
Blockchain Essentials - Harnessing the Technology for Banking IndustryBlockchain Essentials - Harnessing the Technology for Banking Industry
Blockchain Essentials - Harnessing the Technology for Banking Industry
Goutama Bachtiar
 

What's hot (20)

Blockchain Security Issues and Challenges
Blockchain Security Issues and Challenges Blockchain Security Issues and Challenges
Blockchain Security Issues and Challenges
 
Blockchain based Security Architectures - A Review
Blockchain based Security Architectures - A ReviewBlockchain based Security Architectures - A Review
Blockchain based Security Architectures - A Review
 
Getting Started in Blockchain Security and Smart Contract Auditing
Getting Started in Blockchain Security and Smart Contract AuditingGetting Started in Blockchain Security and Smart Contract Auditing
Getting Started in Blockchain Security and Smart Contract Auditing
 
Blockchain Technologies
Blockchain TechnologiesBlockchain Technologies
Blockchain Technologies
 
Hyperledger Sawtooth Lake Intel's OSS Contribution to Enterprise Blockchain
Hyperledger Sawtooth Lake Intel's OSS Contribution to Enterprise BlockchainHyperledger Sawtooth Lake Intel's OSS Contribution to Enterprise Blockchain
Hyperledger Sawtooth Lake Intel's OSS Contribution to Enterprise Blockchain
 
Blockchains and Smart Contracts: Architecture Design and Model-Driven Develop...
Blockchains and Smart Contracts: Architecture Design and Model-Driven Develop...Blockchains and Smart Contracts: Architecture Design and Model-Driven Develop...
Blockchains and Smart Contracts: Architecture Design and Model-Driven Develop...
 
1. ibm blockchain explained
1. ibm blockchain explained1. ibm blockchain explained
1. ibm blockchain explained
 
Build your first blockchain
Build your first blockchainBuild your first blockchain
Build your first blockchain
 
03 - An introduction to hyperledger composer
03 - An introduction to hyperledger composer03 - An introduction to hyperledger composer
03 - An introduction to hyperledger composer
 
Use case of block chain unit 4 AKTU
Use case of block chain unit 4 AKTUUse case of block chain unit 4 AKTU
Use case of block chain unit 4 AKTU
 
Testing in the blockchain
Testing in the blockchainTesting in the blockchain
Testing in the blockchain
 
Blockchain for Business
Blockchain for BusinessBlockchain for Business
Blockchain for Business
 
01 what is blockchain
01 what is blockchain01 what is blockchain
01 what is blockchain
 
Analysing Data from Blockchains - Keynote @ SOCCA 2020
Analysing Data from Blockchains - Keynote @ SOCCA 2020Analysing Data from Blockchains - Keynote @ SOCCA 2020
Analysing Data from Blockchains - Keynote @ SOCCA 2020
 
DEFCON28_2020_EthereumSecurity_PreventingDDoS_VDF
DEFCON28_2020_EthereumSecurity_PreventingDDoS_VDFDEFCON28_2020_EthereumSecurity_PreventingDDoS_VDF
DEFCON28_2020_EthereumSecurity_PreventingDDoS_VDF
 
Blockchain tutorial
Blockchain tutorial Blockchain tutorial
Blockchain tutorial
 
The Blockchain as a Software Connector
The Blockchain as a Software ConnectorThe Blockchain as a Software Connector
The Blockchain as a Software Connector
 
Blockchain a-new-disruption-in-financial-servies - IBM
Blockchain a-new-disruption-in-financial-servies - IBMBlockchain a-new-disruption-in-financial-servies - IBM
Blockchain a-new-disruption-in-financial-servies - IBM
 
Blockchain Scalability - Architectures and Algorithms
Blockchain Scalability - Architectures and AlgorithmsBlockchain Scalability - Architectures and Algorithms
Blockchain Scalability - Architectures and Algorithms
 
Blockchain Essentials - Harnessing the Technology for Banking Industry
Blockchain Essentials - Harnessing the Technology for Banking IndustryBlockchain Essentials - Harnessing the Technology for Banking Industry
Blockchain Essentials - Harnessing the Technology for Banking Industry
 

Similar to Brief Introduction to Blockchain Security

Simone Bronzini - Weaknesses of blockchain applications - Codemotion Milan 2018
Simone Bronzini - Weaknesses of blockchain applications - Codemotion Milan 2018Simone Bronzini - Weaknesses of blockchain applications - Codemotion Milan 2018
Simone Bronzini - Weaknesses of blockchain applications - Codemotion Milan 2018
Codemotion
 
2019 blockchain economy
2019 blockchain economy2019 blockchain economy
2019 blockchain economy
Heung-No Lee
 
“A bitcoin mining rig”
“A bitcoin mining rig”“A bitcoin mining rig”
“A bitcoin mining rig”
glitterlabs
 
Bitcoin, Banking and the Blockchain
Bitcoin, Banking and the BlockchainBitcoin, Banking and the Blockchain
Bitcoin, Banking and the Blockchain
seancarmody
 
Blockchain, bitcoin, ethereum and ICOs
Blockchain, bitcoin, ethereum and ICOsBlockchain, bitcoin, ethereum and ICOs
Blockchain, bitcoin, ethereum and ICOs
Bogdan Fiedur
 
Introduction to Attacks on Bitcoin and Cryptos
Introduction  to Attacks on  Bitcoin and CryptosIntroduction  to Attacks on  Bitcoin and Cryptos
Introduction to Attacks on Bitcoin and Cryptos
ssuser18349f1
 
Blockchain and Bitcoin
Blockchain and BitcoinBlockchain and Bitcoin
Blockchain and Bitcoin
Hugo Rodrigues
 
An in depth presentation of Cryptocurrency.
An in depth presentation of Cryptocurrency.An in depth presentation of Cryptocurrency.
An in depth presentation of Cryptocurrency.
SanjeebSamanta1
 
Blockchain an introduction_n_li
Blockchain an introduction_n_liBlockchain an introduction_n_li
Blockchain an introduction_n_li
nikinew1
 
An Introduction to Blockchains
An Introduction to BlockchainsAn Introduction to Blockchains
An Introduction to Blockchains
Dr. Nikolaus Lipusch
 
What is Cryptojacking and How Can I Protect Myself?
What is Cryptojacking and How Can I Protect Myself?What is Cryptojacking and How Can I Protect Myself?
What is Cryptojacking and How Can I Protect Myself?
Global Knowledge Training
 
About Bitcoin, Blockchain, and the DLT Chimera
About Bitcoin, Blockchain, and the DLT ChimeraAbout Bitcoin, Blockchain, and the DLT Chimera
About Bitcoin, Blockchain, and the DLT Chimera
Ferdinando Maria Ametrano
 
Web3 Security: The Blockchain is Your SIEM
Web3 Security: The Blockchain is Your SIEMWeb3 Security: The Blockchain is Your SIEM
Web3 Security: The Blockchain is Your SIEM
Tal Be'ery
 
New Business Models enabled by Blockchain
New Business Models enabled by BlockchainNew Business Models enabled by Blockchain
New Business Models enabled by Blockchain
Slash
 
Smart contracts
Smart contractsSmart contracts
Smart contracts
Philippe Camacho, Ph.D.
 
A research-oriented introduction to the cryptographic currencies (starting wi...
A research-oriented introduction to the cryptographic currencies (starting wi...A research-oriented introduction to the cryptographic currencies (starting wi...
A research-oriented introduction to the cryptographic currencies (starting wi...
vpnmentor
 
Crypto & Crpyocurrencies Intro
Crypto & Crpyocurrencies IntroCrypto & Crpyocurrencies Intro
Crypto & Crpyocurrencies Intro
Tal Shmueli
 
Bitcoin for programmers - part 1 version 2
Bitcoin for programmers - part 1 version 2Bitcoin for programmers - part 1 version 2
Bitcoin for programmers - part 1 version 2
Wojciech Langiewicz
 
Bitcoin and Ransomware Analysis
Bitcoin and Ransomware AnalysisBitcoin and Ransomware Analysis
Bitcoin and Ransomware Analysis
inder_barara
 

Similar to Brief Introduction to Blockchain Security (20)

Simone Bronzini - Weaknesses of blockchain applications - Codemotion Milan 2018
Simone Bronzini - Weaknesses of blockchain applications - Codemotion Milan 2018Simone Bronzini - Weaknesses of blockchain applications - Codemotion Milan 2018
Simone Bronzini - Weaknesses of blockchain applications - Codemotion Milan 2018
 
2019 blockchain economy
2019 blockchain economy2019 blockchain economy
2019 blockchain economy
 
“A bitcoin mining rig”
“A bitcoin mining rig”“A bitcoin mining rig”
“A bitcoin mining rig”
 
Bitcoin, Banking and the Blockchain
Bitcoin, Banking and the BlockchainBitcoin, Banking and the Blockchain
Bitcoin, Banking and the Blockchain
 
Blockchain, bitcoin, ethereum and ICOs
Blockchain, bitcoin, ethereum and ICOsBlockchain, bitcoin, ethereum and ICOs
Blockchain, bitcoin, ethereum and ICOs
 
Bitcoin Talk at Rainbow
Bitcoin Talk at RainbowBitcoin Talk at Rainbow
Bitcoin Talk at Rainbow
 
Introduction to Attacks on Bitcoin and Cryptos
Introduction  to Attacks on  Bitcoin and CryptosIntroduction  to Attacks on  Bitcoin and Cryptos
Introduction to Attacks on Bitcoin and Cryptos
 
Blockchain and Bitcoin
Blockchain and BitcoinBlockchain and Bitcoin
Blockchain and Bitcoin
 
An in depth presentation of Cryptocurrency.
An in depth presentation of Cryptocurrency.An in depth presentation of Cryptocurrency.
An in depth presentation of Cryptocurrency.
 
Blockchain an introduction_n_li
Blockchain an introduction_n_liBlockchain an introduction_n_li
Blockchain an introduction_n_li
 
An Introduction to Blockchains
An Introduction to BlockchainsAn Introduction to Blockchains
An Introduction to Blockchains
 
What is Cryptojacking and How Can I Protect Myself?
What is Cryptojacking and How Can I Protect Myself?What is Cryptojacking and How Can I Protect Myself?
What is Cryptojacking and How Can I Protect Myself?
 
About Bitcoin, Blockchain, and the DLT Chimera
About Bitcoin, Blockchain, and the DLT ChimeraAbout Bitcoin, Blockchain, and the DLT Chimera
About Bitcoin, Blockchain, and the DLT Chimera
 
Web3 Security: The Blockchain is Your SIEM
Web3 Security: The Blockchain is Your SIEMWeb3 Security: The Blockchain is Your SIEM
Web3 Security: The Blockchain is Your SIEM
 
New Business Models enabled by Blockchain
New Business Models enabled by BlockchainNew Business Models enabled by Blockchain
New Business Models enabled by Blockchain
 
Smart contracts
Smart contractsSmart contracts
Smart contracts
 
A research-oriented introduction to the cryptographic currencies (starting wi...
A research-oriented introduction to the cryptographic currencies (starting wi...A research-oriented introduction to the cryptographic currencies (starting wi...
A research-oriented introduction to the cryptographic currencies (starting wi...
 
Crypto & Crpyocurrencies Intro
Crypto & Crpyocurrencies IntroCrypto & Crpyocurrencies Intro
Crypto & Crpyocurrencies Intro
 
Bitcoin for programmers - part 1 version 2
Bitcoin for programmers - part 1 version 2Bitcoin for programmers - part 1 version 2
Bitcoin for programmers - part 1 version 2
 
Bitcoin and Ransomware Analysis
Bitcoin and Ransomware AnalysisBitcoin and Ransomware Analysis
Bitcoin and Ransomware Analysis
 

Recently uploaded

Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 

Recently uploaded (20)

Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 

Brief Introduction to Blockchain Security

  • 1. Brief Introduction To Blockchain Security Johnson Zhang 1
  • 2. Blockchain - Hacker’s ATM Machine “More than 980,000 bitcoins have been stolen from exchanges, which would be worth more than USD $15 billion at current exchange rates.” Reuters on 7 December 2017 “Roughly USD $1.1 billion worth of crypto- currency was stolen in the first half of 2018.” Carbon Black on 7 June 2018 2 Total crypto market cap: Around 250 billion
  • 3. Hacker’s Objective To Hackers: Cryptocurrency = Money How? Steal Cryptocurrency Directly or Steal Private Key to Obtain Cryptocurrency 3
  • 4. Classic Attack: 51 % Attack ● In PoW blockchain (like Bitcoin): Longest Chain Wins ○ When the node see two versions of blockchain, the longer chain would be picked, and the shorter one would be discarded ● In theory, if the hacker can control 51% (or more) of the overall hashpower, he can produce new blocks faster than the public network 4
  • 5. Classic Attack: 51 % Attack ● The hacker will do mining without broadcast to the public ○ A secret version of the chain will exist ● When hacker broadcasts the secret chain, the original chain would get discarded, because Longest Chain Wins ● The hacker can include transaction in the original chain, and later force everyone on to the new chain 5
  • 6. Classic Attack: 51 % Attack ● Very difficult and expensive to perform on Bitcoin chain ○ Need to control HUGE hashpower ● But not impossible … ○ 56.3% of the hashpower “controlled” by Bitmain ○ Lack the motivation to conduct the attack ■ Miners can switch mining pool at will ■ Act honestly can earn more consistently owned lead the investment Alliance 6
  • 7. Classic Attack: 51 % Attack ● But not so difficult on less popular chains… ○ https://www.crypto51.app/ ○ Real attacks did happen on some of the smaller coins like Bitcoin Gold, Verge, etc. 7
  • 8. How Hackers Attack the Blockchain Hack the protocol ● Design issue ● Code flaw ● Vulnerable node ● Logic errors Hack the exchange ● Application vulnerability ● Employee computer compromise ● Cloud infrastructure compromise ● DNS service hijack ● Rogue insider ● Customer credentials compromise ● Denial of Service attack Hack the miner / mining pool ● Physical breach ● Malware ● Hosting account compromise ● Rogue insider Hack the wallet ● Design flaw ● Social engineering ● Credential theft ● Malware Not in the diagram ● ICO Scam ● Cloud mining scam ● Hacked scam ● Kidnap and violence ● ... 8
  • 9. Crypto Institution Hacks In The Past Data source: https://magoo.github.io/Blockchain-Graveyard/ The security of blockchain not only depends on blockchain concepts like decentralization, consensus and smart contract, it’s also closely related to traditional cyber security mechanisms. 9
  • 10. Case Study 1: Exchange Hack Mt Gox Hack in 2011-2013 ● BitcoinCore before 0.4.0 (released in Sep 2011) doesn’t support native private key encryption ● Mt Gox’s wallet.dat file (contains private key for the hot wallet in plaintext) was stolen via remote hacking or insider theft ● Mt Gox wasn’t aware of the key theft for years ● Users keeps depositing into the hot wallet ● In total 744,000 Bitcoins had been lost (6% of the total 12.4 mil Bitcoin in circulation in Q4 2013) References: https://bitcoin.org/en/release/v0.4.0 https://blog.wizsec.jp/2017/07/breaking-open-mtg ox-1.html 10
  • 11. Case Study 2: Exchange User Hack Binance Attack in March 2018 ● Hackers using URLs like www.biṇaṇce.com to steal user credentials ● Bypass 2FA by double login, and create API for auto trading ● In 48 hours, BTC drop 20%, global crypto market cap drop 15% 1. User login with credentials and OTP 2. Hacker redirect user to the real Binance 3. Hacker login using valid OTP within 30 sec Altcoins BTC VIA VIA BTC Withdraw (Failed) Compromised accounts Hacker’s accounts Phishing API Trading Reference: https://cryptobriefing.com/binance-suspends-withdrawals-after-possible-api-breach/ 11
  • 12. Case Study 3: Mining Pool Hack Slush Pool hack in March 2012 ● Early days of CPU/GPU mining era, Slush pool has a mining market share of 13% ● Slush Pool’s cloud infrastructure provider, Linode, got hacked ● According to Linode “an intruder accessed a web-based Linode customer service portal” ● Hackers compromised Slush Pool’s hot wallet that contained 3000+ BTC ● The Linode hack also affected the community, including: ○ Gavin Andersen, founder of Bitcoin Foundation ○ Bitcoinica, a  well known Bitcoin trading platform ● Total loss up to 46,703 BTC (0.5% of the world’s total BTC at the time of the hack) References: http://archive.is/tRQ9#selection-78.10-78.14 https://blog.trezor.io/how-trezor-was-born-from-a-hacking-attack-that-affected-slush-pool-7a538f03fd8f 12
  • 13. Case Study 4: Wallet Hack MyEtherWallet Hack in April 2018 ● MyEtherWallet is a popular online service for cryptocurrency transactions ○ An interface to interact with the blockchain ○ User upload private key in order to make a transaction ○ MyEtherWallet won’t hold user’s funds/private key ● Hackers hacked into the BGP router in the ISP ● Users were redirected by false DNS record to a fake website, and wallets got emptied AWS ISP Server Hacked BGP Router Fake site MyEtherWallet server in Russia DNS redirect to AWS Route 53 User 13
  • 14. Lessons Learned from Case 1-4 ● Blockchain is effectively decentralized, but the solutions built around blockchain is still centralized (also the infrastructure…) ○ Exchange ○ Mining pool ○ … ● Problems of centralization: Single Point of Failure ● Possible solutions: Decentralized Everything? 14
  • 15. Case Study 5: Protocol Hack BEC Overflow Vulnerability in April 2018 BEC is a ERC20 token written in Solidity ● Problematic function: batchTransfer ○ Send a fixed amount of token (_value) to an array of receivers (_receivers), the number of receivers in the array is (cnt) ● Maximum value for an uint256 parameter is 2^256-1 ● Hackers set _value=2^255, cnt=2, amount overflowed to be 0 ● require(_value > 0 && balances[msg.sender] >= amount) Always true! function batchTransfer(address[] _receivers, uint256 _value) public returns (bool) { uint cnt = _receivers.length; // Total number tokens withdrawn from the sender. uint256 amount = uint256(cnt) * _value; require(cnt > 0 && cnt <= 20); // Check if the sender can afford it. require(_value > 0 && balances[msg.sender] >= amount); // Withdraw the amount from sender. balances[msg.sender] = balances[msg.sender].sub(amount); for (uint i = 0; i < cnt; i++) { // Transfer _value to each of the receiver. balances[_receivers[i]] = balances[_receivers[i]].add(_value); Transfer(msg.sender, _receivers[i], _value); } // Succeeds or die. return true; } Result: ● Sender sent 0 token! ● Receiver each get 2^255 tokens! 15
  • 16. 16 Lessons learned from Case 5 ● Security is often the least concerned aspect for a startup (which is the reality but not the right thing to do in blockchain field) ● Smart contracts were often developed by developers without a security mindset ● Security frameworks for references ○ OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-solidity) ○ CryptoCurrency Security Standard (https://cryptoconsortium.org/standards/CCSS) ○ Smart Contract Best Practices (https://github.com/ConsenSys/smart-contract-best-practi ces) Reference: https://etherscan.io/token/0xc5d105e63711398af9bbff092d4b6769c82f793d?a=0xb4d30cac5124b46c2df0cf3e3e1be05f42119033