मुख्य सामग्री पर जाएँ
Skillpedia
सिक्योरिटी5.5k · #14798

web3-audit

यह क्या करती है

यह स्किल एजेंट को आम DeFi बग के लिए स्मार्ट कॉन्ट्रैक्ट का ऑडिट करना सिखाती है। इसमें Solidity और Rust कॉन्ट्रैक्ट शामिल हैं, और ऐसी जाँचें जो तय करने में मदद करती हैं कि प्रोटोकॉल की समीक्षा लायक है या नहीं।

कब इस्तेमाल करें

  • ✓जब ऑडिटर DeFi जोखिमों के लिए Solidity या Rust स्मार्ट कॉन्ट्रैक्ट की समीक्षा करता है।
  • ✓जब शिकारी तय करना चाहता है कि DeFi बाउंटी लक्ष्य समय लायक है या नहीं।
  • ✓जब शोधकर्ता संदिग्ध कॉन्ट्रैक्ट बग साबित करने के लिए Foundry टेस्ट चाहता है।

Skill का लिंक

https://github.com/awarexone/Agentic-Bug-Hunter/blob/main/skills/web3-audit/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/awarexone/Agentic-Bug-Hunter/blob/main/skills/web3-audit/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“इस lending कॉन्ट्रैक्ट के सहोदर फ़ंक्शन में गायब एक्सेस जाँच ढूँढिए, और बताइए कि क्या यह गहरी समीक्षा लायक है।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

एजेंट पहले आकार, पिछले ऑडिट और बाउंटी मूल्य पर त्वरित जाँच करता है। फिर वह कॉन्ट्रैक्ट पढ़ता है, हर फ़ंक्शन की तुलना उसके सहोदरों से करता है, और दस बग श्रेणियाँ जाँचता है। संदिग्ध बग को Foundry टेस्ट से पुष्ट किया जाता है।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

WEB3 SMART CONTRACT AUDIT

10 bug classes. Pre-dive kill signals. Foundry PoC template. Real paid examples.


PRE-DIVE KILL SIGNALS (check BEFORE any code review)

ZKsync lesson: $322M TVL + OZ audit + 750K LOC + 5 sessions = 0 findings. Large well-audited bridges are extremely hard.

  1. TVL < $500K → max payout capped too low for effort
  2. 2+ top-tier audits (Halborn, ToB, Cyfrin, OpenZeppelin) on simple protocol → bugs already found
  3. Protocol < 500 lines, single A→B→C flow → minimal attack surface
  4. Formula: max_realistic_payout = min(10% × TVL, program_cap) — if < $10K, skip

Soft kill: OZ/ToB/Cyfrin audit on current version + codebase > 500K LOC → expect 40+ hours for maybe 1 finding. Only proceed if bounty floor > $50K AND you have protocol-specific expertise.

Target scoring (go if >= 6/10):

  • TVL > $10M: +2
  • Immunefi program with Critical >= $50K: +2
  • No top-tier audit on current version: +2
  • < 30 days since deploy: +1
  • Protocol you've hunted before: +1
  • Source code + natspec comments: +1
  • Upgradeable proxies: +1

THE ONE RULE

"Read ALL sibling functions. If vote() has a modifier, check poke(), reset(), harvest(). The missing modifier on the sibling IS the bug."

This single rule explains 19% of all Critical findings.


1. ACCOUNTING STATE DESYNCHRONIZATION

#1 Critical bug class — 28% of all Criticals on Immunefi.

What It Is

Two state variables supposed to stay in sync. One code path updates A but forgets B. Later code reads both and makes decisions based on stale B.

Real Value = A - B
If A updated but B isn't → Real Value appears larger → phantom value

Root Cause Patterns

Variant 1: Phantom Yield (Yeet protocol — 35 duplicate reports)

function startUnstake(uint256 amount) external {
    totalSupply -= amount;  // decremented BEFORE transfer
    // aToken.balanceOf(this) still reflects old value
    // yieldAmount = aToken.balanceOf - totalSupply = phantom yield
}

Variant 2: Fast Path Skips State Update (Alchemix V3)

function claimRedemption(uint256 tokenId) external {
    if (transmuter.balance >= amount) {
        transmuter.transfer(user, amount);
        _burn(tokenId);
        return;  // EARLY RETURN — cumulativeEarmarked, _redemptionWeight, totalDebt never updated
    }
    // Slow path: updates all state vars correctly
    alchemist.redeem(...);
}

Variant 3: Update Happens in Wrong Order (Alchemix)

