Skip to content

Marketplace node: input chain accepts established/related before the anti-spoof check #374

Description

@v0l

Found in review of #370.

lnvps_node/src/fw.rs:533-560 builds the input chain in this order:

  1. iif lo accept
  2. ct state {established,related} accept
  3. iif br-lnvps jump source (the anti-spoof check)

The forward chain deliberately does the opposite — the anti-spoof jump comes first, with the comment "Checked before anything else, including established connections" (fw.rs:455-470) — and lnvps_node/src/fw/tests.rs:248-269 asserts that ordering for forward only.

Conntrack lookup is interface-agnostic, so a guest that spoofs the route server's source address and matches an existing LNVPS↔node flow is accepted by rule 2 without ever reaching the source-address check: TCP injection or reset against a live control-API or libvirt session.

Fix is the same as the forward chain — jump to the source check before the conntrack accept — plus the mirror test, whose absence is why the two chains drifted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions