Logo von Auditing Smart Contract Access Control

Auditing Smart Contract Access Control

Organisation
UnboundCompute
auditing-smart-contract-access-control

Audit a smart contract for a privileged action any caller can reach, so an attacker invokes a function that should be restricted. Covers a state-changing or fund-moving function missing an authorization modifier, an ownership or role check that is wrong or bypassable, an unprotected initializer that lets an attacker seize ownership of a proxy or an uninitialized contract, a delegatecall to an attacker-supplied or upgradeable target that runs foreign code in this contract's context, a self-destruct or upgrade reachable without the right role, and a role granted to an address that should not hold it. Use when the fix would add or repair an authorization check, not reorder effects before interactions (that is the reentrancy skill). The attacker calling a privileged function is the source, the restricted action executing for them is the sink, and a missing or defeated authorization check is the bug.

Übersicht

HerausgeberUnboundCompute
Repositorysecurity-agent-skills
Skill-Nameauditing-smart-contract-access-control
Sterne
27
Forks
8
Mitgelieferte Dateien
Nur Anweisungen
LizenzMIT
Links
  • Anweisungen in Markdown

    Eine SKILL.md-Datei, die das Modell bei Bedarf lädt. So werden nur dann Token verbraucht, wenn eine Anfrage tatsächlich dazu passt.

  • Funktioniert mit jedem LLM

    KI-Skills bestehen aus reinem Markdown, nicht aus anbieterspezifischem Code. Daher funktionieren sie mit GPT, Claude, Gemini, Grok oder einem lokalen Modell.

  • In sich abgeschlossen

    Alles, was das Modell braucht, steht in den Anweisungen — keine zusätzlichen Dateien zum Synchronisieren.

  • Open Source

    Von UnboundCompute auf GitHub veröffentlicht. Prüfen Sie vor der Installation die Quelldateien.

Installation

Installieren Sie den KI-Skill Auditing Smart Contract Access Control in TypingMind, um ihn mit jedem LLM zu nutzen, oder fügen Sie ihn einem anderen Agenten hinzu, der SKILL.md lesen kann.

1

In TypingMind installieren

TypingMind installiert einen Skill direkt aus seinem GitHub-Ordner. Dabei liest die App SKILL.md, bündelt die Ressourcendateien und speichert das Ergebnis lokal.

  1. Öffnen Sie die App und gehen Sie zu Plugins → Skills.
  2. Wählen Sie „Von GitHub installieren“.
  3. Fügen Sie die unten angegebene URL des Skill-Ordners ein und bestätigen Sie.
    https://github.com/UnboundCompute/security-agent-skills/tree/main/skills/auditing-smart-contract-access-control
  4. Aktivieren Sie den Skill in jedem Chat, in dem er verfügbar sein soll.
Plugins → Skills → Skill hinzufügen → Über GitHub-URL. Fügen Sie dann die Ordner-URL ein und klicken Sie auf „Weiter“.
2

In einem anderen Agenten installieren

Jeder Agent, der das Agent-Skills-Format unterstützt, kann diesen Skill nutzen. Kopieren Sie den Ordner in das Skill-Verzeichnis des jeweiligen Agenten.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/UnboundCompute/security-agent-skills.git /tmp/security-agent-skills
mkdir -p .claude/skills
cp -r /tmp/security-agent-skills/skills/auditing-smart-contract-access-control .claude/skills/auditing-smart-contract-access-control
Starten Sie Claude Code nach dem Kopieren neu, damit der neue Skill erkannt wird.

In TypingMind verwenden

Aktivieren Sie Auditing Smart Contract Access Control in einem beliebigen Chat in TypingMind. Den Rest übernimmt das Modell. Name und Beschreibung des Skills stehen im System-Prompt. Sobald eine Anfrage passt, lädt das Modell selbstständig die vollständigen Anweisungen — Sie müssen den Skill nie manuell aufrufen, und er verbraucht erst Token, wenn er tatsächlich genutzt wird.

