# Bug Bounty Program
## Project Overview
[DeGate](https://degate.com) is a decentralized orderbook exchange (DEX) built on the Ethereum blockchain that utilizes zero-knowledge technology. DeGate DEX offers spot market trading with limit orders and also offers a grid trading function.
DeGate operates as a decentralized autonomous organization (DAO). The DEX platform is focused on being user-friendly and is built on the principle of Trustlessness, or ‘Can’t do evil’, with no admin key. With DeGate's unique Efficient Gas Saving technology, users can expect super-low gas fees while using a decentralized protocol. Another critical component of DeGate is the Permissionless Listing feature which enables any token to be listed in a permissionless manner on DeGate's orderbook DEX.
For more information about DeGate, please visit [https://docs.degate.com/](https://docs.degate.com/).
DeGate Testnet is currently live on https://testnet.degate.com/, and more details can be found in the product documentation (https://docs.degate.com/v/product_en/overview)
This bug bounty program is mainly focused on the smart contracts, circuits and webapp(Interface/API/SDK) of DeGate orderbook. This program will be a open for a to be determined time period including after the launch of Mainnet.
The bounty environment has been deployed on Public Testnet, whose code was open sourced on [Github](https://github.com/degatedev/protocols/tree/degate1.0.0) , along with the [Protocol Specification Docs](https://github.com/degatedev/protocols/blob/degate1.0.0/DeGate%20Protocol%20Specification%20Document.md), [Circuit Design Docs](https://github.com/degatedev/protocols/blob/degate1.0.0/Circuit%20Design.md) and [Smart Contract Design Docs](https://github.com/degatedev/protocols/blob/degate1.0.0/Smart%20Contract%20Design.md).
## Rewards by Threat Level
Rewards are distributed according to the impact of the vulnerability based on the [Immunefi Vulnerability Severity Classification System V2.2](https://immunefi.com/immunefi-vulnerability-severity-classification-system-v2-2/). This is a simplified 5-level scale, with separate scales for websites/apps, smart contracts, and blockchains/DLTs, focusing on the impact of the vulnerability reported.
In particular, the security of DeGate comes from the interaction between the circuit and the smart contract, so the threat level caused by the circuit is applicable to the same threat level of the smart contract.
All webapp bug reports must come with a Proof of Concept (PoC) describing a High Impact potential End Effect of an Asset-in-scope (full description below) in order to be considered for a reward.
For Smart contracts and Circuits bug reports, all bug reports must come with a PoC with an end-effect impacting an asset-in-scope in order to be considered for a reward. Explanations and statements are not accepted as PoC and code is required. Bug reports are required to include a runnable PoC in order to prove impact. Exceptions may be made in cases where the vulnerability is objectively evident from simply mentioning the vulnerability and where it exists. However, the bug reporter may be required to provide a PoC at any point in time.
Bug reports from compensated team members of any DeGate Dao will not be eligible for a reward. Employees and team members of third-party suppliers to DeGate Dao that operate in a technical capacity and have assets covered in this bug bounty program will also not be eligible for a reward.
Bug reports covering previously-discovered bugs are not eligible for the program. If a bug report covers a known issue, it may be rejected together with proof of the issue being known before escalation of the bug report. Previous audits of DeGate Dao can be found at:
-Secbit Audit Report
https://github.com/degatedev/protocols/blob/degate_mainnet/packages/loopring_v3/security_audit/DeGate_Report_EN-final2023.pdf
### Smart Contact
Critical fix to USD $1,110,000
High fix USD $100,000
Medium fix USD $5,000
Low fix USD $1,000
### Websites and Applications (PoC Required)
Critical fix to USD $100,000
High fix to USD $5,000
Medium fix to USD $2,500
Low Up fix to USD $500
Informational fix to USD $100
## Assets in scope
https://github.com/degatedev/protocols/blob/degate1.0.0/DeGate%20Protocol%20Specification%20Document.md
https://github.com/degatedev/protocols/blob/degate1.0.0/Smart%20Contract%20Design.md
https://github.com/degatedev/protocols/blob/degate1.0.0/Circuit%20Design.md
### Smart Contact
contracts/core/iface/ExchangeData.sol Exchange Data, Exchange
contracts/core/iface/IBlockVerifier.sol BlockVerifier interface
contracts/core/iface/IDepositContract.sol DepositContract interface
contracts/core/iface/IExchangeV3.sol ExchangeV3 interface
contracts/core/iface/ILoopringV3.sol LoopringV3 interface
contracts/core/impl/libexchange Exchange library contracts
contracts/core/impl/libtransactions Transaction library contracts
contracts/core/impl/BlockVerifier.sol Block Verifier Contract
contracts/core/impl/DefaultDepositContract.sol Deposit Contract
contracts/core/impl/ExchangeV3.sol Exchange Contract
contracts/core/impl/LoopringV3.sol Loopring Contract
contracts/core/impl/VerificationKeys.sol Hardcoded verification keys
loopring_v3/contracts/lib lib contracts
contracts/aux aux contracts
### Zero Knowledge Proof Circuit
circuit/Circuits/UniversalCircuit.h Program Entry
circuit/Circuits/BaseTransactionCircuit.h Abstraction of transaction circuits
circuit/Circuits/Circuit.h
circuit/Circuits/NoopCircuit.h
circuit/Circuits/DepositCircuit.h
circuit/Circuits/AccountUpdateCircuit.h
circuit/Circuits/AppKeyUpdateCircuit.h
circuit/Circuits/TransferCircuit.h
circuit/Circuits/WithdrawCircuit.h
circuit/Circuits/SpotTradeCircuit.h
circuit/Circuits/BatchSpotTradeCircuit.h
circuit/Circuits/OrderCancelCircuit.h
circuit/Gadgets/AccountGadgets.h Account Status Update Toolset
circuit/Gadgets/BatchOrderGadgets.h Spot Trading Aggregation Toolset
circuit/Gadgets/MatchingGadgets.h Order Matching Toolset
circuit/Gadgets/MathGadgets.h Mathematical Formula Toolset
circuit/Gadgets/MerkleTree.h Merkle Tree Toolset
circuit/Gadgets/OrderGadgets.h Order Toolset
circuit/Gadgets/SignatureGadgets.h Signature Verification Toolset
circuit/Gadgets/StorageGadgets.h Data Storage Toolset
circuit/Utils/Constants.h
circuit/Utils/Data.h
circuit/Utils/Utils.h
### API and SDK
https://github.com/degatedev/degate-sdk-python
https://github.com/degatedev/degate-sdk-golang
https://api-docs.degate.com/spot
### Websites and Applications
TODO: github on UI interface
## Impacts in scope
### Smart Contract
* Direct theft of any user funds, whether at rest or in motion. Impact: Critical.
* Permanent freezing of funds Impact: Critical
* Protocol Insolvency Impact: Critical
* Made DeGate have to go into Exodus Mode Impact: Critical
* Consume token ID, prevent new token from registering Impact: High
* Permanent freezing of unclaimed yield Impact: High
* Smart contract unable to operate due to lack of token funds Impact: Medium
* Theft of unclaimed yield Impact: Medium
* Block stuffing for profit Impact: Medium
* Griefing (e.g. no profit motive for an attacker, but damage to the users or the protocol) Impact: Medium
* Theft of gas Impact: Medium
* Unbounded gas consumption Impact: Medium
* Smart contract fails to work correctly, but doesn’t lose value Impact: Low
### Zero Knowledge Proof Circuit
* Use a Proving Key that does not match the contract registration Verifying Key to generate a zero-knowledge proof and pass the contract verification Impact: Critical
* The amount of tokens in the L2 is inconsistent with that of the L1, except for Non-Standard tokens Impact: Critical
* Climbing blocks fails to recovery the asset tree Impact: Critical
* Steal trading fee or gas fee Impact: High
* Prevent new users from registering, through abnormal consumption of L2 accounts, etc. Impact: High
* The account cannot be used, through abnormal consumption of the L2 storage area, etc. Impact: High
* Circuit fails to work correctly, but doesn’t lose value Impact: Low
### Websites and Applications
* Taking state-modifying authenticated actions (with or without blockchain state interaction) on behalf of other users without any interaction by that user, such as, changing registration information, making trades, withdrawals, etc. Impact: Critical
* Direct theft of user funds Impact: Critical
* Execute arbitrary system commands Impact: Critical
* Retrieve sensitive data/files from a running server such as /etc/shadow, database passwords, and blockchain keys(this does not include non-sensitive environment variables, open source code, or usernames) Impact: Critical
* Malicious interactions with an already-connected wallet such as modifying transaction arguments or parameters, substituting contract addresses, submitting malicious transactions Impact: Critical
* Taking Down the application/website Impact: High
* Injecting/modifying the static content on the target application without Javascript (Persistent) such as HTML injection without Javascript, replacing existing text with arbitrary text, arbitrary file uploads, etc. Impact: High
* Obtain or modify sensitive information of other users, including altering browser local storage, without already-connected wallet interaction and with up to one click of user interaction. Impact: Medium
* Redirecting users to malicious websites (Open Redirect) Impact: Medium
* Injecting/modifying the static content on the target application without Javascript (Reflected) such as reflected HTML injection or loading external site data Impact: Medium
### API and SDK
* Actual transaction data is abnormal, with abnormal amounts and addresses of trading, transfers and withdrawals.** Impact: Critical
* Expired or canceled orders be matched Impact: Critical
* Unable to call API, non-API restriction reason Impact: High
* Taking down backend service with no fund lost Impact: High
* Actual matching data is abnormal, with abnormal matching amounts and sequence of trades. Impact: High
* The transaction cannot be uploaded to L1 Impact: Medium
## Out of Scope & Rules
### The following vulnerabilities are excluded from the rewards for this bug bounty program:
* Attacks that the reporter has already exploited themselves, leading to damage
* Attacks requiring access to leaked keys/credentials
* Attacks requiring access to privileged addresses
* Broken link hijacking is out of scope
### Smart Contracts and Blockchain
* Basic economic governance attacks (e.g. 51% attack)
* Lack of liquidity
* Best practice critiques
* Sybil attacks
* Centralization risks
* Balance changes and authority freezes caused by the token contract itself, such as rebase tokens
### Websites and Apps
* Theoretical vulnerabilities without any proof or demonstration
* Content spoofing / Text injection issues
* Self-XSS
* Captcha bypass using OCR
* CSRF with no security impact (logout CSRF, change language, etc.)
* Missing HTTP Security Headers (such as X-FRAME-OPTIONS) or cookie security flags (such as “httponly”)
* Server-side information disclosure such as IPs, server names, and most stack traces
* Vulnerabilities used to enumerate or confirm the existence of users or tenants
* Vulnerabilities requiring unlikely user actions
* URL Redirects (unless combined with another vulnerability to produce a more severe vulnerability)
* Lack of SSL/TLS best practices
* DDoS vulnerabilities
* Attacks requiring privileged access from within the organization
* Feature requests
* Best practices
* Vulnerabilities primarily caused by browser/plugin defects
* Any vulnerability exploit requiring CSP bypass resulting from a browser bug
### The following activities are prohibited by this bug bounty program:
* Attempting to use an unreasonable amount of valueless testnet ETH for block stuffing to force entry into Exodus Mode, register a significant number of tokens and accounts to occupy storage, and execute other economically secure attacks.
* Any testing with mainnet or public testnet contracts; all testing should be done on private testnets
* Attempting phishing or other social engineering attacks against our employees and/or customers
* Any testing with third party systems and applications (e.g. browser extensions) as well as websites (e.g. SSO providers, advertising networks)
* Any denial of service attacks
* Automated testing of services that generates significant amounts of traffic
* Public disclosure of an unpatched vulnerability in an embargoed bounty