java-topology/tools/tickets/scans/exabgp.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.2 KiB

id priority status created
scan-exabgp critical unscanned 2026-03-23

Target

Repo: https://github.com/Exa-Networks/exabgp Language: Python Why: Pure Python BGP implementation with no native-extension escape hatch — linear-scan AS-path loop detection is near-certain CWE-407 with no JIT to soften the blow.

Scan command

# Shallow clone
git clone --depth 1 https://github.com/Exa-Networks/exabgp /tmp/exabgp

# Submit to unsandbox
cat > /tmp/scan-exabgp.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="in path|in stack|in visited|in self\._|\.index\(|not in path|not in stack|in aspath|in as_path|loop"
find /tmp/exabgp/src -name "*.py" | 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-exabgp.sh

Key files to check

  • src/exabgp/bgp/message/update/attribute/aspath.py — AS-path parsing and loop detection; x in list on AS number sequences
  • src/exabgp/bgp/message/update/ — UPDATE message processing pipeline; any DFS or path traversal
  • src/exabgp/rib/ — RIB/FIB data structures; route list membership checks

Expected pattern

asn in self._asns or asn in path where path or _asns is a Python list in the AS-path loop-detection method, called once per received BGP UPDATE — linear in path length with no set-based acceleration.

Acceptance criteria

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