initial version#81
Open
antonio-morales wants to merge 1 commit into
Open
Conversation
| # accidental disclosure of arbitrary host files via the dashboard. | ||
| allowed_root = (Path.home() / ".local/share/seclab-taskflow-agent").resolve() | ||
| try: | ||
| real = Path(path).resolve() |
| except (OSError, ValueError): | ||
| self.send_error(403, "path outside allowed root") | ||
| return | ||
| if not real.is_file(): |
| if not real.is_file(): | ||
| self.send_error(404) | ||
| return | ||
| data = real.read_bytes() |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an initial end-to-end autonomous AFL++ fuzzing taskflow to the seclab_taskflows ecosystem, including persistence (SQLite), tooling wrappers, dashboard rendering, and extensive tests/docs to support the new pipeline.
Changes:
- Introduces fuzzing pipeline taskflows (target discovery → harness generation/build → iterative fuzz/coverage loop → crash triage → reporting).
- Adds fuzzing-specific MCP toolbox configs, a local host shell MCP server, and a live read-only HTML/JSON dashboard.
- Ships format dictionaries/custom mutators plus comprehensive unit tests and documentation (FUZZING.md, benchmark guidance).
Show a summary per file
| File | Description |
|---|---|
| tests/test_fuzz_runner.py | Unit tests covering fuzz_runner tooling behaviors (hashing, compilation orchestration, dictionaries/mutators, corpus handling). |
| tests/test_fuzz_context.py | Unit tests for fuzz_context persistence, LCOV parsing, migrations, plateau detection, crash dedupe, and suggestion/note storage. |
| tests/test_dashboard.py | Tests for dashboard HTML/JSON rendering, escaping, and new sections (heatmap/timeline). |
| src/seclab_taskflows/toolboxes/local_shell.yaml | Adds local_shell toolbox wiring and documents the non-interactive/no-confirm design. |
| src/seclab_taskflows/toolboxes/fuzz_runner.yaml | Adds fuzz_runner toolbox wiring and extends MCP timeouts for long AFL runs. |
| src/seclab_taskflows/toolboxes/fuzz_context.yaml | Adds fuzz_context toolbox wiring for fuzzing state persistence. |
| src/seclab_taskflows/taskflows/fuzzing/write_vuln_reports.yaml | New stage: per-crash vuln report authoring and verdict persistence. |
| src/seclab_taskflows/taskflows/fuzzing/write_report.yaml | New stage: writes a concise campaign REPORT.md from fuzz_context DB state. |
| src/seclab_taskflows/taskflows/fuzzing/write_initial_harnesses.yaml | New stage: generates initial harnesses/seeds and project/format dictionaries. |
| src/seclab_taskflows/taskflows/fuzzing/triage_crashes.yaml | New stage: minimize/replay/classify crashes and store deduped crash rows. |
| src/seclab_taskflows/taskflows/fuzzing/README.md | Taskflow-level documentation for the fuzzing pipeline and security caveats. |
| src/seclab_taskflows/taskflows/fuzzing/qualify_harnesses.yaml | New stage: multi-candidate harness qualifier (choose winner by coverage). |
| src/seclab_taskflows/taskflows/fuzzing/identify_fuzz_targets.yaml | New stage: LLM-driven fuzz target identification and persistence. |
| src/seclab_taskflows/taskflows/fuzzing/fuzz_iteration.yaml | New stage: the iterative fuzz/coverage/improve loop with persistent corpus. |
| src/seclab_taskflows/taskflows/fuzzing/confirm_fixed_crashes.yaml | New stage: re-test historical crashes and mark as fixed when no longer reproducible. |
| src/seclab_taskflows/taskflows/fuzzing/build_harnesses.yaml | New stage: build AFL+coverage binaries (and optional custom mutator linking). |
| src/seclab_taskflows/taskflows/fuzzing/analyze_call_graph.yaml | New stage: call graph + untouched API surface computation and persistence. |
| src/seclab_taskflows/taskflows/fuzzing/analyze_build_system.yaml | New stage: build system detection and build recipe capture for harness linking. |
| src/seclab_taskflows/prompts/fuzzing/vuln_report.yaml | Prompt template for per-crash triage and markdown vuln report generation. |
| src/seclab_taskflows/prompts/fuzzing/triage_crash.yaml | Prompt template for crash minimization + ASan replay + classification storage. |
| src/seclab_taskflows/prompts/fuzzing/coverage_feedback.yaml | Prompt template guiding post-coverage improvements (seeds/harness/dicts). |
| src/seclab_taskflows/personalities/fuzzing_engineer.yaml | New personality describing AFL++ workflow, structure-aware fuzzing, and triage. |
| src/seclab_taskflows/mcp_servers/local_shell.py | Adds LocalShell MCP server (shell_exec/write_file/write_bytes) with logging and output bounds. |
| src/seclab_taskflows/mcp_servers/fuzz_context_models.py | Adds SQLAlchemy models supporting fuzzing targets/runs/coverage/crashes/call graphs/notes. |
| src/seclab_taskflows/dictionaries/xml.dict | XML AFL dictionary tokens. |
| src/seclab_taskflows/dictionaries/xml_mutator.c | XML structure-aware custom mutator source. |
| src/seclab_taskflows/dictionaries/regex.dict | Regex AFL dictionary tokens. |
| src/seclab_taskflows/dictionaries/regex_mutator.c | Regex structure-aware custom mutator source. |
| src/seclab_taskflows/dictionaries/png.dict | PNG AFL dictionary tokens. |
| src/seclab_taskflows/dictionaries/json.dict | JSON AFL dictionary tokens. |
| src/seclab_taskflows/dictionaries/json_mutator.c | JSON structure-aware custom mutator source. |
| src/seclab_taskflows/dictionaries/binary_tlv_mutator.c | Length-prefixed binary custom mutator source (reusable for PNG-style chunk formats). |
| scripts/fuzzing/run_fuzzing.sh | New driver script chaining all stages and starting the dashboard. |
| scripts/fuzzing/install_afl.sh | New installer for AFL++ + LLVM/lcov + callgraph tooling dependencies. |
| scripts/fuzzing/dashboard.py | New live dashboard HTTP server + HTML/JSON rendering + lightweight migration. |
| README.md | Top-level entrypoint docs linking to fuzzing workflow. |
| FUZZING.md | Full reference documentation for the fuzzing pipeline architecture and tools. |
| benchmark/README.md | Benchmark guidance and expected results format. |
| benchmark/projects.yaml | Curated benchmark repos for end-to-end validation. |
| benchmark/improvements.md | Implementation tracker/history for fuzzing taskflow features. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (2)
scripts/fuzzing/dashboard.py:345
- File links embed the absolute path into the query string without URL-encoding (only HTML escaping). This can break the
/fileendpoint for paths containing reserved characters (e.g.,&,?, spaces) and can lead to surprising behavior when the browser normalizes the URL. Useurlencode/quotewhen constructing these links andunquotewhen readingpath.
report_link = ""
if c["vuln_report_path"]:
report_link = f'<a href="/file?path={_h(c["vuln_report_path"])}">report</a>'
min_link = ""
if c["minimized_path"]:
min_link = f'<a href="/file?path={_h(c["minimized_path"])}">{_h(Path(c["minimized_path"]).name)}</a>'
out.append(
scripts/fuzzing/dashboard.py:413
- The call-graph and dot-file links are built with
/file?path=...using HTML escaping but not URL-encoding. For robustness, construct the URL withurllib.parse.urlencode(orquote) so paths with reserved characters remain valid.
if svg:
parts.append(
f'<p><a href="/file?path={_h(svg)}">📊 view interactive call graph (SVG)</a> · '
f'<a href="/file?path={_h(dot)}">.dot source</a></p>'
)
elif dot:
parts.append(f'<p><a href="/file?path={_h(dot)}">.dot source</a> (SVG not rendered)</p>')
- Files reviewed: 42/42 changed files
- Comments generated: 4
Comment on lines
+4
to
+13
| """FastMCP server: guarded freeform host shell. | ||
|
|
||
| Used by the fuzzing taskflow during the build-system analysis and harness | ||
| authoring phases, where the agent legitimately needs to run arbitrary | ||
| ``./configure`` / ``make`` / ``cmake`` invocations on the host. | ||
|
|
||
| The toolbox YAML lists ``shell_exec`` under ``confirm`` so each call is | ||
| surfaced to the user. By default commands run inside ``LOCAL_SHELL_CWD`` (or | ||
| ``$HOME`` if unset) and write nothing outside the workspace. | ||
| """ |
|
|
||
| import logging | ||
| import os | ||
| import shlex |
Comment on lines
+21
to
+22
| # in a disposable environment (Codespace, throwaway VM). Each shell command | ||
| # the agent issues to local_shell requires user confirmation by default. |
Comment on lines
+270
to
+273
| html_link = ( | ||
| f'<a href="/file?path={_h(last["html_path"])}">view</a>' | ||
| if last["html_path"] else '<span class="muted">—</span>' | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Initial version of the fuzzing taskflow.