Zum Inhalt springen
Skillpedia
Sicherheit8.0k · #12705

sharp-edges

Was er macht

Schaut sich das Design einer Schnittstelle an, etwa einer API oder einer Einstellungsdatei, und findet Stellen, an denen der leichte Weg zu unsicherer Nutzung führt. Er richtet sich an Entwickler und Reviewer, die eine Bibliothek entwerfen oder prüfen.

Wann du ihn nutzt

  • ✓Wenn du das Design einer API oder Bibliothek prüfst, bevor sie veröffentlicht wird.
  • ✓Wenn du prüfen willst, ob eine Konfigurationsdatei gefährliche Optionen hat, die man leicht aus Versehen wählt.
  • ✓Wenn du bewertest, wie leicht sich eine Kryptografie- oder Login-Schnittstelle richtig verwenden lässt.

Link zum Skill

https://github.com/trailofbits/skills/blob/main/plugins/sharp-edges/skills/sharp-edges/SKILL.md

Kopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.

So nutzt du ihn

Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.

Fertige Nachricht zum Einfügen

Nutze diesen Skill, um mir zu helfen: https://github.com/trailofbits/skills/blob/main/plugins/sharp-edges/skills/sharp-edges/SKILL.md Lies die SKILL.md unter diesem Link und folge ihren Anweisungen für meine Aufgabe.
Soll deine KI Skills wie diesen selbst finden?Installiere den kostenlosen Skillpedia-MCP: eine Zeile, und sie durchsucht vor jeder Aufgabe 15.000+ Skills.In 1 Minute installieren →

Beispielanfrage an deine KI

“Ich will wissen, wo Entwickler unsere Login-API leicht auf unsichere Weise verwenden könnten.”

5 neue Skills pro Woche. 1 Minute Lesezeit.

So funktioniert es

Der Agent listet die Stellen auf, an denen Nutzer Sicherheitsentscheidungen treffen, testet ungewöhnliche Eingaben und Einstellungen und stellt sich vor, wie jemand sie missbrauchen könnte. Er behält nur Befunde, die er aus dem Code begründen kann.

Technischer Inhalt (originale SKILL.md)

Originaltext des Autors, auf Englisch, direkt von GitHub.

Sharp Edges Analysis

Evaluates whether APIs, configurations, and interfaces are resistant to developer misuse. Identifies designs where the "easy path" leads to insecurity.

When to Use

  • Reviewing API or library design decisions
  • Auditing configuration schemas for dangerous options
  • Evaluating cryptographic API ergonomics
  • Assessing authentication/authorization interfaces
  • Reviewing any code that exposes security-relevant choices to developers

When NOT to Use

  • Implementation bugs (use standard code review)
  • Business logic flaws (use domain-specific analysis)
  • Performance optimization (different concern)

Agent

The sharp-edges-analyzer agent runs the full sharp edges analysis workflow autonomously. Use it when you want a dedicated analysis of APIs, configurations, or interfaces for misuse resistance and footgun potential. The agent follows the four-phase workflow (Surface Identification, Edge Case Probing, Threat Modeling, Validate Findings) and reads language-specific references on demand.

Core Principle

The pit of success: Secure usage should be the path of least resistance. If developers must understand cryptography, read documentation carefully, or remember special rules to avoid vulnerabilities, the API has failed.

Rationalizations to Reject

Rationalization Why It's Wrong Required Action
"It's documented" Developers don't read docs under deadline pressure Make the secure choice the default or only option
"Advanced users need flexibility" Flexibility creates footguns; most "advanced" usage is copy-paste Provide safe high-level APIs; hide primitives
"It's the developer's responsibility" Blame-shifting; you designed the footgun Remove the footgun or make it impossible to misuse
"Nobody would actually do that" Developers do everything imaginable under pressure Assume maximum developer confusion
"It's just a configuration option" Config is code; wrong configs ship to production Validate configs; reject dangerous combinations
"We need backwards compatibility" Insecure defaults can't be grandfather-claused Deprecate loudly; force migration

Sharp Edge Categories

1. Algorithm/Mode Selection Footguns

APIs that let developers choose algorithms invite choosing wrong ones.

The JWT Pattern (canonical example):

  • Header specifies algorithm: attacker can set "alg": "none" to bypass signatures
  • Algorithm confusion: RSA public key used as HMAC secret when switching RS256→HS256
  • Root cause: Letting untrusted input control security-critical decisions

Detection patterns:

  • Function parameters like algorithm, mode, cipher, hash_type
  • Enums/strings selecting cryptographic primitives
  • Configuration options for security mechanisms

Example - PHP password_hash allowing weak algorithms:

// DANGEROUS: allows crc32, md5, sha1
password_hash($password, PASSWORD_DEFAULT); // Good - no choice
hash($algorithm, $password); // BAD: accepts "crc32"

2. Dangerous Defaults

Defaults that are insecure, or zero/empty values that disable security.

The OTP Lifetime Pattern:

# What happens when lifetime=0?
def verify_otp(code, lifetime=300):  # 300 seconds default
    if lifetime == 0:
        return True  # OOPS: 0 means "accept all"?
        # Or does it mean "expired immediately"?

Detection patterns:

  • Timeouts/lifetimes that accept 0 (infinite? immediate expiry?)
  • Empty strings that bypass checks
  • Null values that skip validation
  • Boolean defaults that disable security features
  • Negative values with undefined semantics

Questions to ask:

  • What happens with timeout=0? max_attempts=0? key=""?
  • Is the default the most secure option?
  • Can any default value disable security entirely?

3. Primitive vs. Semantic APIs

APIs that expose raw bytes instead of meaningful types invite type confusion.

The Libsodium vs. Halite Pattern:

// Libsodium (primitives): bytes are bytes
sodium_crypto_box($message, $nonce, $keypair);
// Easy to: swap nonce/keypair, reuse nonces, use wrong key type

// Halite (semantic): types enforce correct usage
Crypto::seal($message, new EncryptionPublicKey($key));
// Wrong key type = type error, not silent failure

Detection patterns:

  • Functions taking bytes, string, []byte for distinct security concepts
  • Parameters that could be swapped without type errors
  • Same ty
Häufige Fragen

Findet er gewöhnliche Fehler?

Nein. Er konzentriert sich auf Designs, die zu Fehlern einladen, nicht auf Implementierungsfehler.

Deckt er Fehler in der Geschäftslogik ab?

Nein. Diese liegen außerhalb des Skills und brauchen eine fachspezifische Prüfung.

Gibt es dafür einen eigenen Agenten?

Ja. Der Skill beschreibt einen Analyse-Agenten, der den gesamten Ablauf selbstständig durchführt.

Details

Originalbeschreibung des Autors

Identifies error-prone APIs, dangerous configurations, and footgun designs that enable security mistakes. Use when reviewing API designs, configuration schemas, cryptographic library ergonomics, or evaluating whether code follows 'secure by default' and 'pit of success' principles. Triggers: footgun, misuse-resistant, secure defaults, API usability, dangerous configuration.

repo: trailofbits/skills

Beliebtheit

GitHub-Sterne
8.0k
Platz im Ranking
#12705
Lizenz
CC-BY-SA-4.0
Aktualisiert
2.11.2026

Ist dieser Skill nützlich?

0

Anmelden um abzustimmen.

Kommentare

  • …

Weitere Skills aus diesem Repository

Ähnliche Skills