{"id":49416950,"url":"https://github.com/singularity0x00/dvdefi_exploits","last_synced_at":"2026-04-29T03:11:40.381Z","repository":{"id":249910298,"uuid":"832928674","full_name":"Singularity0x00/DVDEFI_exploits","owner":"Singularity0x00","description":"Solving Damn Vulnerable Defi Challenges","archived":false,"fork":false,"pushed_at":"2024-10-19T16:37:26.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T17:25:08.024Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Singularity0x00.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-07-24T02:46:44.000Z","updated_at":"2024-10-19T16:37:29.000Z","dependencies_parsed_at":"2025-04-12T17:25:14.887Z","dependency_job_id":"115c39e5-3ad5-4f0a-9a69-bf7eda09c7b6","html_url":"https://github.com/Singularity0x00/DVDEFI_exploits","commit_stats":null,"previous_names":["hrideshg88/dvdefi_exploits","singularity0x00/dvdefi_exploits"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Singularity0x00/DVDEFI_exploits","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Singularity0x00%2FDVDEFI_exploits","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Singularity0x00%2FDVDEFI_exploits/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Singularity0x00%2FDVDEFI_exploits/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Singularity0x00%2FDVDEFI_exploits/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Singularity0x00","download_url":"https://codeload.github.com/Singularity0x00/DVDEFI_exploits/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Singularity0x00%2FDVDEFI_exploits/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32408569,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T02:37:21.628Z","status":"ssl_error","status_checked_at":"2026-04-29T02:36:50.947Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-29T03:11:23.881Z","updated_at":"2026-04-29T03:11:40.367Z","avatar_url":"https://github.com/Singularity0x00.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Damn Vulnerable DEFI Solutions\n\n# Side_Entrance\n\n\u003e `flashloan()` function only checks that balance after loan is same as balance before.\n\nFunction `deposit()` updates the mapping and associates the amount deposited with the exploit address, This behaviour can be exploited such that we can take entire balance of lenderpool as flashloan from the `flashloan()` function and use the deposit function to repay the loan Contract now thinks it's entire balance is associated to exploit contract's address. and thus can be withdrawn via exploit contract.\n\n# Unstoppable\n\ntransfer any amount of tokens to vault contract. This should break `convertToShares(totalSupply) != balanceBefore)` check and break the flash loan functionality.\n\n# Truster\n\n`flashloan()` function executes an unsafe external call `target.functioncall(data)` where address (`target`) and data (`data`) are directly controlled by an attacker basically giving you complete ownership for that one call. This can simply be exploited by calling token contract and approving attack contract for all the funds then simply tranfer them to recovery.\n\n\n# Selfie\n\nIt's called `emergencyExit` but you gotta wait 2 days? how stupid is that?!\n\nThe protocol uses `ERC20votes` to calculate voting power.\n`SimpleGovernance::_hasEnoughVotes()` function is used to check whether a contract can set up an action in `queueAction()` function. However, `_hasEnoughVotes()` can be bypassed if we are able to get enough tokens, This is where pools flashloan function can be leveraged.\n\nStep 1: Get a flashloan of all tokens in pool for exploit contract.\n\u003cbr\u003eStep 2: use token's `delegate()` function to get voting power. **1:1 votes to tokens ratio**\n\u003cbr\u003eStep 3: Call `SimpleGovernance::queueAction()` function to set up an actions which calls `SelfiePool::emergencyExit()` function to recovery address, And return flashloan.\n\u003cbr\u003eStep 4: warp 2 days and call `SimpleGovernance::executeAction()`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsingularity0x00%2Fdvdefi_exploits","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsingularity0x00%2Fdvdefi_exploits","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsingularity0x00%2Fdvdefi_exploits/lists"}