function deposit(uint256 amount) external {
    _shares = (amount * totalShares) / totalAssets;  // calculated BEFORE deposit
    totalAssets += amount;   // assets added AFTER shares calculated → wrong rate
}

Grep Patterns

# Find all accounting variables
grep -rn "totalSupply\|totalShares\|totalAssets\|totalDebt\|cumulativeReward\|rewardPerShare" contracts/

# Find all early returns in claim/redeem functions
grep -rn "\breturn\b" contracts/ -B3 | grep -B3 "if\b"

# For each early return: which state updates in normal path are skipped?

2. ACCESS CONTROL

#2 Critical — 19% of Criticals. $953M lost in 2024 alone.

Variant 1: Missing Modifier on Sibling Function

function vote(uint256 tokenId) external onlyNewEpoch(tokenId) {  // guarded
function reset(uint256 tokenId) external onlyNewEpoch(tokenId) { // guarded
function poke(uint256 tokenId) external {                         // NO GUARD → infinite FLUX inflation
}

Variant 2: Wrong Check (Existence vs Ownership)

function split(uint256 tokenId, uint256 amount) external {
    _requireOwned(tokenId);  // checks if token EXISTS, not if caller OWNS it
    _burn(tokenId);
    _mint(msg.sender, amount);  // attacker steals tokens they don't own
}

Variant 3: Silent Modifier (if vs require)

// VULNERABLE — non-admin silently gets through:
modifier onlyAdmin() {
    if (msg.sender == admin) {
        _;  // body only executes for admin, but non-admin doesn't revert
    }
}
// CORRECT: require(msg.sender == admin, "Not admin"); _;

Variant 4: Uninitialized Proxy

function initialize(address _owner) public {  // MISSING: initializer modifier
    owner = _owner;  // anyone can call → become owner
}
// Fix: constructor() { _disableInitializers(); }

Grep Patterns

# Find sibling function families — do ALL have the same modifier set?
grep -rn "function vote\|function poke\|function reset\|function update\|
अक्सर पूछे जाने वाले सवाल

मुख्य नियम क्या है?

स्किल कहती है कि सभी सहोदर फ़ंक्शन पढ़ें, क्योंकि एक सहोदर पर गायब modifier अक्सर बग होता है।

बंद करने वाला संकेत क्या है?

उदाहरण हैं कुल लॉक वैल्यू पाँच लाख डॉलर से कम, या ऐसा प्रोटोकॉल जिसका कई शीर्ष फ़र्मों ने पहले ऑडिट किया हो।

कौन-सी भाषाएँ कवर होती हैं?

Solidity और Rust स्मार्ट कॉन्ट्रैक्ट।

जानकारी

लेखक का मूल विवरण

Smart contract security audit — 10 DeFi bug classes (accounting desync, access control, incomplete path, off-by-one, oracle, ERC4626, reentrancy, flash loan, signature replay, proxy), pre-dive kill signals (TVL < $500K etc), Foundry PoC template, grep patterns for each class, and real Immunefi paid examples. Use for any Solidity/Rust contract audit or when deciding whether a DeFi target is worth hunting.

repo: awarexone/Agentic-Bug-Hunter

लोकप्रियता

GitHub स्टार
5.5k
रैंकिंग में स्थान
#14798
लाइसेंस
MIT
अपडेट की गई
28/10/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

bug-bounty

5.5k

आपके एजेंट को बग बाउंटी समीक्षा चरणों में योजना बनाने में मदद करती है, प्रोग्राम का दायरा जाँचने और संपत्तियाँ मैप करने से लेकर प्रभाव सत्यापित करने और रिपोर्ट लिखने तक।

कोडिंगसिक्योरिटी

agentic-app-audit

5.5k

आपके एजेंट को लाइव AI असिस्टेंट की बाहर से समीक्षा करने देती है, हाइजैक्ड टूल कॉल, दूषित मेमोरी और उपयोगकर्ता से अधिक पहुँच वाली कार्रवाइयों जैसे जोखिमों के लिए।

कोडिंगसिक्योरिटी

argus

5.5k

आपके एजेंट को वेब और AI ऐप की आम खामियों के लिए छह स्वचालित स्कैनर चलाने देती है, जैसे खुला cross-origin एक्सेस, JWT कमज़ोरियाँ और out-of-band में पुष्ट अंधी बग।

कोडिंगसिक्योरिटी

bb-methodology

5.5k

आपके एजेंट को बग बाउंटी सत्र चरणों में योजना बनाने देती है, अगला कदम और सही जाँच चुनते हुए, और ऐसे विचार छोड़ते हुए जो असली नुकसान नहीं कर सकते।

कोडिंगसिक्योरिटी

मिलती-जुलती skills