Files
IsaacTrost 311085c3c5 Debugger integration (#414)
* changed configuration to focus on seed-gen

* added nomminally working debug_subagent_task

* debugging process

* debugging process

* debugging process

* debugging process

* got debug subagent to work more reliably

* debugging why it cant find the seed file

* added more tests

* more debugging of debugginf functionality

* more debugging of debugger

* debugging working, scripts bad because some symbols are not found

* mostly working live debugging, still a bit pricy though

* Added hybrid mode that will do batch, then try interactive if that fails

* fixes

* fixes, updating docker interactive

* updating mi parsing for gdb

* modifications to the mi parser

* Improve coverage tracking precision (#401)

* Improve coverage tracking precision

Previously coverage tracking included all regions. This changes coverage tracking to be more precise.

Macros that result in code are represented as a single line in the function, and any executed line in the macro will make that line 'covered'. Beyound that, only CodeRegions will count. This will prevent code guarded by #if that aren't in the binary from being considered reachable for example. The idea is that seed-gen would have more accurate information when selecting functions to target.

I've done some testing and it appears as if the new implementation in general reaches more lines and covers more functions.

* Fix macro coverage leaking across files due to missing filename in key

The expansion_coverage map used (line, col) as key without filename,
causing coverage from one file to incorrectly appear in another when
macros were at the same coordinates.

* Recursively expand macros and add named types for coverage data

- Process ExpansionRegion target_regions recursively instead of counting
  only the call site line
- Add coordinate index for O(1) expansion lookups
- Cache computed expansion lines to avoid recomputation across functions
- Use bulk set operations for better performance
- Prevent infinite loops with visited set for circular macro references
- Add named types for coverage data structures:
  - RegionCoords, ExpansionKey, CachedExpansionLines
  - Type aliases: ExpansionMap, CoordToFilenames, ExpansionLinesCache
- Add comprehensive tests for nested macros and edge cases

* fix: fixing `line 110: set: -g: invalid option` for Fish shell (#408)

Co-authored-by: kevin-valerio <kevin-valerio@users.noreply.github.com>

* working state

* working state for monolith, still needs refactor

* limit grep output (whoops) and fix building to force optimization flags

* added function lookup tool

* added better build selection logic, and avoided c ode duplication

* fix fuzzer selection to ignore debug

* added debug builds as a seperate 'sanitizor'

* fixed build system, more in line with other dependancies now

* adding new better debug targets, and logging

* final changes before testing

* improving test coverage

* improving test coverage

* feat: add extract_povs command to buttercup-util (#410)

Add new CLI subcommand to extract PoVs, stack traces, and patches from
Redis submissions into a structured directory format for easy analysis.

Features:
- Extracts crash inputs (PoV files) via kubectl cp from cluster pods
- Writes fuzzer and tracer stack traces to text files
- Exports associated patches with metadata
- Organizes output by project/task_id/vulnerability
- Supports filtering by task_id and passed_only options
- Skips empty patch trackers (placeholders that never received content)

* Use git-lfs when downloading challenges

* improving test coverage

* Delete b.txt

* final changes before run hopefully

* feat: add extract_povs command to buttercup-util (#410)

Add new CLI subcommand to extract PoVs, stack traces, and patches from
Redis submissions into a structured directory format for easy analysis.

Features:
- Extracts crash inputs (PoV files) via kubectl cp from cluster pods
- Writes fuzzer and tracer stack traces to text files
- Exports associated patches with metadata
- Organizes output by project/task_id/vulnerability
- Supports filtering by task_id and passed_only options
- Skips empty patch trackers (placeholders that never received content)

* Sanitize exception messages for git clone command (#411)

* Sanitize exception messages for git clone command

* Update test case

* Don't sanitize exception if there is no PAT

* merging with main and fixing tests which tested old build system

* fixing erronous changes from testing

* fix silly linting errors

* reformatted for linter

* fixing failing tests

* fixing failing tests

* linting

* restore scripts to remove debugging changes

---------

Co-authored-by: Henrik Brodin <90325907+hbrodin@users.noreply.github.com>
Co-authored-by: Kevin Valerio <24193167+kevin-valerio@users.noreply.github.com>
Co-authored-by: kevin-valerio <kevin-valerio@users.noreply.github.com>
Co-authored-by: Ronald Eytchison <58823072+reytchison@users.noreply.github.com>
2026-01-26 09:15:48 -05:00
..
2026-01-21 13:03:00 +01:00
2025-01-17 14:57:33 +01:00

Demo fuzzer.

General idea here is we have a set of builders and a fuzzer bot managed through redis queues.

All commands are suggestions based on vibes at the moment and not really tested...

Building:

... have a linux box Install poetry

curl -sSL https://install.python-poetry.org | python3 -
pyenv install 3.8
pyenv global 3.8
poetry shell
poetry install

Demo prereqs

Nginx depedencies (this is to run the fuzz bot locally instead of in docker):

sudo apt-get install pcre2
git clone https://github.com/google/oss-fuzz.git
export OSS_FUZZ_PATH=$(pwd)/oss-fuzz

Running:

Start redis:

docker pull redis
docker run redis
export REDIS_IP=$(docker inspect \
  -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' <container>)
export REDIS_URL="redis://$REDIS_IP"

Starting the orchestrator:

This orchestrator mocks the interactions of an actual orchestrator by receiving build outputs and adding them to a fuzzer distribution.

python fuzzing_infra/orchestrator.py --redis_url $REDIS_URL

Starting a build bot

This starts a build bot that will build fuzzr harnesses using helper.py. Allow caching means it will be built directly in the ossfuzz directory. This mode allows for only building a harness once rather than snapshotting per request trees.

python fuzzing_infra/builder_bot.py  --redis_url $REDIS_URL --allow-caching

Starting the fuzzer bot

python fuzzing_infra/fuzzer_bot.py --redis_url $REDIS_URL --timeout 120

Sending a build request:

Creating a manual build request:

python fuzzing_infra/stimulate_build_bot.py --redis_url $REDIS_URL --target_package nginx --ossfuzz $OSS_FUZZ_PATH --engine libfuzzer --sanitizer address

This command should result in the builder emitting build logs and then fuzzer logs.

On timeouts and OOMs

OSS Fuzz documents their settings for handling timeouts (anything which takes >65 seconds to reproduce) and out-of-memory (anything which uses >2.5GB of memory) here and here.

Timeouts

  • Sometimes tracer-bot can hang. AIxCC has introduced a timeout flag to kill helper.py in v1.2.0.
  • We set this timeout value to whatever the fuzzing harness's settings are, or default to 120 seconds (longer than oss-fuzz documents).

OOMs

  • We set fuzzer-bot and tracer-bot to have at least 4Gi of memory during minikube testing.
  • We acknowledge that a fuzzing harness can specify -rss_limit_mb=0 to disable memory limits, but these cases will likely be few and far between (upon examining the projects under oss-fuzz), and if it does get killed due to memory limitations, then our stacktrace will be empty and we can simply ignore and move on.