Netdata: well-engineered with Judy arrays, dictionaries, hash tables throughout. No CWE-407 defects found. Telegraf: dedup processor Apply() calls m.GetField(f.Key) O(F) inside field comparison loop → O(F²). Fix: build field map for O(1) lookup. 125x overhead at F=500.
1.4 KiB
1.4 KiB
Netdata — CWE-407 Scan Result: CLEAN
Date: 2026-03-30 Scanner: agent blackops Target: https://github.com/netdata/netdata (depth=1) Language: C + Go
Scan Coverage
src/health/— alarm templates, silencers, prototypessrc/streaming/— stream path, replication, capabilitiessrc/database/— rrdlabels, rrdhost, rrdset, rrddim, contexts, query_target, enginesrc/libnetdata/— adaptive_resortable_list, dictionary, facets, string dedup, user-authsrc/web/— websocket JSONRPC, MCP, API v1src/exporting/— Prometheus exporter server listsrc/registry/— person/machine URL trackingsrc/collectors/— ebpf, log2journalsrc/go/plugin/— job manager, SNMP profile loader, multipath, weblog collector
Findings
No CWE-407 defects found. Netdata's core data structures are well-engineered:
- Judy arrays (JudyL, JudyHS) for labels, metrics registry
- Dictionary (hash-table based) for rrdhost, rrdset, rrddim, contexts
- SIMPLE_HASHTABLE for facets value indexing
- Bitmask dedup for HTTP access flags, RRDR options, stream capabilities
- Adaptive Resortable List (self-sorting linked list) for /proc parsing — amortized fast path
- STRING dedup via global hash table for string interning
The few linked-list scans found (registry person URLs, Prometheus server list, health silencer list) are per-request lookups, not inside nested loops. No O(N²) membership patterns detected.