java-topology/tools/tickets/scans/bird.md
russell@unturf.com db29a08762 undefect. CWE-407 — 92 sites, 42 ecosystems
B&W print-friendly diagrams + tinkerpop-0001 + wave-3 proof sections.
Squash of 94 local commits onto remote master.
2026-03-26 19:48:18 -04:00

2.1 KiB

id priority status created
scan-bird medium unscanned 2026-03-23

Target

Repo: https://gitlab.nic.cz/labs/bird Language: C Why: Used globally on IXP route servers — linear visited-list scans in OSPF topology or BGP path processing degrade convergence on large peering fabrics.

Scan command

# Shallow clone
git clone --depth 1 https://gitlab.nic.cz/labs/bird /tmp/bird

# Submit to unsandbox
cat > /tmp/scan-bird.sh << 'EOF'
#!/usr/bin/env bash
set -euo pipefail
GRAPH_KW="tarjan|strongly.connected|dfs|scc|topolog|topo.sort|cycle|reachab|postorder|dominator|liveness|digraph|shortest.path|path.find"
MEM="node.*next|list_walk|WALK_LIST|add_tail|rem_node|linear.*scan|visited\[|in_queue|path_check"
find /tmp/bird/proto -name "*.c" -o -name "*.h" | sort | while read f; do
  graph_lines=$(grep -inE "$GRAPH_KW" "$f" 2>/dev/null | cut -d: -f1 | head -5 || true)
  [ -z "$graph_lines" ] && continue
  while IFS= read -r lineno; do
    s=$(( lineno > 20 ? lineno - 20 : 1 )); e=$(( lineno + 20 ))
    hit=$(sed -n "${s},${e}p" "$f" 2>/dev/null | grep -iE "$MEM" | head -1 | sed 's/^\s*//' || true)
    [ -n "$hit" ] && echo "CANDIDATE\t${f}:${lineno}\t${hit}"
  done <<< "$graph_lines"
done
EOF
export UNSANDBOX_PUBLIC_KEY=unsb-pk-russ-test-isth-best
export UNSANDBOX_SECRET_KEY=unsb-sk-rk46c-3zvpg-zjf6z-hjrge
~/git/un-inception/build/un /tmp/scan-bird.sh

Key files to check

  • proto/bgp/bgp.c — BGP protocol core; AS-path loop detection via linear list walk
  • proto/ospf/topology.c — OSPF topology database; LSA graph traversal
  • proto/ospf/spf.c — SPF computation; open/closed set membership

Expected pattern

WALK_LIST(path, node) or equivalent manual node = node->next iteration used to check AS-path membership or SPF closed-set membership — BIRD uses intrusive linked lists throughout, making this a likely O(N) scan pattern.

Acceptance criteria

  • Scan run and results saved to tools/scan-results/bird.txt
  • All CANDIDATE hits triaged (confirmed defect or false positive)
  • If confirmed: defect ticket created in tools/tickets/defects/