Skip to main content
Cornell University
We gratefully acknowledge support from the Simons Foundation, member institutions, and all contributors. Donate
arxiv logo > cs > arXiv:2206.10708

Help | Advanced Search

arXiv logo
Cornell University Logo

quick links

  • Login
  • Help Pages
  • About

Computer Science > Programming Languages

arXiv:2206.10708 (cs)
[Submitted on 21 Jun 2022 (v1), last revised 12 Jan 2024 (this version, v3)]

Title:FlashSyn: Flash Loan Attack Synthesis via Counter Example Driven Approximation

Authors:Zhiyang Chen, Sidi Mohamed Beillahi, Fan Long
View a PDF of the paper titled FlashSyn: Flash Loan Attack Synthesis via Counter Example Driven Approximation, by Zhiyang Chen and 2 other authors
View PDF HTML (experimental)
Abstract:In decentralized finance (DeFi), lenders can offer flash loans to borrowers, i.e., loans that are only valid within a blockchain transaction and must be repaid with fees by the end of that transaction. Unlike normal loans, flash loans allow borrowers to borrow large assets without upfront collaterals deposits. Malicious adversaries use flash loans to gather large assets to exploit vulnerable DeFi protocols. In this paper, we introduce a new framework for automated synthesis of adversarial transactions that exploit DeFi protocols using flash loans. To bypass the complexity of a DeFi protocol, we propose a new technique to approximate the DeFi protocol functional behaviors using numerical methods (polynomial linear regression and nearest-neighbor interpolation). We then construct an optimization query using the approximated functions of the DeFi protocol to find an adversarial attack constituted of a sequence of functions invocations with optimal parameters that gives the maximum profit. To improve the accuracy of the approximation, we propose a novel counterexample driven approximation refinement technique. We implement our framework in a tool named FlashSyn. We evaluate FlashSyn on 16 DeFi protocols that were victims to flash loan attacks and 2 DeFi protocols from Damn Vulnerable DeFi challenges. FlashSyn automatically synthesizes an adversarial attack for 16 of the 18 benchmarks. Among the 16 successful cases, FlashSyn identifies attack vectors yielding higher profits than those employed by historical hackers in 3 cases, and also discovers multiple distinct attack vectors in 10 cases, demonstrating its effectiveness in finding possible flash loan attacks.
Comments: 29 pages, 8 figures, conference paper extended version
Subjects: Programming Languages (cs.PL); Software Engineering (cs.SE)
Cite as: arXiv:2206.10708 [cs.PL]
  (or arXiv:2206.10708v3 [cs.PL] for this version)
  https://doi.org/10.48550/arXiv.2206.10708
arXiv-issued DOI via DataCite
Related DOI: https://doi.org/10.1145/3597503.3639190
DOI(s) linking to related resources

Submission history

From: Zhiyang Chen [view email]
[v1] Tue, 21 Jun 2022 19:56:54 UTC (523 KB)
[v2] Tue, 26 Jul 2022 20:52:53 UTC (1,099 KB)
[v3] Fri, 12 Jan 2024 12:35:35 UTC (2,114 KB)
Full-text links:

Access Paper:

    View a PDF of the paper titled FlashSyn: Flash Loan Attack Synthesis via Counter Example Driven Approximation, by Zhiyang Chen and 2 other authors
  • View PDF
  • HTML (experimental)
  • TeX Source
  • Other Formats
license icon view license
Current browse context:
cs.PL
< prev   |   next >
new | recent | 2022-06
Change to browse by:
cs
cs.SE

References & Citations

  • NASA ADS
  • Google Scholar
  • Semantic Scholar
a export BibTeX citation Loading...

BibTeX formatted citation

×
Data provided by:

Bookmark

BibSonomy logo Reddit logo

Bibliographic and Citation Tools

Bibliographic Explorer (What is the Explorer?)
Connected Papers (What is Connected Papers?)
Litmaps (What is Litmaps?)
scite Smart Citations (What are Smart Citations?)

Code, Data and Media Associated with this Article

alphaXiv (What is alphaXiv?)
CatalyzeX Code Finder for Papers (What is CatalyzeX?)
DagsHub (What is DagsHub?)
Gotit.pub (What is GotitPub?)
Hugging Face (What is Huggingface?)
Papers with Code (What is Papers with Code?)
ScienceCast (What is ScienceCast?)

Demos

Replicate (What is Replicate?)
Hugging Face Spaces (What is Spaces?)
TXYZ.AI (What is TXYZ.AI?)

Recommenders and Search Tools

Influence Flower (What are Influence Flowers?)
CORE Recommender (What is CORE?)
  • Author
  • Venue
  • Institution
  • Topic

arXivLabs: experimental projects with community collaborators

arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.

Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.

Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs.

Which authors of this paper are endorsers? | Disable MathJax (What is MathJax?)
  • About
  • Help
  • contact arXivClick here to contact arXiv Contact
  • subscribe to arXiv mailingsClick here to subscribe Subscribe
  • Copyright
  • Privacy Policy
  • Web Accessibility Assistance
  • arXiv Operational Status
    Get status notifications via email or slack