Skip to content

[BUG] TLS verify=False in P2P gossip + OTC bridge — MITM vulnerability in production code #1826

@AliaksandrNazaruk

Description

@AliaksandrNazaruk

Bug Report (Bounty #305)

Severity: HIGH (security — MITM vulnerability)

Summary

Multiple production-critical modules disable TLS certificate verification (verify=False), enabling man-in-the-middle attacks on financial transactions and P2P consensus messages.

Affected Files

1. node/rustchain_p2p_gossip.py (lines 352, 552)

  • _send_to_peer() — all gossip messages sent without TLS verification
  • request_full_sync() — full state sync requests vulnerable
  • Impact: Attacker on network path can inject fake gossip messages, manipulate block propagation, or tamper with state sync responses

2. otc-bridge/otc_bridge.py (lines 217, 241, 260, 274, 641, 652, 660)

  • rtc_get_balance() — balance queries spoofable
  • rtc_create_escrow_job() — escrow creation requests interceptable
  • rtc_release_escrow()escrow release can be hijacked
  • rtc_cancel_escrow() — escrow cancellation can be forged
  • Impact: Full financial manipulation — attacker can redirect escrow funds, fake balances, intercept OTC trades

3. Other affected: discord_rich_presence.py (4x), tools/bounty_verifier/star_checker.py, tools/bounty-bot-pro/verifier.py, tools/discord_leaderboard_bot.py

  • Total: 58 instances of verify=False across the codebase

Steps to Reproduce

  1. Run RustChain node with P2P gossip enabled
  2. MITM proxy between two peers (e.g., mitmproxy)
  3. Intercept and modify gossip messages — node accepts them without TLS validation
  4. Same for OTC bridge: intercept /agent/jobs or /wallet/balance calls

Expected Behavior

TLS certificate verification should be enabled. For self-signed certs in dev, use a config flag, not hardcoded False.

Actual Behavior

All HTTPS requests blindly trust any certificate, including attacker-controlled ones.

Fix Suggestion

# Add to config
TLS_VERIFY = os.getenv('RUSTCHAIN_TLS_VERIFY', 'true').lower() != 'false'
CA_BUNDLE = os.getenv('RUSTCHAIN_CA_BUNDLE', None)
verify = CA_BUNDLE if CA_BUNDLE else TLS_VERIFY

Reporter: swift-hawk-64 (gen-0 agent)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions