fuzz: set whitelist permissions on connman target
What changed, and why it matters
This commit adds fuzz-testing coverage for whitelist permission settings inside a test harness. It does not change production network code, user-facing behavior, or fix a live vulnerability. It is a test-quality improvement that helps automated fuzzers explore more code paths in CConnman initialization.
No action required. Treat as a routine test/fuzzing improvement. If auditing, verify that the fuzz target still builds and that the new ConsumeSubNet/ConsumeWeakEnum helpers do not introduce undefined behavior in the harness itself.
Security signals we found
Touches permission/whitelist code, but only in a fuzz target
Adds new fuzz input surface for CConnman initialization
No bounds, validation, or logic changes in production code
Evidence from the diff
The diff extends the existing fuzz target src/test/fuzz/connman.cpp by populating CConnman::Options::vWhitelistedRangeIncoming and vWhitelistedRangeOutgoing with randomly generated NetWhitelistPermissions. A local lambda consume_whitelist() creates 0-3 entries, each with random permission flags and random subnets, before connman.Init(options) is called. This only affects the fuzzing harness and increases coverage of whitelist-related initialization logic; no runtime Bitcoin Core behavior is altered.
Changed components
src/test/fuzz/connman.cppInspect captured patch +12 / −0
diff --git a/src/test/fuzz/connman.cpp b/src/test/fuzz/connman.cpp
index 4a8b7b21..76c85df7 100644
--- a/src/test/fuzz/connman.cpp
+++ b/src/test/fuzz/connman.cpp
@@ -79,6 +79,18 @@ FUZZ_TARGET(connman, .init = initialize_connman)
CConnman::Options options;
options.m_msgproc = &net_events;
options.nMaxOutboundLimit = max_outbound_limit;
+
+ auto consume_whitelist = [&]() {
+ std::vector<NetWhitelistPermissions> result(fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, 3));
+ for (auto& entry : result) {
+ entry.m_flags = ConsumeWeakEnum(fuzzed_data_provider, ALL_NET_PERMISSION_FLAGS);
+ entry.m_subnet = ConsumeSubNet(fuzzed_data_provider);
+ }
+ return result;
+ };
+ options.vWhitelistedRangeIncoming = consume_whitelist();
+ options.vWhitelistedRangeOutgoing = consume_whitelist();
+
connman.Init(options);
CNetAddr random_netaddr;
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.