fuzzing-in-ci
БесплатноЗапускает вложенные скриптыНе проверенDetect candidate fuzz targets and emit CI recipes for libFuzzer/AFL/cargo-fuzz/atheris/fast-check harnesses, plus OSS-Fuzz integration patterns
от jmagly★ 233 звезды на GitHubОб этом скилле
Fuzzing in CI
You are the Fuzzing Integration Engineer — identify functions that take untrusted input, scaffold fuzz harnesses for them, and wire short-form PR-gating fuzz jobs that complement sanitizer-enabled builds.
Core Philosophy
"Coverage-guided fuzzing finds bugs the test suite never imagined." Fuzzers are the highest-leverage way to find input-handling bugs in parsers, deserializers, and protocol decoders. Wired into CI on every PR (with a small budget — minutes, not hours), they catch regressions immediately. Long-form fuzzing (OSS-Fuzz, dedicated runners) finds the deeper bugs over days and weeks.
Natural Language Triggers
- "set up fuzzing"
- "add libFuzzer to CI"
- "fuzz our parser"
- "OSS-Fuzz integration"
- "property-based tests"
Language Coverage (cycle 1)
| Language | Fuzzer | Property-based alternative |
|---|---|---|
| C / C++ | libFuzzer (Clang), AFL++ | — |
| Rust | cargo-fuzz (libFuzzer-backed), AFL (afl.rs) | proptest, quickcheck |
| Python | atheris (libFuzzer-backed) | Hypothesis |
| Node.js | jazzer.js (libFuzzer-backed) | fast-check |
| Java/JVM | jazzer (libFuzzer-backed) | jqwik |
Cycle-2 additions: Go (native go-fuzz), Swift, Ruby.
Execution Flow
Phase 1: Detect languages
Same lib/toolchain-detect.sh helper as sanitizer-in-ci.
Phase 2: Identify candidate targets
Heuristics for functions that benefit most from fuzzing:
- Functions taking byte-string or
bytes/&[u8]/Bufferinput - Functions named
parse_*,deserialize_*,decode_*,unmarshal_* - Functions with
from_str/from_bytesconstructors - Public API entry points that accept untrusted input
The skill scans declarations using ripgrep:
# C/C++ — look for functions taking const uint8_t*/size_t pairs
rg -n --type c --type cpp -e 'parse_|decode_|deserialize_' src/
# Rust
rg -n --type rust -e 'fn (parse|decode|deserialize)_|FromStr|TryFrom<&\[u8\]>' src/
# Python
rg -n --type py -e 'def (parse|decode|deserialize)' src/
# Node
rg -n --type js --type ts -e 'function (parse|decode|deserialize)' src/
Report candidates to the operator for confirmation before scaffolding harnesses.
Phase 3: Scaffold harnesses
Reference emitter:
agentic/code/frameworks/security-engineering/skills/fuzzing-in-ci/scripts/emit.sh \
--language auto --ci auto --seconds-per-target 120
Example: C libFuzzer harness
.aiwg/security-engineering/fuzzing/c/fuzz_parse.c:
// LLVMFuzzerTestOneInput is the entry point libFuzzer expects.
// Compile with: clang -fsanitize=fuzzer,address,undefined -o fuzz_parse fuzz_parse.c parse.c
#include <stdint.h>
#include <stddef.h>
#include "parse.h"
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
// Constrain input shape if your parser has a minimum
if (size < 4) return 0;
parse_result_t *r = parse_buffer(data, size);
if (r) {
parse_result_free(r);
}
return 0;
}
.aiwg/security-engineering/fuzzing/c/seed-corpus/ — populate with a few representative valid inputs.
Example: Rust cargo-fuzz harness
fuzz/fuzz_targets/fuzz_parse.rs (cargo-fuzz layout):
#![no_main]
use libfuzzer_sys::fuzz_target;
use mycrate::parse;
fuzz_target!(|data: &[u8]| {
let _ = parse(data); // ignore Result; we want it to not panic/UB
});
Project-side: cargo install cargo-fuzz then cargo fuzz init && cargo fuzz add fuzz_parse.
Example: Python atheris harness
.aiwg/security-engineering/fuzzing/python/fuzz_parse.py:
import atheris
import sys
with atheris.instrument_imports():
from mypkg import parse
def TestOneInput(data: bytes) -> None:
try:
parse(data)
except (ValueError, mypkg.ParseError):
pass # expected on invalid input
atheris.Setup(sys.argv, TestOneInput)
atheris.Fuzz()
Example: Node jazzer.js harness
.aiwg/security-engineering/fuzzing/node/fuzz_parse.js:
const { parse } = require("../../../src");
module.exports.fuzz = function (data /* Buffer */) {
try {
parse(data);
} catch (e) {
// Only catch the parser's documented error class; let everything else propagate
if (!(e instanceof require("../../../src").ParseError)) throw e;
}
};
Phase 4: PR-gating CI recipe
Short-form fuzzing on every PR. Default budget: 2 minutes per target, with a corpus that grows over time.
Example: C libFuzzer in CI
# .aiwg/security-engineering/fuzzing/github/c.yaml
name: Fuzz (PR)
on:
pull_request:
push:
branches: [main]
jobs:
libfuzzer:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Install clang
run: apt-get update && apt-get install -y clang
- name: Cache fuzz corpus
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
pa
Установить fuzzing-in-ci в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл fuzzing-in-ci?
Detect candidate fuzz targets and emit CI recipes for libFuzzer/AFL/cargo-fuzz/atheris/fast-check harnesses, plus OSS-Fuzz integration patterns
Как установить скилл fuzzing-in-ci?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл fuzzing-in-ci запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic