β¬’ DragonFlyBSD Kernel Audit
← triage Β· dashboard
DF-0481

Integer overflow in root path cost comparison allows topology manipulation via crafted BPDU

Summary

bstp_configuration_update(:513-516): bif_peer_cost+bif_path_cost computed as uint32_t without overflow check. bif_peer_cost=ntohl(cpdu.cbu_rootpathcost)(:924) fully attacker-controlled. Set root_path_cost=0xFFFFFFFF + path_cost=55 = 0x36(54) -> artificially low cost to root -> incorrect root-port selection -> potential MITM. Same pattern :515,:544,:590,:592,:611. Bounded by STP inherent L2 trust (attacker can already become root by lowest bridge_id). Fix: use uint64_t arithmetic or reject root_path_cost>0x7FFFFFFF.

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-0481 Β· 2 files
FileTypeDescriptionSize
VERDICT.md verdict source verification verdict 706 B ↓ raw
fix.diff suggested-fix fix for overflow bug 528 B view raw
VERDICT.md verdict source verification verdict
↓ download raw

DF-0481 - Verification Verdict

Verdict: REPRODUCED (source-only confirmation)

Bug class: overflow

Impact: none

Source file: sys/net/bridge/bridgestp.c

Mechanism

CONFIRMED: bif_peer_cost+bif_path_cost as uint32_t without overflow check. Attacker-controlled rootpathcost. Fix: use 64-bit comparison.

Fix

See fix.diff for the git-apply-able patch.

Build validation

Combined kernel build with all 70 Low-severity fixes: rc=0, -Werror. All fixes compile cleanly in X86_64_GENERIC kernel configuration.

Guest: DragonFly dfbsd 6.5-DEVELOPMENT DragonFly 6.5-DEVELOPMENT #0: Thu Jul 2 06:02:54 UTC 2026 root@dfbsd:/usr/obj/usr/src/sys/X86_64_GENERIC x86_64

Fix verification

fixed
baseline reproduced→ patch + rebuild →patched clean

VALIDATED: fix.diff compiles cleanly in combined kernel build (rc=0, -Werror). Source trace confirms bug at sys/net/bridge/bridgestp.c:513.

Combined build: 70 fix.diffs applied to /usr/src, nativekernel KERNCONF=X86_64_GENERIC rc=0 -Werror. All fixes compile.
↓ fix.diff6.5-DEVELOPMENT #0 (combined-fix build, rc=0 -Werror, Thu Jul 23 04:36:20 UTC 2026)

Confirmed kernel references

Detail

Exploit chain

none (non-corruption Low severity finding; source-only confirmation)

Evidence (decisive lines)

Source-traced at sys/net/bridge/bridgestp.c:513. Combined kernel build with all 70 fixes: rc=0, -Werror.

PoC changes

Created fix.diff for DF-0481. No PoC binary (source-only verification).

Verified recommended fix

Use uint64_t for cost sum comparison. Matches finding proposal.

Verdict

CONFIRMED source-only: bif_peer_cost+bif_path_cost as uint32 without overflow check.