887 Commits

Author SHA1 Message Date
Henrik Brodin f720f00eb8 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)
2026-01-12 11:29:22 +01:00
Kevin Valerio 9e33ffdc22 fix: fixing line 110: set: -g: invalid option for Fish shell (#408)
Co-authored-by: kevin-valerio <kevin-valerio@users.noreply.github.com>
2026-01-05 09:28:05 +01:00
Henrik Brodin 58c52cf6e2 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
2025-12-18 08:36:07 +01:00
Henrik Brodin 91656f0ca8 Fix port-forward cleanup to only kill specific process (#405)
Previously, `send-integration-task` and `send-libpng-task` used
`pkill -f "kubectl port-forward"` which killed ALL kubectl port-forward
processes. This was problematic when other port-forwards were running.

Now each target captures the PID of the port-forward it starts and kills
only that specific process when done.
2025-12-15 09:32:37 +01:00
Riccardo Schirone 134e9f6b92 ui: show error banner instead of mock data when API unavailable (#403)
When the web-ui server stops while a browser window is open, the UI
was showing fake task data (libpng-analysis, libxml2-fuzzing) instead
of indicating the server was unavailable.

Changes:
- Remove getMockTasks() function that returned hardcoded fake data
- Add apiError state to track API connection status
- Update loadTasks() to set empty array and error flag on failure
- Add updateApiErrorBanner() to show/hide error banner
- Add CSS styles for the error banner

Fixes #395

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-15 09:29:03 +01:00
Henrik Brodin 23bdac5839 Fix CRS_KEY_TOKEN_HASH truncation in setup-local (#397)
* Fix CRS_KEY_TOKEN_HASH truncation in setup-local

  - auth_tool.py: Use plain print() when piped; Rich wraps at 80 chars
  - common.sh: Escape $ in hash before sed (interpreted as backreferences)

* Revert unneeded change
2025-11-27 09:36:12 +01:00
Samuel Moelius 8ddb74a725 Create CODEOWNERS file 2025-11-25 18:07:29 +01:00
Riccardo Schirone ab27eb2fab deployment: pin Docker version to be consistent
Without this, the various components would use a more up-to-date docker
version that is not compatible with the version of dind 24.0 that was
used.
2025-11-13 17:05:15 +01:00
Riccardo Schirone 3f694a8c46 patcher: improve filtering prompt 2025-11-13 17:05:15 +01:00
Riccardo Schirone 9dfde547b3 patcher: fix 'code_snippet_request' matching (#385) 2025-11-11 16:58:23 +01:00
Riccardo Schirone ff998721c2 fuzzer: demangle function names when storing Coverage info (#384)
* fuzzer: demangle function names when storing Coverage info

* check if demangled name is empty
2025-11-11 16:58:04 +01:00
Henrik Brodin 36fc163e90 Test that helper.py patching works across commits (#383)
Check out the oss-fuzz repo at differrent commits to ensure helper.py patching reliably fixes the upstream issue.
2025-11-05 15:00:49 +01:00
Henrik Brodin 36c47bdf1b Apply OSS-Fuzz reproduce_impl fix to all architectures (#381)
OSS-Fuzz helper.py reproduce_impl passes err_result as positional arg
to docker_run(), interpreted as print_output=False, redirecting output
to /dev/null, breaking test_real_reproduce_pov on x86_64 CI.

Refactor _hack_oss_fuzz_aarch64_runner into unified _hack_oss_fuzz_runner
that takes architecture parameter and applies:
- Common fixes (reproduce_impl, debug tag, tag handling) to all arches
- ARM64-specific fixes (:manifest-arm64v8 tags) conditionally

Update get_rw_copy to call helper.py patching for all architectures.
2025-11-05 08:56:14 +01:00
Henrik Brodin 130d6576ce Fix ARM64 crash reproduction and helper.py patching (#378)
The tracer bot failed to reproduce crashes on ARM64 due to incorrect
parameter passing in the reproduce_impl patch. The err_result value was
being passed as a positional argument to docker_run(), which interpreted
it as print_output=False, redirecting all output to /dev/null.

Changes:
- Fix reproduce_impl to pass architecture as keyword arg only
- Refactor ARM64 patching into separate dockerfile and runner functions
- Add comprehensive helper.py patching for ARM64:
  * Patch image_name variables to use :manifest-arm64v8 tag
  * Patch BASE_RUNNER_IMAGE assignment with tag stripping
  * Fix debug mode tag insertion (insert -debug before tag, not after)
  * Prevent double-tagging in _get_base_runner_image()
- Default CLI architecture parameters to ARCHITECTURE constant

This enables the tracer bot to see fuzzer output and successfully detect
crash reproduction on ARM64 systems.

Co-authored-by: Riccardo Schirone <562321+ret2libc@users.noreply.github.com>
2025-11-04 13:01:36 +01:00
Riccardo Schirone b514d459b4 deployment: use more build-bot (#380) 2025-11-03 20:39:18 +01:00
Riccardo Schirone f9dae91103 patcher: claude 3.5 sonnet is not available anymore (#379) 2025-11-03 20:38:50 +01:00
Riccardo Schirone 73ae1e8a6a Use :manifest-arm64v8 tag for aarch64 deployments (#375) 2025-10-24 15:45:13 +02:00
Riccardo Schirone f4139a2b77 scripts: auto-install a few extra tools for AKS deployment (#373) 2025-10-20 08:19:51 +02:00
Riccardo Schirone c547f19a15 ci: schedule system integration tests once a week (#372) 2025-10-20 08:18:57 +02:00
Arsalan c7c0e98d4b Add warnings about SigNoz re-deployment (#365) 2025-10-07 09:19:33 +02:00
Riccardo Schirone 3251477c56 seed-gen: add OpenAI model to fallbacks (#370)
Add an OpenAI model to the fallback models so that if only OpenAI
API Key is provided, the seed-gen component still works.
2025-10-03 12:26:49 -04:00
Riccardo Schirone 1a0295e48e program-model: CodeQueryPersistent already applies the patch (#368) 2025-10-03 10:39:39 -04:00
Riccardo Schirone 008bb9cd6a Use our modified oss-fuzz (#367)
libpng has changed the default branch to libpng18, but that doesn't
contain the oss-fuzz files. Let's use our own fork of oss-fuzz for now,
until https://github.com/google/oss-fuzz/pull/14080 is ready.
2025-10-03 10:36:30 -04:00
Riccardo Schirone 3cb613281a deployment: remove a few warnings during deployment (#366) 2025-10-02 09:07:40 -04:00
Riccardo Schirone 9302f5dd36 scripts: Install uv dep required during setup (#364) 2025-09-29 16:52:41 +02:00
Riccardo Schirone 2987140d69 deployment: fix bitnami deprecation errors (#363)
* deployment: use alpine/kubectl instead of bitnami
* Move away from bitnami/ images
* fix postgresql image
2025-09-29 16:32:38 +02:00
Riccardo Schirone 7690b5d173 Fix Gemini API Key configuration (#362) 2025-09-22 08:58:31 -04:00
Riccardo Schirone 0d71570949 Add support for C++ projects (#357)
* Split C and C++ projects
* Add support for C++ files in tree-sitter
* Remove patch_validation step because it does not support c++ and it was anyway a leftover from the AIxCC competition. It can actually happen that a patch needs to fix a harness and checking if the patch is only in the right type of file was never that good.
* Remove language-identifier binaries because not needed anymore (due to previous point).
2025-09-16 17:57:46 +02:00
Riccardo Schirone 5253cc2e1e Do not ask for deployment confirmation in CI (#358)
* Do not ask for deployment confirmation in CI
* add otel token to CI
* remove unnecessary comment
* approve patch
2025-09-16 17:19:06 +02:00
Riccardo Schirone ba9f0e5571 Add Tailscale support to the custom scripts (#354) 2025-09-16 15:14:35 +02:00
Riccardo Schirone 66b94c443e Generate random litellm/crs keys (#353) 2025-09-16 13:48:56 +02:00
Riccardo Schirone 29c79407ed Allow to disable find_tests step while developing (#359) 2025-09-16 11:33:22 +02:00
Riccardo Schirone 143a59c236 fuzzer_runner: split fuzzer's dependencies (#320)
Before this commit, the fuzzer dependend on clusterfuzz, which uses
protobuf 3.20. Since fuzzer-bot depended on common subpackage as well
and also common (and the other packages) require protobuf, we had to use
protobuf 3.20 everywhere. This old dependency however means that a lot
of packages can't be used in their "newer" versions, because they depend
on newer protobuf versions.

This commit splits the fuzzer into a separate fuzzer-runner that is
executed in a separate process inside a separate venv. fuzzer-runner
executes the clusterfuzz-heavy operations (e.g. fuzzing) and isolates the
clusterfuzz dependency, so that the rest of the system can use newer
protobuf version.

* split `fuzzer-bot` in `fuzzer-runner` and `fuzzer-bot`
* have a "full" optional dependency group in `common`, including `openlit`
  and `protobuf`, so that `fuzzer-runner` can use the lite version of `common`
  without bringing those heavy deps
* move `FuzzConfiguration`/`BuildConfiguration` in a separate common file
  that doesn't require to load all protobuf files. Again, in this way
  other components can just depend on the `common` "lite" version and not
  require protobuf stuff
* add `fuzzer-runner` as a separate venv inside the `fuzzer-bot` container
* add `RunnerProxy` class in fuzzer package to provide an interface to
  interact with the fuzzer-runner binary.
2025-09-10 09:52:08 +02:00
dependabot[bot] 7739f7907d build(deps): bump actions/checkout from 4 to 5 in the actions group (#343)
Bumps the actions group with 1 update: [actions/checkout](https://github.com/actions/checkout).


Updates `actions/checkout` from 4 to 5
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-09 09:01:53 +02:00
Riccardo Schirone 3fd777063b Test and improve AKS deployment (#336)
* Test configuration for Azure deployment
* ci: re-enable docker build/push
* ci: docker push labeled PRs
* Use `make deploy` for both local and azure deployments
* doc: update AKS_DEPLOYMENT doc
* add confirmation in Makefile
* Make resource group location configurable
2025-09-08 16:57:08 +02:00
Riccardo Schirone f375539499 patcher: fix exception logging causing problems in SigNoz (#340) 2025-09-05 10:50:07 -04:00
Henrik Brodin d28e4614a7 Allows the user to accept/reject the generated patch (#330)
* Allows the user to accept/reject the generated patch

* Use correct types

* Further style enhancements
2025-09-04 21:26:38 +02:00
Riccardo Schirone 891d7d1789 patcher: add some documentation for running patcher alone (#339) 2025-09-04 10:28:18 -04:00
Riccardo Schirone 75d59d71a2 ci: do not use ghcr auth (#335)
* ci: do not use ghcr auth

* correctly remove GHCR_AUTH line
2025-09-04 09:46:55 -04:00
dependabot[bot] b3474d0c52 build(deps): bump actions/setup-python from 5 to 6 in the actions group (#337)
Bumps the actions group with 1 update: [actions/setup-python](https://github.com/actions/setup-python).


Updates `actions/setup-python` from 5 to 6
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-04 13:28:08 +02:00
Henrik Brodin 3cd5d1c01b Move the example-libpng button (#333)
There is now an additional button available in the Submit Task dialogue.
This enables users to easily modify values such as timeouts etc and keeps
the main ui clean.
2025-09-04 08:12:20 +02:00
Riccardo Schirone 945298c039 litellm_config: remove spaces to fix litellm parsing the file (#328)
A few spaces in the litellm_config.yaml file were preventing litellm
from correctly parsing and loading the configuration.
2025-09-03 10:06:38 -04:00
dependabot[bot] 54de06efa3 build(deps): bump actions/checkout from 4 to 5 in the actions group
Bumps the actions group with 1 update: [actions/checkout](https://github.com/actions/checkout).


Updates `actions/checkout` from 4 to 5
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-28 09:26:08 +02:00
Evan Downing 2be6f91545 Parse result logs (#326)
* Add doc on parsing logs and scripts to unpack dataset

* Reorganize scripts

* Reorg markdown files.
2025-08-27 15:26:38 -04:00
Michael D Brown 2284fc1864 Fix / re-org CI (#288)
* renaming system integration tests to something more appropriate

* WIP to isolate unit tests from integration tests

* WIP

* fix typo

* fix after merge from main

* Merged changes from prior PRs into comp-integration

* separated integration tests for components into separate workflow

* fixed label

* cleanup

* put system integration tests back on nightly schedule

* Put component integration tests back on for push to main

* Disable some tests because target is not publicly available.

* appease linter

* trying HTTPS instead of SSH

* disable test with non-public target.

* disable finicky tests

* update label for component integration tests.

---------

Co-authored-by: Michael D. Brown <michaeldbrown@Michaels-MacBook-Pro-4.local>
2025-08-27 15:25:33 -04:00
Boyan MILANOV c25b3956d0 Support Gemini (#306)
* Add gemini api key option during setup and in deployment environments

* Add gemini pro as a fallback model in all components

* Lint

* Set rate limits for gemini models

* Add fallback models in more places

* Fix typo

* Fix kwargs expansion

* Fix instantiation of llm with callbacks

* Fixed formatting after merge

* Fix instantiation of default models

* Lint

* Fix llm creation

* Fix

* Lint

* Lint

---------

Co-authored-by: Michael D Brown <michael.brown@trailofbits.com>
2025-08-26 10:59:00 -04:00
Emmanuel Ferdman 71032d2d4c fix: resolve pydantic deprecation warnings (#321)
Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
2025-08-25 09:58:09 -04:00
Dan Guido 7ab5da641e feat: add pre-commit infrastructure for code quality (#311)
* feat: add minimal pre-commit infrastructure

- Add pre-commit configuration with essential checks only
- Check YAML, TOML, JSON syntax
- Check for merge conflicts and large files
- Enforce LF line endings (fix 2 test files with CRLF)
- Add debug statement detection
- Integrate ruff for Python formatting and linting
- Add GitHub workflow for pre-commit CI
- No unnecessary Python code changes

* fix: add explicit permissions to pre-commit workflow

- Set GITHUB_TOKEN permissions to read-only for contents
- Follows principle of least privilege
- Addresses CodeQL security recommendation
- Pre-commit checks only need to read code, not write

* fix: exclude test data from line ending modifications

- Exclude .proto files and test/data directories from mixed-line-ending hook
- Revert changes to test data files (traced_crash.proto, java_stacktrace.txt)
- These files need to preserve their original format for test integrity
- Binary proto files could be corrupted by line ending changes

* docs: add pre-commit hooks documentation to CONTRIBUTING.md

- Add pre-commit installation instructions to development setup
- Document pre-commit hooks in Code Quality Standards section
- Update submission workflow to include pre-commit checks
- Provide manual pre-commit run commands for contributors

* docs: streamline CONTRIBUTING.md for better readability

- Reduce from 214 to 124 lines (42% reduction) while keeping all essential info
- Consolidate setup instructions into concise Quick Start section
- Convert component descriptions to scannable table format
- Streamline testing strategy with clear requirements and timing
- Add back critical testing prerequisites (codequery, ripgrep, cscope)
- Create actionable Getting Help section with common troubleshooting
- Remove redundant command listings and verbose explanations
- Maintain all security requirements and essential workflows
2025-08-22 16:42:23 -04:00
Dan Guido 7bc3dfdc43 chore: standardize ruff configuration across all components (#310) 2025-08-22 14:08:07 -04:00
Dan Guido 42691e50b4 style: apply ruff auto-fixes and formatting across entire codebase (#309)
* style: apply ruff auto-fixes and formatting across entire codebase

Applied safe auto-fixes from ruff v0.12.9 with --select ALL to improve code quality:
- Reorder imports (stdlib → third-party → local)
- Use modern type hints (collections.abc.Generator instead of typing.Generator)
- Add trailing commas for better diffs
- Format multi-line function parameters for readability
- Add strict=False to zip() calls for explicit behavior
- Simplify redundant elif to if after return statements
- Consistent code formatting with ruff format

These are all mechanical, non-controversial changes that improve code consistency
without altering functionality. Changes affect 180 files across all modules:
common, fuzzer, orchestrator, patcher, program-model, and seed-gen.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* re-applt ruff after merge

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Michael D Brown <michael.brown@trailofbits.com>
2025-08-22 10:30:12 -04:00