AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Informational 23 Bitcoin

test: avoid non-loopback network traffic from node_init_tests/init_test

Public commit record

What the developer wrote

Authored by Vasil Dimov

100/100 · Strong
test: avoid non-loopback network traffic from node_init_tests/init_test

The test calls:
`AppInitMain()` -> `StartMapPort()` -> `StartThreadMapPort()` ->
`ThreadMapPort()` -> `ProcessPCP()` -> `PCPRequestPortMap()` ->
`CreateSock()` and on the returned value from `CreateSock()` it calls
the `Connect()` method.

Thus, change `BasicTestingSetup::BasicTestingSetup()` to set `-natpmp`
to 0. This way `node_init_tests/init_test` or other tests will not do
network activity due to `ThreadMapPort()`.

Also add a comment about `natpmp=0` in
`test/functional/test_framework/util.py`.

Also set `-dnsseed=0` in `BasicTestingSetup::BasicTestingSetup()` to
avoid DNS queries.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification
The short version

What changed, and why it matters

This is a test-hardening change, not a fix for an exploitable vulnerability in live Bitcoin Core. The patch stops automated tests from accidentally sending real network traffic (router NAT-PMP packets and DNS queries) to non-localhost destinations. It does not change how normal node software behaves when users run it.

Recommended action

No urgent action required. Treat as routine test hygiene. Reviewers may want to confirm that all test entry points inherit BasicTestingSetup and that no other test paths still enable UPnP/NATPMP or DNS seeding by default.

Security signals we found

01

Network egress from test harnesses can leak test activity, trigger IDS, or interact with local routers/DNS resolvers

02

NATPMP and DNSSEED are disabled only inside test setup code via ForceSetArg

03

No change to production defaults or consensus/network code

04

Commit title and message describe the change as test-only hardening

Risk score

Why this scored 23/100

Our methodology →
Potential impact 4/30
Exploitability 2/25
Stealth signal 3/15
Affected reach 2/15
Confidence 8/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.