Das Modell lädt Auditing Smart Contract Access Control automatisch, sobald eine passende Anfrage gestellt wird.

Funktioniert mit jedem KI-Modell

KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher ist Auditing Smart Contract Access Control nicht an das Modell gebunden, für das der Skill geschrieben wurde. Installieren Sie ihn einmal in TypingMind und nutzen Sie ihn mit GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder einem selbst betriebenen lokalen Modell — alles mit Ihren eigenen API-Schlüsseln.

  • Wird nur bei Bedarf geladen

    Der System-Prompt enthält nur den Namen und die Beschreibung. Die Anweisungen werden bei der ersten passenden Anfrage geladen. Ein ungenutzter Skill verursacht daher keine Kosten.

  • Modell im laufenden Chat wechseln

    Da der Skill aus Anweisungen statt aus Code besteht, funktioniert er auch nach einem Modellwechsel — das nächste Modell liest dieselbe SKILL.md-Datei.

Skill-Anweisungen

Dies ist der Inhalt von SKILL.md, den das Modell lädt. Lesen Sie ihn vor der Installation — ein Skill besteht aus Anweisungen, denen Ihr Modell folgt.

Auditing smart-contract access control: who is allowed to call the privileged function

Access control on a contract is a set of gates: a modifier or a check that says only the owner, only a role, only during initialization. The bug is a privileged action, moving funds, changing configuration, upgrading, self-destructing, whose gate is missing, wrong, or reachable by the wrong caller. This is a crowded audit area, so the discipline is confirming the action is genuinely privileged and the gate is genuinely absent or defeated on a reachable path, not flagging every public function. The dividing line from reentrancy: if the fix is to add or repair an authorization check, it belongs here; if the fix is to reorder effects before interactions or add a mutex, it belongs in the reentrancy skill. Two initialization and delegation shapes, the unprotected initializer and the delegatecall to an attacker-controlled target, are access-control bugs and are audited here.

When to use

  • A function changes state, moves funds, upgrades, self-destructs, or grants a role.
  • You see an authorization modifier, an ownership or role check, an initializer, or a delegatecall.
  • You want to know whether an attacker can reach a privileged action the contract meant to restrict.

Scope check

Audit only contracts you own or are authorized to assess, and exercise a privileged path only on a test network or a local fork, calling an unguarded privileged function on a live contract can seize or destroy real value. Prove it on a fork. If you can't name the authorization, stop.

The loop

  1. Inventory the privileged actions and their gates first. List every function that moves funds, changes configuration, upgrades, self-destructs, or grants a role, and for each find the gate that is meant to restrict it (an owner or role modifier, an internal check). A function is only a finding if it is genuinely privileged and its gate is absent, wrong, or reachable by the wrong caller; establish both before flagging.

  2. Check for the missing modifier. Look for a privileged, state-changing, or fund-moving function with no authorization modifier and no internal caller check, callable by any address. A public function that changes ownership-relevant state with no gate is the core shape.

  3. Check the gate's correctness. Look for an ownership or role check that is present but wrong: the wrong role, a comparison that can be satisfied by the caller, a check on a value the caller controls, or a modifier applied to a harmless function while the sensitive one nearby lacks it.

  4. Check the initializer. Look for an initializer on a proxy or an upgradeable or uninitialized contract that is not protected against being called by anyone, letting an attacker run it first and seize ownership or set attacker-chosen configuration. An unprotected initializer is an access-control bug.

  5. Check delegatecall and privileged primitives. Look for a delegatecall to an attacker-supplied or attacker-influenceable target, which runs foreign code in this contract's storage and permission context, and for a self-destruct or an upgrade reachable without the correct role, and for a role or ownership grant to an address that should not hold it.

  6. Confirm and record. Confirm by showing an unauthorized caller reaches the privileged action on a fork. Kill the lead if a correct authorization modifier or internal check gates the function on the reachable path, if the initializer is protected (an initializer guard, constructor-only, or already initialized so it cannot be re-run), if the delegatecall target is fixed and trusted and not attacker-influenceable, if the function is privileged in name but changes nothing sensitive and moves no value, or if the caller the check admits is genuinely the intended trusted party. Record the function, the missing or defeated gate, and the caller that reaches it.

Where access control leaks

  • A public privileged function is the surface, not every public function. The finding is a genuinely sensitive action with no working gate; confirm the action is privileged before flagging the visibility.
  • A present check can still be the wrong check. A modifier on the wrong role, or a comparison the caller satisfies, gates nothing; read what the check actually enforces, not that one exists.
  • An unprotected initializer hands over ownership. On a proxy or uninitialized contract, an open initializer lets an attacker run it first and become owner; this is access control, audited here.
  • A delegatecall runs foreign code in your context. A delegatecall to an attacker-influenceable target executes with this contract's storage and permissions; the target's controllability is the bug.
  • A guard on the wrong function is misdirection. The modifier on a harmless function while the sensitive sibling nearby is bare is a common shape; check the gate is on the action that matters.

Worked example (a confirm and a kill)

Confirm. A proxy's initializer sets the owner and is not protected against repeated or public calls, and the contract was deployed without initialization; an attacker calls the initializer first, becomes owner, and then invokes the owner-gated upgrade to point the proxy at their implementation. Confirmed ownership seizure through an unprotected initializer, critical, remediation = protect the initializer so it runs once and only during deployment, and verify initialization at deploy.

Kill. A function that transfers protocol fees looks unguarded at first read, but it carries an owner-only modifier resolved through the contract's access-control base, and only the deployer address satisfies it. An arbitrary caller reverts. Killed, kill_reason = "the fee-transfer function is gated by a correct owner-only modifier on the reachable path, so no unauthorized caller can execute it."

Rationalizations to reject

  • "The function is public, so it is a bug." -> Only if it is privileged and ungated. Confirm it changes sensitive state or moves value and has no working check before flagging visibility alone.
  • "It has an onlyOwner modifier." -> Does the modifier enforce the right role, and is it on the sensitive function rather than a harmless neighbor? A present check can still be the wrong check.
  • "The initializer is fine, it sets up the contract." -> Is it protected from being called by anyone on an uninitialized proxy? An open initializer is an ownership-seizure primitive.
  • "It uses delegatecall for upgrades." -> Is the target attacker-influenceable? A delegatecall to a controllable target runs foreign code in this contract's context.
  • "Only the team would call it." -> Does the code enforce that, or just assume it? Intent is not a gate; the check has to restrict the caller on-chain.

Executing this in practice

You need the privileged functions and what each one does, the authorization modifiers and internal checks and what they actually enforce, the initializer and whether it is protected, the delegatecall targets and their controllability, and the roles and who holds them. For each privileged action, decide whether an unauthorized caller reaches it on the live path. Reading the function tells you what it does; reading the gate tells you whether it stops the wrong caller.

Related

  • hunting-smart-contract-reentrancy - the split partner: if the fix is to reorder effects before interactions or add a mutex rather than add or repair an authorization check, adjudicate it there.
  • hunting-defi-economic-and-oracle-flaws - the economic sibling; a privileged parameter setter reachable by the wrong caller that skews pricing hands the economic impact to that skill.
  • finding-fail-open-flaws - the general shape of a check that does not deny; an access gate that admits the wrong caller is its on-chain instance.
  • FINDING-SCHEMA.md - source = the attacker calling a privileged function, sink = the restricted action executing for them, evidence = the missing or defeated gate and the reachable caller.

Häufig gestellte Fragen

Was macht der KI-Skill Auditing Smart Contract Access Control?

Audit a smart contract for a privileged action any caller can reach, so an attacker invokes a function that should be restricted. Covers a state-changing or fund-moving function missing an authorization modifier, an ownership or role check that is wrong or bypassable, an unprotected initializer that lets an attacker seize ownership of a proxy or an uninitialized contract, a delegatecall to an attacker-supplied or upgradeable target that runs foreign code in this contract's context, a self-destruct or upgrade reachable without the right role, and a role granted to an address that should not...

Warum Auditing Smart Contract Access Control in TypingMind nutzen?

Weil Sie den Skill einmal installieren und mit jedem Modell verwenden können. Auditing Smart Contract Access Control besteht aus reinem Markdown statt aus anbieterspezifischem Code. So funktioniert derselbe Skill mit GPT-5, Claude, Gemini, Grok oder einem lokalen Modell – und Sie können das Modell mitten im Chat wechseln, ohne dass der Skill seine Funktion verliert. TypingMind verwendet Ihre eigenen API-Schlüssel. Sie bezahlen die Anbieter daher direkt statt über ein Abonnement pro Nutzerplatz, und Ihre Skills und Chats bleiben in Ihrem eigenen Speicher.

Wie installiere ich Auditing Smart Contract Access Control in TypingMind?

Öffnen Sie in TypingMind Plugins → Skills → Von GitHub installieren und fügen Sie https://github.com/UnboundCompute/security-agent-skills/tree/main/skills/auditing-smart-contract-access-control ein. TypingMind liest die Datei SKILL.md und installiert den Skill, den Sie für jeden Chat einzeln aktivieren können.

Welche KI-Modelle können Auditing Smart Contract Access Control nutzen?

Jedes Modell, das Sie mit TypingMind verbinden. KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher können GPT, Claude, Gemini, Grok und lokale Modelle diesen Skill laden, wenn eine Anfrage dazu passt.

Wie viele KI-Modelle kann ich mit Auditing Smart Contract Access Control verwenden?

So viele Sie möchten. In TypingMind können Sie Auditing Smart Contract Access Control mit jedem Modell verwenden, das Skills unterstützt, etwa mit GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama. Dabei nutzen Sie Ihre eigenen API-Schlüssel.

Ist der KI-Skill Auditing Smart Contract Access Control kostenlos?

Ja. Der Skill wird von UnboundCompute auf GitHub unter der Lizenz MIT veröffentlicht. Sie bezahlen nur Ihren eigenen KI-Anbieter für die verwendeten Token.

Was sind KI-Skills?

Ein KI-Skill ist ein wiederverwendbares Anweisungspaket, das einem KI-Modell vermittelt, wie es eine bestimmte Aufgabe erledigt. Es folgt dem offenen Format Agent Skills: Die Datei SKILL.md enthält den Namen und die Beschreibung des Skills. Hinzu kommen bei Bedarf Skripte, Vorlagen oder Referenzdateien für das Modell. Das Modell liest die Anweisungen nur, wenn Ihre Anfrage zum Skill passt. Ein installierter Skill verursacht daher erst Kosten, wenn er verwendet wird.

Wie unterscheiden sich KI-Skills von Plugins oder MCP-Servern?

Ein Plugin oder MCP-Server stellt einem Modell neue aufrufbare Tools bereit – Code, der auf einem System ausgeführt wird und ein Ergebnis zurückgibt. Ein KI-Skill vermittelt dem Modell stattdessen Wissen und Vorgehensweisen: wie es eine Aufgabe angeht, welche Schritte es befolgt und wie eine gute Ausgabe aussieht. Skills bestehen aus reinem Markdown und kommen daher ohne Server, API-Schlüssel und Laufzeitumgebung aus. Sie funktionieren mit jedem Modell.

Alle anzeigen

Jetzt eigenen KI-Arbeitsbereich einrichten

Abonnieren Sie unseren Newsletter und erfahren Sie mehr über neue Funktionen und kommende Gewinnspiele 👇