Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问clear审计通过

ossfuzzossfuzz 命令行

Agent Skill

ossfuzz 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

45,144

周安装

1,888

GitHub Stars

4,912

下载量

15,808
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:ossfuzz(ossfuzz 命令行)
来源仓库:https://github.com/trailofbits/skills
仓库路径:skills/ossfuzz
安装命令:
npx skills add https://github.com/trailofbits/skills --skill ossfuzz
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/trailofbits/skills --skill ossfuzz

简介

适用于开源项目的免费分布式连续模糊测试基础设施,具有集成的覆盖范围和错误跟踪。

  • 提供 CLI 帮助程序脚本,用于构建 Docker 映像、使用清理程序(AddressSanitizer、UndefinedBehaviorSanitizer)编译模糊器以及在本地运行工具
  • 支持多种模糊测试引擎(libFuzzer、AFL++)和语言(C/C++、Python via Atheris、Rust、Go)以及特定于语言的基础镜像
  • 包括公共错误跟踪器、构建状态仪表板和用于覆盖率分析和性能瓶颈识别的模糊内省器
  • 项目必须满足公共注册的关键分数阈值,但核心是开源的,用于托管私有实例

SKILL.md

OSS-Fuzz

OSS-Fuzz is an open-source project developed by Google that provides free distributed infrastructure for continuous fuzz testing. It streamlines the fuzzing process and facilitates simpler modifications. While only select projects are accepted into OSS-Fuzz, the project's core is open-source, allowing anyone to host their own instance for private projects.

Overview

OSS-Fuzz provides a simple CLI framework for building and starting harnesses or calculating their coverage. Additionally, OSS-Fuzz can be used as a service that hosts static web pages generated from fuzzing outputs such as coverage information.

Key Concepts

ConceptDescription
helper.pyCLI script for building images, building fuzzers, and running harnesses locally
Base ImagesHierarchical Docker images providing build dependencies and compilers
project.yamlConfiguration file defining project metadata for OSS-Fuzz enrollment
DockerfileProject-specific image with build dependencies
build.shScript that builds fuzzing harnesses for your project
Criticality ScoreMetric used by OSS-Fuzz team to evaluate project acceptance

When to Apply

Apply this technique when:

  • Setting up continuous fuzzing for an open-source project
  • Need distributed fuzzing infrastructure without managing servers
  • Want coverage reports and bug tracking integrated with fuzzing
  • Testing existing OSS-Fuzz harnesses locally
  • Reproducing crashes from OSS-Fuzz bug reports

Skip this technique when:

  • Project is closed-source (unless hosting your own OSS-Fuzz instance)
  • Project doesn't meet OSS-Fuzz's criticality score threshold
  • Need proprietary or specialized fuzzing infrastructure
  • Fuzzing simple scripts that don't warrant infrastructure

Quick Reference

TaskCommand
Clone OSS-Fuzzgit clone https://github.com/google/oss-fuzz
Build project imagepython3 infra/helper.py build_image --pull <project>
Build fuzzers with ASanpython3 infra/helper.py build_fuzzers --sanitizer=address <project>
Run specific harnesspython3 infra/helper.py run_fuzzer <project> <harness>
Generate coverage reportpython3 infra/helper.py coverage <project>
Check helper.py optionspython3 infra/helper.py --help

OSS-Fuzz Project Components

OSS-Fuzz provides several publicly available tools and web interfaces:

Bug Tracker

The bug tracker allows you to:

  • Check bugs from specific projects (initially visible only to maintainers, later made public)
  • Create new issues and comment on existing ones
  • Search for similar bugs across all projects to understand issues

Build Status System

The build status system helps track:

  • Build statuses of all included projects
  • Date of last successful build
  • Build failures and their duration

Fuzz Introspector

Fuzz Introspector displays:

  • Coverage data for projects enrolled in OSS-Fuzz
  • Hit frequency for covered code
  • Performance analysis and blocker identification

Read this case study for examples and explanations.

Step-by-Step: Running a Single Harness

You don't need to host the whole OSS-Fuzz platform to use it. The helper script makes it easy to run individual harnesses locally.

Step 1: Clone OSS-Fuzz

git clone https://github.com/google/oss-fuzz
cd oss-fuzz
python3 infra/helper.py --help

Step 2: Build Project Image

python3 infra/helper.py build_image --pull <project-name>

This downloads and builds the base Docker image for the project.

Step 3: Build Fuzzers with Sanitizers

python3 infra/helper.py build_fuzzers --sanitizer=address <project-name>

Sanitizer options:

Note: Fuzzers are built to /build/out/<project-name>/ containing the harness executables, dictionaries, corpus, and crash files.

Step 4: Run the Fuzzer

python3 infra/helper.py run_fuzzer <project-name> <harness-name> [<fuzzer-args>]

The helper script automatically runs any missed steps if you skip them.

Step 5: Coverage Analysis (Optional)

First, install gsutil (skip gcloud initialization).

python3 infra/helper.py build_fuzzers --sanitizer=coverage <project-name>
python3 infra/helper.py coverage <project-name>

Use --no-corpus-download to use only local corpus. The command generates and hosts a coverage report locally.

See official OSS-Fuzz documentation for details.

Common Patterns

Pattern: Running irssi Example

Use Case: Testing OSS-Fuzz setup with a simple enrolled project

# Clone and navigate to OSS-Fuzz
git clone https://github.com/google/oss-fuzz
cd oss-fuzz

# Build and run irssi fuzzer
python3 infra/helper.py build_image --pull irssi
python3 infra/helper.py build_fuzzers --sanitizer=address irssi
python3 infra/helper.py run_fuzzer irssi irssi-fuzz

Expected Output:

INFO:__main__:Running: docker run --rm --privileged --shm-size=2g --platform linux/amd64 -i -e FUZZING_ENGINE=libfuzzer -e SANITIZER=address -e RUN_FUZZER_MODE=interactive -e HELPER=True -v /private/tmp/oss-fuzz/build/out/irssi:/out -t gcr.io/oss-fuzz-base/base-runner run_fuzzer irssi-fuzz.
Using seed corpus: irssi-fuzz_seed_corpus.zip
/out/irssi-fuzz -rss_limit_mb=2560 -timeout=25 /tmp/irssi-fuzz_corpus -max_len=2048 < /dev/null
INFO: Running with entropic power schedule (0xFF, 100).
INFO: Seed: 1531341664
INFO: Loaded 1 modules   (95687 inline 8-bit counters): 95687 [0x1096c80, 0x10ae247),
INFO: Loaded 1 PC tables (95687 PCs): 95687 [0x10ae248,0x1223eb8),
INFO:      719 files found in /tmp/irssi-fuzz_corpus
INFO: seed corpus: files: 719 min: 1b max: 170106b total: 367969b rss: 48Mb
#720        INITED cov: 409 ft: 1738 corp: 640/163Kb exec/s: 0 rss: 62Mb
#762        REDUCE cov: 409 ft: 1738 corp: 640/163Kb lim: 2048 exec/s: 0 rss: 63Mb L: 236/2048 MS: 2 ShuffleBytes-EraseBytes-

Pattern: Enrolling a New Project

Use Case: Adding your project to OSS-Fuzz (or private instance)

Create three files in projects/<your-project>/:

1. project.yaml - Project metadata:

homepage: "https://github.com/yourorg/yourproject"
language: c++
primary_contact: "your-email@example.com"
main_repo: "https://github.com/yourorg/yourproject"
fuzzing_engines:
  - libfuzzer
sanitizers:
  - address
  - undefined

2. Dockerfile - Build dependencies:

FROM gcr.io/oss-fuzz-base/base-builder
RUN apt-get update && apt-get install -y \
    autoconf \
    automake \
    libtool \
    pkg-config
RUN git clone --depth 1 https://github.com/yourorg/yourproject
WORKDIR yourproject
COPY build.sh $SRC/

3. build.sh - Build harnesses:

#!/bin/bash -eu
./autogen.sh
./configure --disable-shared
make -j$(nproc)

# Build harnesses
$CXX $CXXFLAGS -std=c++11 -I. \
    $SRC/yourproject/fuzz/harness.cc -o $OUT/harness \
    $LIB_FUZZING_ENGINE ./libyourproject.a

# Copy corpus and dictionary if available
cp $SRC/yourproject/fuzz/corpus.zip $OUT/harness_seed_corpus.zip
cp $SRC/yourproject/fuzz/dictionary.dict $OUT/harness.dict

Docker Images in OSS-Fuzz

Harnesses are built and executed in Docker containers. All projects share a runner image, but each project has its own build image.

Image Hierarchy

Images build on each other in this sequence:

  1. base_image - Specific Ubuntu version
  2. base_clang - Clang compiler; based on base_image
  3. base_builder - Build dependencies; based on base_clang

- Language-specific variants: base_builder_go, etc. - See /oss-fuzz/infra/base-images/ for full list

  1. Your project Docker image - Project-specific dependencies; based on base_builder or language variant

Runner Images (Used Separately)

Advanced Usage

Tips and Tricks

TipWhy It Helps
Don't manually copy source codeProject Dockerfile likely already pulls latest version
Check existing projectsBrowse oss-fuzz/projects for examples
Keep harnesses in separate repoLike curl-fuzzer - cleaner organization
Use specific compiler versionsBase images provide consistent build environment
Install dependencies in DockerfileMay require approval for OSS-Fuzz enrollment

Criticality Score

OSS-Fuzz uses a criticality score to evaluate project acceptance. See this example for how scoring works.

Projects with lower scores may still be added to private OSS-Fuzz instances.

Hosting Your Own Instance

Since OSS-Fuzz is open-source, you can host your own instance for:

  • Private projects not eligible for public OSS-Fuzz
  • Projects with lower criticality scores
  • Custom fuzzing infrastructure needs

Anti-Patterns

Anti-PatternProblemCorrect Approach
Manually pulling source in build.shDoesn't use latest versionLet Dockerfile handle git clone
Copying code to OSS-Fuzz repoHard to maintain, violates separationReference external harness repo
Ignoring base image versionsBuild inconsistenciesUse provided base images and compilers
Skipping local testingWastes CI resourcesUse helper.py locally before PR
Not checking build statusUnnoticed build failuresMonitor build status page regularly

Tool-Specific Guidance

libFuzzer

OSS-Fuzz primarily uses libFuzzer as the fuzzing engine for C/C++ projects.

Harness signature:

extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
    // Your fuzzing logic
    return 0;
}

Build in build.sh:

$CXX $CXXFLAGS -std=c++11 -I. \
    harness.cc -o $OUT/harness \
    $LIB_FUZZING_ENGINE ./libproject.a

Integration tips:

  • Use $LIB_FUZZING_ENGINE variable provided by OSS-Fuzz
  • Include -fsanitize=fuzzer is handled automatically
  • Link against static libraries when possible

AFL++

OSS-Fuzz supports AFL++ as an alternative fuzzing engine.

Enable in project.yaml:

fuzzing_engines:
  - afl
  - libfuzzer

Integration tips:

  • AFL++ harnesses work alongside libFuzzer harnesses
  • Use persistent mode for better performance
  • OSS-Fuzz handles engine-specific compilation flags

Atheris (Python)

For Python projects with C extensions.

Example from cbor2 integration:

Harness:

import atheris
import sys
import cbor2

@atheris.instrument_func
def TestOneInput(data):
    fdp = atheris.FuzzedDataProvider(data)
    try:
        cbor2.loads(data)
    except (cbor2.CBORDecodeError, ValueError):
        pass

def main():
    atheris.Setup(sys.argv, TestOneInput)
    atheris.Fuzz()

if __name__ == "__main__":
    main()

Build in build.sh:

pip3 install .
for fuzzer in $(find $SRC -name 'fuzz_*.py'); do
  compile_python_fuzzer $fuzzer
done

Integration tips:

Rust Projects

Enable in project.yaml:

language: rust
fuzzing_engines:
  - libfuzzer
sanitizers:
  - address  # Only AddressSanitizer supported for Rust

Build in build.sh:

cargo fuzz build -O --debug-assertions
cp fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_target_1 $OUT/

Integration tips:

Troubleshooting

IssueCauseSolution
Build fails with missing dependenciesDependencies not in DockerfileAdd apt-get install or equivalent in Dockerfile
Harness crashes immediatelyMissing input validationAdd size checks in harness
Coverage is 0%Harness not reaching target codeVerify harness actually calls target functions
Build timeoutComplex build processOptimize build.sh, consider parallel builds
Sanitizer errors in buildIncompatible flagsUse flags provided by OSS-Fuzz environment variables
Cannot find source codeWrong working directory in DockerfileSet WORKDIR or use absolute paths

Related Skills

Tools That Use This Technique

SkillHow It Applies
libfuzzerPrimary fuzzing engine used by OSS-Fuzz
aflppAlternative fuzzing engine supported by OSS-Fuzz
atherisUsed for fuzzing Python projects in OSS-Fuzz
cargo-fuzzUsed for Rust projects in OSS-Fuzz

Related Techniques

SkillRelationship
coverage-analysisOSS-Fuzz generates coverage reports via helper.py
address-sanitizerDefault sanitizer for OSS-Fuzz projects
fuzz-harness-writingEssential for enrolling projects in OSS-Fuzz
corpus-managementOSS-Fuzz maintains corpus for enrolled projects

Resources

Key External Resources

OSS-Fuzz Official Documentation Comprehensive documentation covering enrollment, harness writing, and troubleshooting for the OSS-Fuzz platform.

Getting Started Guide Step-by-step process for enrolling new projects into OSS-Fuzz, including requirements and approval process.

cbor2 OSS-Fuzz Integration PR Real-world example of enrolling a Python project with C extensions into OSS-Fuzz. Shows:

  • Initial proposal and project introduction
  • Criticality score evaluation
  • Complete implementation (project.yaml, Dockerfile, build.sh, harnesses)

Fuzz Introspector Case Studies Examples and explanations of using Fuzz Introspector to analyze coverage and identify fuzzing blockers.

Video Resources

Check OSS-Fuzz documentation for workshop recordings and tutorials on enrollment and harness development.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

28.49%
按下载量换算4,504

OpenCode

21.55%
按下载量换算3,407

Gemini CLI

18.02%
按下载量换算2,849

Antigravity

12.62%
按下载量换算1,995

Cursor

7.54%
按下载量换算1,192

Codex

3.18%
按下载量换算503

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills