AuditHub: Continuous Security for Web3 Teams

DeFiConnect Workshops Buenos Aires 2025 · 19 Nov 2025 · 20:02

Kostas Ferles, CTO of Veridise, presents AuditHub, a platform that brings smart contract and ZK security into everyday development instead of leaving it to a late, outsourced audit. He argues that losses from audited code, out-of-scope libraries and post-audit changes show why checks must run continuously. He walks through four formal-methods tools (Picus, ZK Vanguard, DeFi Vanguard, Orca), CI/CD integration, RISC Zero and Succinct case studies, and how a custom detector plus a specification-guided fuzzer could have caught the Resupply rounding bug.

Speakers

Topics

From DeFiConnect Workshops Buenos Aires 2025, hosted by Stable Summit.

Transcript

Hello. Uh I'm Kostas. I'm the CTO at Verise. Uh and I'm here today to talk to you about uh AuditHub, which is a platform we recently uh released uh and uh helps uh development teams evolve the security uh as they uh develop. uh but before uh I start into uh describing audit hub I want to describe why we built uh audit hub from the get-go and this is uh due to the current security practices uh that happen in most uh web3 companies and generally speaking like you know whenever a company tries to build a product they go through these phases of uh planning and uh deployment

uh they start by kind of like you know planning what they want to do they are developed like they test and then once they kind of like ready to release they go through an auditing process and like you know once they get the go uh they get go over there uh they deploy and then they continue uh however when we see where security happens in this whole um uh timeline we see little to no security at the beginning of uh uh of the first three phases and Most of the security happens towards phases four and five. Uh and not only this is very late, it also being

outsourced to uh some external security companies that they don't know the um the application as well and um they don't have as much time to kind of like you know make sure that the application is secure. Um so why this is problematic? So first of all in an industry where we kind of like champion trustlessness we end up um putting the trust of our protocols in a handful of people uh that they have very limited time to find like all the bugs in our um in our system and secondly the results

uh talk for themselves. So if we go and see for example uh statistics from like last year we have seen a significant amount of uh funds being lost due to smart contracts exploits and this happens due uh despite of like things being thoroughly audited by auditing firms. So for example, a third of these funds were actually exploits from uh auditing contracts and that amounts to almost 110 millions.

Um and to make matter worse, uh critical code is often excluded from audits which is like you know really bad and um that has caused like even in this year a single case where more than 200 millions were lost due to an out of scope uh math library. And uh secondly uh a lot of uh uh in a lot of cases development teams do get an audit then they do some modifications on their code and then they deploy which this is also problematic because as you can see $80 million like last year were uh due to out of uh um due to modifications uh after an audit.

And then if we look at the space SDK, things not look like great there either. Uh more than half of the projects contain at least one critical uh issue and D5 projects are twice as likely uh to have uh a critical vulnerability uh sorry ZK projects are twice as likely uh to have a vulnerability than a DI project. So uh the question we asked at uh Veridice is how do we uh fix this?

And as we mentioned as I mentioned earlier, we created this platform called audit hub that gives uh development teams the ability to own ownership of their security uh as uh they develop. So let's see how now development teams can go off about uh working with auditab as they develop. So looking the timeline I saw earlier audit hub can be your security companion in all of the phases I mentioned. So even when you start planning and you have some initial uh code if audihub supports your test tech

stack uh odihub can run out of the box on your code base and catch common vulnerabilities in the stack that you are using. So for example if you're using solidity we can find bugs that are common in solidity. Then as you continue to develop, test and audit your codebase, uh, AuditHub can, uh, be refined and all of our tools can be customized to your protocol. So they can help you find vulnerabilities that are specific to your uh, to your project. So for example, if your project wants to enforce an invariant that like method fu is always called before method par, our tools can customize uh can be

customized for your protocol and then uh scans can run uh as you develop and then you ensure that this invariant holds throughout your uh development. And finally uh if you're a defi project and you go and deploy on mainet uh we have tools that can monitor uh the transactions continuously and proactively look for bugs before they actually happen. All right. So now that we see that we have kind of like a new way of uh enforcing security as we develop uh let's see what comes with auditub. So audit hub currently has uh four uh

tools. Two zk tools and two smart contract tools. Uh for zk we have pyus which [clears throat] a verifier uh that checks for under constraint circuits and zk vanguard which is a a static analyzer for zk uh for zk circuits. Both of them work for multiple uh languages and we continue expanding support for new frameworks. And we have two uh smart contract tools D5 Vanguard and Orca uh which are being used to catch uh D5 Vanguard is static analyzer which cuts cut catches common vulnerabilities and can also be customized for your protocol and ORCA is a specification

guided fuzzer which systematically uh checks your code against specifications and it is worth mentioning here that all of these tools are based on a branch of academia called formal methods. So all of these tools come with guarantees. So if for example uh define var tells you that you know your codebase does not contain a certain buggy pattern like that means your codebase does not have that pattern or if pyus tells you that your uh circuits are verified um you know you can take that as a stamp of approval.

uh and let's see now how these tools can be used uh in all of these uh ways that I mentioned earlier. So uh all of our tools are kind of like uh have this black and play security solution. Uh for example, Vanguard has built-in detectors to catch vulnerabilities um in smart contracts. Same ZK Vanguard has common vulnerability detection for uh ZK circuits. Uh Oraca has a specification library that has a common uh invariants that uh need to hold in famous uh and popular um um um contracts like ERC20 and things

like that. and pyoso by default checks uh for nondeterministic uh circuits and uh even in that case you know we can see that we can avoid a lot of hacks and kind of like prevent uh uh losses that are by default preventable and as I mentioned earlier each of these tools can be customized for your uh for your protocol specifically ZK Vanguard and D5 Vanguard allows you to define custom detectors to catch buggy patterns that are specific to your protocol. Uh whereas Orcas lets you to write uh uh that like need to hold for your

protocol and text them against random tests. And finally, Pyus can be used to verify uh properties for your circuits. For example, you want to say my addition circuit always performs like addition uh and things like that. All of these are encodable and like the tools can pick up and do uh security checks and in addition to all of that audit hub can be integrated uh to your uh uh to your GitHub workflow. you can have like CI/CD and uh if at any time you need uh expert support, our engineers are there to uh help you set up security checks uh and give you advice and uh

help you uh set up the tools and deal with any problems. So let's see now how it does in action and how it's being used by actual development teams to essentially prevent bugs uh being deployed. So the first uh test case uh that we have is risk zero who initially approached us for an audit for their uh risk 5 uh circuits to be audited and we proposed to kind of like you know extend our tool pers to support their language so we can kind of like you know programmatically prove that their secrets uh were correct. Uh once we did that

uh BUS was kind of like the more performant auditor at that audit because it found uh nine non-terministic uh circuits uh the majority of which were critical or high uh and pyus was very fast to run. It took like you know few seconds to some minutes to verify most of the circuits and we also run uh Pyus after uh the fixes were provided by uh the uh the development team and Pyus was able to verify them afterwards.

And after that uh the success story here is that risk zero integrated uh integrated pyus uh into their CI/CD and they continue checking their circuits as they were development developing and they actually found baggage circuits on their own without our help and we have a case studied here where you can see the the blog post. So a similar success story is uh that of succinct where they approach us to uh do kind of like a similar exercise try to incorporate pyus into their uh into their development process. Uh during the integration our team uncovered uh three

non-trivial bugs that were kind of like surprising to the the team. Um and after we integrated pyus the succinct team similarly dur zero started using uh pyus on their own and um the while they integrated pus into theird they also found bugs on their own. Um like just to mention here all of these things happened during development like none of these uh code was actually like you know uh deployed or uh uh audited and uh similar to risk zero we have a blog post here you can uh you can check so let's see how now uh we could kind of

like you know use uh ora sorry how we can use audihub uh in a more kind of like you realistic scenario uh and see how a recent uh DeFi hack could have prevented if like you know the development team was using um audihub during the development cycle and it's going to be a purely DeFi example. So earlier this year there was this uh resupply onchain hack. Uh resupply is a onchain lending protocol and due to a rounding error they lost uh around 10 millions.

So the root cause here is very simple. I'm I'm going to give you a little bit of the code of what happened and then I'm going to show you how we can customize our tools to cut uh these type of bugs. So the root cause comes from this division where like this oracle return life price that made the result of this division to become uh zero. And once this became zero uh then uh this value uh flow flew into uh this e solvent uh function uh which make the uh LTV become zero and once the LTV becomes zero then a client a user of the uh of the protocol is always uh solvent.

So what makes this bug actually hard to catch are two things. The first thing is this division uh here flows to a storage variable. So you do the first division, you store the exchange rate into uh a storage variable and then that one is being read afterwards uh to kind of like find the um uh this one is being read afterwards and being used to call a solvent.

So for example uh here um a static analyzer like slither that checks for divisions before multiplications wouldn't cast this bug because first of all there is the storage in between and second of all uh these two statements belong in two different uh functions. Uh so it's kind of like an interprocedural uh bug. So let's see how our tools can could have been used to find these type of bugs. So as I mentioned D5 Vanguard has uh the possibility to be customized for uh your protocol and check specific uh things. One of the things that we kind

of like usually run in all code bases is to kind of like you know uh check for this interprocedural divide before multiplications uh in general. And uh the way u uh D5 Vanguard allows you to do that is it provides a DSL that you can write patterns to to to specify uh things that you want to check in your codebase. Uh you don't have to uh understand like the nitty-gritty of this uh query. Uh so on a high level it says you have to find all the divisions uh that write to storage and then uh you need to find all the multiplications uh that reach from

storage and then all the thing you need to do is kind of like you know filter only these ones that uh kind of like touch the same variable. So this is kind of like a general detector but like if you have some security critical storage variables like the protocol we saw earlier the resupply finance uh you can further customize it and say you know also uh focus your attention to like you know only the exchange rate or other security critical uh storage variables in your contracts.

So if you run this uh this custom detector on the resupply finance uh Vanguard is going to flag this kind of like you know dangerous pattern that you have like a defy before multi a divide before multiply uh through variable exchange rate info which is the uh the ST that source the exchange rate and he's also going to mark where the uh division happens which is this uh function. and where the multiplication happens which is this other function.

So if you have ever used uh though a static analyzer before the fact that uh it flag that issue it doesn't necessarily mean that it's an actual bug. It might be the case that uh the bug exists but it's not exploitable. So uh here where our fuzzer orca which is a guided uh a specification guided um fuzzer uh can pick up and uh help to see if uh you know this can actually be exploited.

And the way Orca works is it gets a specification that describes what is the correct uh behavior of the system uh and then takes that specification and uh runs uh through the uh runs uh the protocol with random inputs and tries to see if the protocol ever violates this specification. So here this is a uh a specification that sec encodes the solveny check uh for uh the resupply protocol. Uh it's in this uh declarative languages we have that is called v. uh you don't have to understand like many things here but

like what this uh specification says is that you can never finish uh function uh borrow in a state where a user is not solvent and you can do that uh you can do the same exact check in other relevant functions uh apart from uh apart from borrow so if you get this specification and the code base uh to orca it's going to run and after a few uh minutes. It's going to render you a counter example that shows you that if you call uh this sequence of functions with these provided values, uh it's going to end up in a state where uh a user is able to

borrow in a state that is not uh solvent. All right. Uh that's all I had uh for you today. Uh we have recently released uh audit hub. Um if you are interested uh you can access it uh here. You can access the form here to um book an early demo uh and see if you uh want to use our tools to find bugs as you develop. And uh if you want more information about uh our company and our platform, you can uh find us here. All right. Thank you.

Related talks