BGD. Aave Forest


TL;DR

Start the community discussion around the concept of an :evergreen_tree: :ghost: Aave Forest :ghost::evergreen_tree: : a monitoring and prevention framework to monitor and protect Aave against potential exploits.


Context

Public transparent blockchains and especially DeFi protocols, live in a highly adversarial environment, with malicious parties trying to exploit any type of vulnerability to get financial profit.

Additionally, the entry barrier for anybody to perform a good part of the exploits is really low: capital is usually not required in advance given the presence of flash loans, so it boils down to having the expertise to identify the exploit and how to execute it, including pre and post obfuscation.

Since its first version, Aave has been continuously improving all the security procedures, starting with the protocol design and implementation, and going through multiple other mechanisms like extensive testing (in isolation and simulations), independent security reviews, formal verification techniques, or bug bounty programs.

But in a system like Aave, involving external components as tokens or the networks themselves where the protocol lives, it is technically impossible to have 100% security assurance; it is a process of continuous improvement.

Lately, new types of technologies (or their application on DeFi systems) are starting to show results in the fields of live monitoring, so we think it is time for Aave to start moving and integrating them, coordinating them with a framework/architecture we call Aave Forest.


State-of-art in DeFi monitoring and exploit prevention

Real-time exploits monitoring and prevention is a well-known field in software security. The idea is relatively simple: it is usually possible to infer patterns from exploits and the pre-exploit behavior of the attacker by collecting, analyzing, and processing historic security incidents and their metadata. Afterward, the product of that analysis can be used to detect and/or prevent future incidents.

The amount of data required for these techniques to work (frequently based on techniques like machine learning) is considerable, so even months ago, all platforms trying to create this type of monitoring system for DeFi were not really mature, showing, for example, quite an important rate of false positives, or simply not having enough data to be able to detect meaningful attack patterns.

This has changed lately, with multiple teams showing evident results on the detection of real attacks on DeFi, that if properly integrated into the attacked systems, would have protected them sometimes totally, sometimes partially from loss of funds.




From BGD, we have been following the field and in contact with the teams behind these initiatives. And lately, their results are becoming impressive.

The following is an extract of some of those platforms and their capabilities/results:


Hypernative

https://www.hypernative.io/


Hexagate

https://www.hexagate.com/


Forta

https://forta.org/


Spotter (Pessimistic)

https://spotter.pessimistic.io/




Taking these results into account, from a high-level perspective, it is obvious that Aave needs to start exploring and integrating these tools if they give additional security assurance.


Aave Forest: a wrapper of technologies

Different from other projects from BGD, Aave Forest is more of a framework than an implementation and is powered by different existing native features of Aave, combined with external platforms.


A recap of the different components and actors on this proposed framework is the following:

  • Owls. External platforms to Aave, with DeFi monitoring technology able to detect exploit patterns potentially before they get executed. They are a non-invasive party, as a trustable entity able to notify the Aave community representatives (more later) of any potential incident.
  • Aave v3 roles. The core mechanism of Aave v3, allows granting granular permissions over all the protocol’s different risk/security levers, like changing listing new assets, changing risk parameters, freezing an asset, or even pausing a pool.
  • Rangers. Smart contracts or entities trusted by the community who have Aave v3 roles in executing certain protective actions over the protocol. For example, a Ranger could have held a role for being able to freeze an Aave reserve if an Owl would detected an upcoming exploit.

These 3 components connect to each other in a pretty simple way:

  • The Aave community gives v3 roles to Rangers to allow them to, for example, freeze or pause a pool.
  • Owls monitor Aave and everything around that could indicate an upcoming exploit.
  • Rangers receive “alerts” from Owls whenever there is any symptom of danger and execute whatever transactions they are programmed with to protect Aave.

But Aave puts important trust in the Owls and Rangers, no?

Systems like Aave and its permissions’ granularity are incredibly powerful in terms of trust management and decentralization for the following reasons:

  • Trust can be limited and isolated. An entity can be able to, let’s say, freeze a subset of listed assets, but technically incapable at the same time to affect anyhow else the system.
  • Actions can be purely protective in nature. For example, freezing disables new deposits and borrowings but keeps active repayments, withdrawals, and liquidations, so it is quite non-damaging for users. Even more, whenever an asset gets frozen, it can be unfrozen relatively fast (with some simple changes in the Aave v3 permissions).
  • The Aave decentralized governance is a super-admin of any type of sub-permissions. Any entity on which trust is deposited can get that trust removed at any time the Aave governance system decides to.

With these trust-minimization levers in place, the focus turns into a different perspective: can we maximize the protocol’s security by using the smart contracts mechanisms available?

In this case, the answer is quite clear: if there is any non-0 probability of preventing potential exploits on the protocol, it is certainly worth giving certain trust to expert entities (Owls/Rangers) to help with it.


What would a monitoring + protection flow look like?

Let’s assume an attack with the following characteristics:

  • Targeting Aave v3 Ethereum.
  • Based on some 0-day on the logic, allowing for artificial inflation of the value of a position’s collateral, and borrowing of all available liquidity, but only possible in “chunks” of ~$1m each transaction.
  • Requiring only a big flash loan from Aave v2.

A potential flow without any protection could be the following:

  1. The attacker deploys a smart contract that will be used to perform the attack.
  2. Immediately after (or even on the same transaction), he triggers the exploit by calling a function on the contract deployed on 1).
  3. Repeat 2) until there is no available liquidity on Aave.

With protection, and even if it would depend quite a lot on the tooling and specifics of the attack, the flow could look:

  1. The attacker deploys a smart contract that will be used to perform the attack.
  2. An Aave Owl detects from the mempool of Ethereum the contract prepared to start the execution of an attack.
  3. An Aave Ranger holding freezing permissions calls freezeReserve() on all assets of the pool.
  4. As borrowing is disabled, the attack will revert.

But will Owls and Rangers be fast enough?

With the techniques of attackers getting more sophisticated every day, this is not easy to answer, but as commented before, analysis of past events shows the following:

  • Attacks tend to be less sophisticated than they could be.
  • It is quite easy to leave “traces” before an attack happens.
  • Monitoring technology is faster than exploit execution.

So again, even if not possible at the moment to have 100% protection given the open nature of the blockchain infrastructure, results show that at least partial protection is possible, which is still a net positive outcome.


So, who will be the Aave Owls and Rangers?

From BGD we have been following the ecosystem of monitoring and protection during the last months, and new participants continuously appear.

If the community believes this system is worth pursuing, we will evaluate more in deep different solutions in the market, obviously prioritizing speed of integration with those that showed historic accuracy.

It is still an open topic (but possible) if Aave Owls should be Rangers at the same time. But we think that as an initial step, it could be the most optimal outcome if a single platform could provide monitoring and execution, with maximum reliability.

Even if that is not the case, even the sole integration of official Owls into Aave DAO procedures could give important benefits and assurances.


Next steps

This is an early project/framework, but quite aligned in connecting Aave with other initiatives like the Risk Stewards. So, first of all, we would like to get feedback from the community regarding this direction.

If there is a positive reaction, we propose the following next steps:

  • We will start doing deeper research on all potential candidates for Owls/Rangers. Given that we are continuously looking into ways of improving the security of Aave, we have already done some initial research about different entities, like the ones presented before in this post.
    But we encourage any alternatives/candidates to both comment on this post (preferably without entering into contests with others) and contact us on Twitter or hi@bgdlabs.com, to check out the platforms.
  • Define grants model for external entities. The Aave DAO already runs a successful grants program which usually is the initial step for new contributors. As Owls/Rangers will most probably be a similar case, propose a standardized grants system for their service, being through the Aave Grants DAO or apart.
  • Once we define additional technical specifications, Snapshot votes to approve the initial sets of Owls and Rangers, together with the initial Aave v3 roles to give to Rangers if applicable. BGD will propose this initial set, taking into account both the underlying infrastructure and how well it fits into the protocol’s requirements and limitations.
  • On-chain proposal for granting roles to Rangers.
18 Likes

Hello! Several examples of spotter.pessimistic.io!

  1. Case No.1, Details

  2. Case No.2, Details

Agree. This proposal is needed.

3 Likes

This is a really cool and important initiative, we would definitely be in support of moving forward with this idea and think it is a nice complement to the Safety Module.

Even if there were false positives, the non-invasive nature of freezing a pool shouldn’t affect UX too much especially if it can be undone relatively quickly.

Do you expect that the DAO would have to pay for ongoing monitoring services past the initial DAO grant for the setup?

3 Likes

As co-founder of Hypernative, I totally agree for the need to have real time security as a complementary offering to Audit.
Our extensive research of most of the hacks and exploits in the last few years and checking them on our system showed around 95% or more could have been prevented with an early detection system like Hypernative.

Two critical metrics when evaluating any solution:

  1. How proactively and early the solution can warn about a hack/exploit
  2. How accurately (close to zero false positive) you can do (1), because especially for a protocol like AAVE, its critical not to warn falsley (And not to just flag “anomalous market conditions” as opposed to specifically flagging hacks and exploits)

I think we have really optimized these two Metrics in Hypernative and would love to share that with the community and anyone interested to learn more and get more details/documentation, feel free to email me to: gal@hypernative.io

Fyi, another detection we helped and alerted the Hundred Finance team on Discord and could have been prevented if they were a user: ($7M was stolen)

Hey all, Yaniv (the CEO) of Hexagate here :slight_smile:

First, we are very happy for this proposal as we view real-time monitoring as an absolute necessity in the domain, as this can either stop an attack from happening (alongside proper incident-response processes in place), or at least save most of the funds once an exploit is on the go.
We would be very much interested in showing anyone interested and also scheduling a community call to demonstrate how Hexagate works and normally fits to our customers’ workflows both in terms of detecting exploits in real-time and upfront (before anything ever happens to the protocol) but also from in terms of building the relevant incident response processes per each alert, so please feel to email me at yaniv@hexagate.com to hear more about it.

We believe that protocols need to have a comprehensive cyber security program comprising app-sec, auditing, real-time monitoring, security operations personnel and processes, incident response processes, forensics, etc. We built a suite of tools in our platform that covers real-time monitoring and incident response processes - both automated workflows and analysis tools. We optimize on early and real-time detection of on-chain anomalies and threats with best-in-class accuracy, allowing us to prevent attacks before they happen.

The definition of Owls, Aave V3 roles and Rangers is very important, and we think that Rangers should also be able to run automated or semi-automated triaging and forensics. We’d love to share more and discuss the topic openly.

Our team at Hexagate is comprised of top-notch security researchers with extensive security research backgrounds across many verticals (as a side note, we published two vulnerability pieces of research we have done previously, a consensus bypass on the Polygon PoS bridge https://medium.com/immunefi/polygon-consensus-bypass-bugfix-review-7076ce5047fe and an authentication bypass on an old ledger device - https://donjon.ledger.com/lsb/017/).

We constantly update our Twitter account with threats we detect, you are welcome to follow us and discuss with us there as well - https://twitter.com/Hexagate_

Hi everyone! Alex from Pessimistic Spotter here :)

I will write down some info about how Spotter works, how we currently work on optimizing Spotter for Aave, and some thoughts on how we could contribute to a synergy between Rangers and Owls.

Our approach

Spotter is a proactive monitoring system that is focused on complex hacks prevention.
Internally, Spotter analyzes all new contracts to see if they attack protected protocols. It identifies the attack targets and fires alerts. Mempool monitoring allows Spotter to finish contract analysis before it is included into the blockchain.

This approach enables early warnings for most types of hacks since Spotter can identify an attack against a particular contract before the hacker finalizes their preparations. According to our benchmark tests, this provides extra reaction time and combats even fast-paced attacks with minimal delay before the exploit.

Our focus on Aave

During development, we’ve used Aave as a model project. We selected it due to its size, complexity, and importance to the ecosystem. Thanks to this decision, we know exactly how Spotter performs for Aave.

For example, we regularly run benchmarks to estimate false positive rates for various popular contracts. A dedicated Aave variant of the same benchmark shows no false alerts over their 317 smart contracts on Ethereum mainnet.

We will be happy to share the results of the tests with BGD team and everyone interested. Contact us on hello@pessimistic.io

Furthermore, we have already built a PoC DApp that helps individual Aave Suppliers to secure their deposits using the same exploit prediction technology. Please join the waitlist if you are interested: https://spotter.pessimistic.io/

Rangers and Owls synergy

Additionally, Spotter helps developers mitigate prevented attacks. After Rangers pause the protocol, the team has to dissect the exploit and identify potential vulnerabilities in Aave smart contracts. Spotter can present detailed bytecode analysis and exploit internals in a digestible format. These insights save time and speed up protocol recovery.

Appendix

Some more recent hacks that we predicted.

Agree!
Looking forward to adding value into this

Hey Aave Enthusiasts! :tada:

We at d23e.ch are absolutely stoked to see Aave blazing the trail in defense-in-depth security practices. It’s a blast meeting other like-minded teams, all on a mission to fortify the DeFi space! The more owls we have, the safer Aave’s nest will be. :owl:

Our rockin’ collaborative solution offers:

  1. Lightning-Fast Monitoring, Warning & Reaction: Already jamming in production at SwissBorg, our system has detected dozens of attacks within milliseconds (check out the attached figure from our imitation paper)!
  2. Generalized Front-Runner: It’s like the ultimate cover band for attacks, reducing false positives to near zilch. :guitar:
  3. Research Powerhouse: We’ve been cranking out decades of research on blockchain security, showing off our mad skills and dedication. Some chart-topping publications include:

Showdown

To truly showcase our ensemble’s prowess, we propose an open-mic night of sorts - an open and transparent competition among monitoring teams. Let’s see who can detect and react to potential threats with the quickest tempo and slickest moves! :microphone:

We can’t wait to jam with the Aave community on this epic security gig. If you’re keen to learn more about our solution or have any burning questions, hit us up at arthur [at] d23e.ch. :e-mail:

Together, we’ll riff on the Aave Forest framework and crank up the security for the Aave protocol and its users! :notes:

Rock on! :metal:

Just adding a little bit more concrete technical information. We prepared two presentations covering our research on the speed of hacks, and our backtests of the false positives rate on Aave contracts:

Given the community’s objective to find solutions to manage protocol risks proactively and security being a top priority for the Aave DAO, the Aave Forest is a logical next step in developing the protocol’s lines of defence.

With Owls (DeFi Monitoring Technology Providers) providing monitoring and Rangers (Smart contracts or entities trusted by the community who have Aave V3 roles in executing certain protective actions over the protocol) reacting to said alerts, the ecosystem could become incredibly effective at not just responding to issues but preventing them.

We look forward to seeing this discussion progress with the community identifying suitable Owls and discussing which V3 roles could be granted to Rangers to act with speed, agility and impact.

1 Like

Hello, Aave community! I’m Ziv, the Marketing Lead of Cyvers. We’re excited to offer our AI-driven threat intelligence platform to enhance Aave’s security infrastructure as an Owl/Ranger.

Key Offerings:

  1. Advanced real-time monitoring & proactive threat detection with near-zero false positives.
  2. Comprehensive incident response from our experienced blockchain security experts.
  3. Continuous improvement & adaptability, ensuring cutting-edge protection for Aave.

Our team has successfully protected numerous DeFi projects from breaches and exploits. We’re committed to helping Aave build a safer environment for everyone.

Learn more on our website.

Stay updated on our findings and research on Twitter: https://twitter.com/Cyvers_

For more info or to schedule a demo, contact our CEO at deddy@cyvers.ai. Let’s make the DeFi space stronger and more resilient together!

1 Like

Happy to share with you all that I received my “Basic” Badge! :smiley:

So now I can safely and happily share a bit more info and a few more links here, to exemplify the recent hacks detected by Cyvers:

By becoming your dedicated Owl, we can detect and alert the Aave community of any potential threats or suspicious activities before they lead to financial loss.

As Rangers, we have the technical expertise and proven track record to swiftly respond to alerts and execute protective actions to mitigate risks. Our team of experienced blockchain security experts will work closely with the Aave community to ensure the highest level of security for the protocol.

Here are some examples:

Cyvers 2023 Web3 Security Report: CyVers 》Proactive Web3 Security on LinkedIn: Cyvers 2023 Web3 Security Report

Thanks for considering us as your partners for a safer Web3!

1 Like

Hello, BGD. Aave Forest Team,

I’m Meir, the co-founder of Cyvers.

We are excited to submit our proposal to be part of Aave’s initiative to enhance its security infrastructure by incorporating real-time security measures. We believe Cyvers is the perfect fit as an Owl/Ranger for Aave.

Our advanced AI-driven threat intelligence platform is designed to monitor and protect DeFi protocols in real-time, providing unparalleled insights into potential attack vectors and exploits.

By becoming your dedicated Owl, we can detect and alert the Aave community of potential threats or suspicious activities before they lead to financial loss.

As Rangers, we have the technical expertise and proven track record to swiftly respond to alerts and execute protective actions to mitigate risks.

Our team of experienced blockchain security experts will work closely with the Aave community to ensure the highest level of security for the protocol .

Our Unique Offerings:

  • Advanced Real-Time Monitoring & Proactive Threat Detection : Our state-of-the-art real-time monitoring system, powered by ML and advanced algorithms, continuously scans the blockchain & analyzes new smart contracts for potential threats.
    This allows us to identify potential hacks and exploits early, giving Aave ample time to respond and prevent any loss of funds or damage to the protocol.
  • Near-Zero False Positives : We understand the importance of accurate alerts, and that’s why our system is designed to minimize false positives. Our tailored alert system ensures that you receive relevant & trustworthy information.
  • Comprehensive Incident Response & Expert Support : Our team of experienced security experts is prepared to assist in building and executing effective incident response plans tailored to each alert, mitigating potential damage, and protecting Aave’s users and assets.

We have also been actively sharing our findings and research, showcasing our expertise in the field. You can follow our updates on Twitter: https://twitter.com/Cyvers_

This is a valuable security initiative from BGD Labs.

With the volume that the Aave Protocol commands, the stakes are quite high in the vent of an exploit. I look forward to contributing to discussions around how this program will be managed and how Owls and Rangers will be organized and compensated.