3 major findings · 13 minor findings · 11 suggestions
Findings
[major] · CI fuzz targets have no headless Qt platform selection
Without a usable display, the targets' static QApplication construction aborts before fuzz input execution because the Linux run step selects no headless Qt platform.
Location: .github/workflows/fuzz.yml:204 (head).
Details and suggested fix
The targets construct QApplication during static initialization, before libFuzzer runs. The workflow supplies only sanitizer and profile variables, with no QT_QPA_PLATFORM setting or display-server wrapper. On a headless Linux environment using Qt's xcb default, platform initialization therefore aborts before LLVMFuzzerTestOneInput. The local run_fuzz.sh has the same omission when used without a display. Export QT_QPA_PLATFORM=offscreen or minimal before launching the binaries in both entry points, and ensure that plugin is installed. The recorded narrow Qt 6.12.0 experiment reproduced this mechanism, not the complete hosted workflow.
[major] · CI discards every fuzz target's exit status
The fuzz run step succeeds even when targets crash, assert or fail during startup because every invocation ends with || true.
Location: .github/workflows/fuzz.yml:217 (head).
Details and suggested fix
The loop suppresses each nonzero target exit and has no failure accumulator or final status check. Consequently, discovered crashes and fatal sanitizer reports cannot fail this step, even if every target fails. The local run_fuzz.sh already records failures and returns a nonzero status. Use equivalent accumulation here so remaining targets still run, collect artifacts in an always-run step, and then fail the job when any target failed.
[major] · Fuzz instrumentation misses the backend libraries under test
The supplied builds instrument harness translation units but not the separately compiled QML and Core implementations, losing backend coverage feedback and compiler-inserted sanitizer checks.
Location: test/fuzz/CMakeLists.txt:38 (head).
Details and suggested fix
The PRIVATE compile options on each fuzz executable apply to fuzz_common.cpp and its harness source, not bitcoinqml, bitcoinqt or the Core libraries it links. The workflow and local helpers configure FUZZ_SANITIZERS without enabling Core's SANITIZERS interface. As a result, backend implementation branches provide no libFuzzer coverage feedback, and those translation units lack the requested sanitizer checks. Configure instrumentation through Core's SANITIZERS before adding the dependency, using fuzzer-no-link for libraries and fuzzer when linking the fuzz executables. Allocator interception and checks in instrumented inline code still provide some detection, but do not replace backend instrumentation.
[minor] · Chain and URI fuzz targets use Params() before selecting a network
fuzz_chain_model fails on its first input, while the two uninitialized URI targets fail on inputs such as bitcoin:abc, producing harness setup failures instead of useful fuzzing.
Location: test/fuzz/fuzz_chain_model.cpp:24 (head).
Details and suggested fix
ChainModel reads Params() in its constructor, but fuzz_chain_model never selects chain parameters. BitcoinUri::Parse also reaches Params() through DecodeDestination after its scheme checks, and neither fuzz_bitcoin_uri_parsing nor fuzz_bitcoin_uri_model initializes it. The pinned Params() asserts that globalChainParams is set. Initialize a fixed network once in these targets, preferably through a shared harness initializer, before invoking these models or parsers.
[minor] · File-based config fuzzer never reads its mutated file
ReadConfigFiles overwrites SetConfigFilePath, so this target reads the host's default configuration, if present, instead of the temporary file containing fuzz bytes.
Location: test/fuzz/fuzz_bitcoin_conf_files.cpp:72 (head).
Details and suggested fix
The harness writes a temporary bitcoin.conf and selects it with SetConfigFilePath. In the pinned Core, ReadConfigFiles immediately recomputes m_config_path from -conf, defaulting to bitcoin.conf under the default data directory. PrepareArgs passes only -regtest, so the setter's value is discarded and file-loading coverage depends on the host configuration rather than the input. Pass the temporary filename through -conf and an isolated directory through -datadir in ParseParameters, with include-file handling confined to controlled fixtures.
[minor] · Expected RPC syntax exceptions escape the fuzz callback
Malformed input such as a, throws an expected runtime_error out of the callback, causing libFuzzer to stop on a normal parser rejection.
Location: test/fuzz/fuzz_rpc_command_executor.cpp:27 (head).
Details and suggested fix
A comma after an argument moves RPCParseCommandLine into STATE_EATING_SPACES_IN_ARG. The appended newline then throws std::runtime_error("Invalid Syntax"), even with fExecute=false. Production submitCommand catches this rejection, but the new direct harness does not, so ordinary malformed syntax becomes a crash report. Catch std::runtime_error around the parser call in the harness while leaving assertions and sanitizer failures visible.
[minor] · Per-input models accumulate BackendExecutor worker threads
The onboarding and wallet harnesses repeatedly start worker threads but never service the GUI-thread events required to stop them, eventually causing host-dependent resource failures.
Location: test/fuzz/fuzz_onboarding_options_model.cpp:51 (head).
Details and suggested fix
Every OnboardingOptionsModel and WalletQmlModel creates a BackendExecutor, whose constructor starts a QThread. Destruction calls shutdown, which queues work to the worker and then queues QThread::quit back to the GUI-owned QThread object. These harnesses never run the GUI event loop, so that quit request remains pending while subsequent inputs create more workers. Thread or memory limits can then produce failures unrelated to the current input. After each model is destroyed, call BackendExecutor::shutdownAll and run a bounded event loop until it drains, following the unit-test main's cleanup pattern.
[minor] · Inverted QSettings guard skips temporary-store isolation
A valid temporary directory skips QSettings redirection, leaving the harness on default user settings and allowing cross-input persistence where those writes succeed.
Location: test/fuzz/fuzz_options_model.cpp:104 (head).
Details and suggested fix
Both settings harnesses redirect QSettings only under if (!g_settings_dir.isValid()), the opposite of the intended successful setup. OptionsQmlModel reads default QSettings during construction and writes fuzz values through setters such as setThirdPartyTransactionUrls. ClearSettingsDir clears a directory that this store does not use, so successful writes can affect later inputs and runs. The exact destination and write success depend on Qt's platform and application identity. Reject an invalid temporary directory, otherwise configure a dedicated identity and temporary QSettings store before constructing models, and clear that actual store between inputs.
[minor] · Debug-log fuzzers request an external viewer on every input
Both debug-log harnesses call QDesktopServices::openUrl for their temporary log each iteration, repeatedly invoking desktop integration on supported local setups.
Location: test/fuzz/fuzz_debug_log_model.cpp:45 (head).
Details and suggested fix
Each harness writes debug.log before calling openLogFile, so its file-existence guard passes and the method sends a file URL to the operating system. On desktop configurations this can repeatedly open or signal the default viewer, adding uncontrolled external work to the mutation loop. Headless platforms may instead reject the request. Remove this call from both targets, or install a recording QDesktopServices handler for file URLs so the integration path has no external side effect.
[minor] · Crash collection searches the wrong directory and erases stored reproducers
libFuzzer writes default artifacts at the workspace root, but deployment clears the external crashes directory and searches only under build/test/fuzz.
Location: .github/workflows/fuzz.yml:273 (head).
Details and suggested fix
The targets run from the workspace root without -artifact_prefix. The corpus-directory argument does not change libFuzzer's default artifact destination, so crash, timeout and OOM inputs land outside the directory searched by deployment. On an enabled, authenticated main or manual deployment, the script first deletes previously stored crashes and then copies none of these new artifacts; it also searches only crash-* names. Create a per-target artifact directory, pass it through -artifact_prefix, collect all failure artifacts from there in an always-run upload step, and preserve existing stored reproducers.
[minor] · Coverage reporting has no source-profile instrumentation
The supplied build cannot produce the profraw files expected by llvm-cov, so reporting silently skips and an authenticated deployment clears the published coverage directory.
Location: .github/workflows/fuzz.yml:207 (head).
Details and suggested fix
The workflow sets LLVM_PROFILE_FILE, but neither its configure commands nor the fuzz targets enable -fprofile-instr-generate and -fcoverage-mapping. Sanitizer coverage used by libFuzzer does not produce these source profiles. The missing-profile guard therefore skips reporting without an error. Deployment still clears coverage/* and silently fails to copy a replacement, leaving the external index.html stale. Add a coverage build that instruments the backend, replays the corpus and treats missing profiles as an error, or remove this reporting and publishing path.
[minor] · TSan points at a nonexistent suppressions file
The thread job references test/sanitizer_suppressions/tsan instead of bitcoin/test/sanitizer_suppressions/tsan, causing the runtime to exit before fuzzing.
Location: .github/workflows/fuzz.yml:206 (head).
Details and suggested fix
Both the workflow and run_fuzz.sh configure a suppressions path under the top-level test directory. The tracked file is under bitcoin/test/sanitizer_suppressions/tsan, and neither setup creates a copy at the configured location. TSan reports an unreadable configured suppressions file and exits during initialization, so the thread job cannot execute inputs; the workflow's status suppression then hides that failure. Point both launch sites at the dependency's actual suppressions file.
[minor] · Default functional discovery omits a required test argument
With no test list, run_functional.sh invokes qml_test_fatal_exceptions.py without its required unit-test binary path, making the default suite report failure.
Location: test/functional/run_functional.sh:35 (head).
Details and suggested fix
The qml_test_*.py glob includes qml_test_fatal_exceptions.py, but every discovered script runs as python3 "$script" without arguments. That script requires a positional binary argument and otherwise exits through argparse with status 2. CTest already supplies bitcoinqml_unit_tests explicitly. Use an explicit test manifest, or exclude this helper-driven test from generic discovery and invoke it separately with its required binary.
[minor] · run_fuzz.sh ignores its requested target list
The helper parses TARGETS but always enumerates every fuzz executable, so asking for a focused run still runs the entire suite.
Location: test/fuzz/run_fuzz.sh:18 (head).
Details and suggested fix
After reading BUILD_DIR, MAX_TIME and MAX_LEN, the script stores the remaining arguments in TARGETS, but the execution loop unconditionally globs all fuzz_* executables. A requested single-target run therefore pays the whole suite's per-target time budget. Iterate over validated requested binaries when TARGETS is nonempty and use discovery only otherwise. Also consume only the positional options actually supplied, because shift 3 || true leaves all arguments untouched when fewer than three are present.
[minor] · README uses a nonexistent runner and the wrong argument order
The documented run.sh does not exist, and the actual run_fuzz.sh expects a build directory before the duration.
Location: test/fuzz/README.md:33 (head).
Details and suggested fix
The Running examples invoke ./test/fuzz/run.sh and ./test/fuzz/run.sh 60, but the added helper is run_fuzz.sh. Merely correcting the filename would still interpret 60 as BUILD_DIR rather than MAX_TIME. Update the examples to ./test/fuzz/run_fuzz.sh and ./test/fuzz/run_fuzz.sh build-fuzz 60, and describe the build-directory, duration and maximum-input-length positions.
[minor] · PSBT fuzzer mutates a host filename instead of PSBT bytes
Random filenames usually fail before decoding, while successful opens decode host content rather than the fuzz bytes, making decoder coverage host-dependent.
Location: test/fuzz/fuzz_psbtqmlmodel.cpp:30 (head).
Details and suggested fix
LoadPsbtFromFile receives QString::fromUtf8(raw) as its path and returns before decoding unless that host path opens. If it does open, readAll supplies existing file content to the raw and base64 decoders; special files can also block or exceed their reported size. Write the fuzz bytes to a regular file in QTemporaryDir and pass that controlled path, as the URI-content harness already does. Keep LocalFilePath normalization as a separate string-only check.
Optional improvements
[suggestion] · Security lint skips out-of-line invokable implementations
Header-declared invokables with separate implementation files become uncounted notes, so a successful scan does not establish that those QML/C++ boundaries were checked.
Location: test/fuzz/qml_security_lint.py:56 (head).
Details and suggested fix
The body lookup searches only the file containing Q_INVOKABLE. When no definition matches, it prints a note without increasing the warning count that determines success. Later scanning the .cpp file does not connect its definitions to the header declarations, as illustrated by BitcoinUriModel::parseBitcoinUri. Even matched bodies are accepted based on keywords such as an arbitrary if statement. Keep this step advisory and report analyzed versus unresolved methods rather than presenting its exit status as a security gate.
[suggestion] · IPC is disabled for ordinary builds as a fuzzing side effect
The unconditional normal-variable override disables Core's IPC option even with fuzzing off and shadows an explicit -DENABLE_IPC=ON request.
Location: CMakeLists.txt:46 (head).
Details and suggested fix
The new set(ENABLE_IPC OFF) runs before add_subdirectory(bitcoin), regardless of BUILD_FUZZ_TESTS. Core otherwise exposes an ON-by-default non-Windows option, and the parent variable takes precedence over the user's cache value. Keep this restriction in the fuzz entry points by adding -DENABLE_IPC=OFF to build.sh and the manual README command; the workflow and run_fuzz.sh already pass it. If disabling IPC project-wide is intentional, make that a separately documented build-policy change.
[suggestion] · The new encryption lifecycle test is not registered in functional CI
The workflow's explicit script list omits this test, so its new password-setting and password-changing assertions do not run in GUI functional CI.
Location: test/functional/qml_test_wallet_encryption_lifecycle.py:293 (head).
Details and suggested fix
gui-functional-tests.yml invokes individual scripts rather than discovering qml_test_*.py. It includes the existing password-wallet and wallet-settings tests but not qml_test_wallet_encryption_lifecycle.py, and this PR adds no CTest registration for it. Add the new script to that workflow step so these assertions run with the same automation-enabled application and bitcoind setup.
[suggestion] · Recoverable UBSan reports do not produce fuzz crash inputs
UBSan recovery remains enabled, so recoverable diagnostics print and continue without making libFuzzer save the triggering input.
Location: .github/workflows/fuzz.yml:205 (head).
Details and suggested fix
The targets use -fsanitize=undefined without disabling recovery, and neither the workflow nor run_fuzz.sh sets UBSAN_OPTIONS. Recoverable checks can therefore report undefined behavior while the process continues successfully, leaving no crash input for reproduction. Set UBSAN_OPTIONS=halt_on_error=1:print_stacktrace=1 in both launch environments, or compile with -fno-sanitize-recover=all, so these reports become failures libFuzzer can capture.
[suggestion] · The progress harness uses undefined type-punning
Dereferencing a double pointer to the uint64_t object violates strict aliasing when constructing the fuzzed progress value.
Location: test/fuzz/fuzz_syncprogresstracker.cpp:31 (head).
Details and suggested fix
The harness assembles bits as a uint64_t and then accesses that object through *reinterpret_cast<double*>(&bits). This remains undefined behavior in C++20 and is not reliably diagnosed by the configured sanitizers. Include <bit> and use std::bit_cast<double>(bits) to preserve the intended arbitrary double representation, including NaNs and infinities, with defined semantics.
[suggestion] · Two config targets build the same harness
fuzz_bitcoin_conf_parsing duplicates fuzz_bitcoin_conf, adding another build and per-sanitizer run budget without a distinct parser exercise.
Location: test/fuzz/CMakeLists.txt:54 (head).
Details and suggested fix
Both targets compile fuzz_bitcoin_conf.cpp through the same helper, and that source already calls both ReadConfigString and ReadConfigStream. Separate randomized runs may explore more inputs, but these names do not represent different harness behavior. Remove fuzz_bitcoin_conf_parsing and its README entry, or give it a separate harness if a distinct exercise was intended.
[suggestion] · The static RPC console model retains state between fuzz inputs
History and pending execution survive the per-input reset, so later inputs can behave differently depending on earlier commands and worker timing.
Location: test/fuzz/fuzz_rpc_console_model.cpp:26 (head).
Details and suggested fix
The static RpcConsoleModel lives for the entire fuzz process. clear resets only output rows, while resetHistoryNavigation clears only the cursor and pending text. Command history therefore feeds later browseHistory calls, and m_executing remains set until a worker reply is delivered. The 20 ms event loop does not guarantee that delivery, so later submissions can be refused. Construct a model per input and drain its worker before teardown, or reset all test state only after pending execution completes. A resulting history-dependent crash has not been demonstrated.
[suggestion] · The fee-bump fuzzer stops before model input handling
Passing a null wallet makes preparation return before txid parsing or target use, while confirmation also returns at its initial guard.
Location: test/fuzz/fuzz_bump_transaction_model.cpp:30 (head).
Details and suggested fix
The harness always constructs BumpTransactionModel with nullptr. prepareFeeBump checks that pointer before uint256::FromHex or targetBlocks, and confirmFeeBumpInternal rejects the same missing wallet. Thus mutations exercise harness decoding but not the model's preparation inputs. The README excludes the confirmation path, but preparation and txid parsing are unreachable too. Supply a wallet fixture with controlled fee-bump results, or omit this target until such a fixture is available.
[suggestion] · The recursive build ignore rule also hides new source files
**/build* matches build-prefixed names at every depth and overrides the existing root exceptions, although the root pattern already covers build-fuzz.
Location: .gitignore:5 (head).
Details and suggested fix
Unlike the existing /*build*, the added pattern also matches new files such as qml/buildfoo.cpp and re-ignores build-aux and build_msvc after their negations. Already tracked files remain tracked, but ordinary git add skips new matching source files. Remove the recursive rule; the existing root pattern already ignores /build-fuzz.
[suggestion] · The enabled-shadowing tolerance accepts warnings from every object
The wildcard suppresses both known and future enabled-override diagnostics, removing this stderr check's signal for newly introduced property shadowing.
Location: test/functional/qml_process_checks.py:13 (head).
Details and suggested fix
The new expected-stderr pattern uses of the object .* overrides, so any QML object producing this warning is accepted. That goes beyond tolerating the existing components and allows future enabled-shadowing warnings through the same check. Narrow the expression to the known component types, or remove the custom shadowing properties and then remove the tolerance. Other tests may still detect behavioral effects, but this diagnostic check will not.
[suggestion] · An explicit fuzz-build request can succeed without defining fuzz targets
With a non-Clang compiler, BUILD_FUZZ_TESTS=ON only warns and returns, leaving a successful configuration with no requested fuzz binaries.
Location: test/fuzz/CMakeLists.txt:6 (head).
Details and suggested fix
The compiler guard exits test/fuzz before defining targets, even though entering this directory means the user explicitly enabled BUILD_FUZZ_TESTS. A warning can be overlooked and leaves downstream tools with no fuzz executables. Use message(FATAL_ERROR) for this unsupported request. The supplied scripts already select Clang, so this change would affect only other configurations and would not interfere with normal fuzz-disabled builds.