wave13: 514/239 — flink/nifi/artemis + K8s/cilium/linkerd2 + ES/OpenSearch/Solr + hadoop/hbase/spark

This commit is contained in:
russell@unturf.com 2026-03-27 17:50:40 -04:00
parent 424a2a7787
commit 8f0bc73afa
32 changed files with 3977 additions and 5 deletions

View file

@ -1 +1 @@
6398524e9a6526510578579638ba7676 undefect-cwe407-2026-03-27.pdf
d42ef558bf1ecd691b38c5a464b95874 undefect-cwe407-2026-03-27.pdf

View file

@ -39,8 +39,8 @@ A single well-crafted implementation serves as the genetic blueprint.
4. **Harvest Stage:** Mature implementations compile into comprehensive documentation, ready for use
Code propagates according to its kind — clean architecture begets clean implementations,
elegant solutions inspire elegant variations. The process of generating 501 validated
defect patches across 237 ecosystems in a single research wave demonstrates how truth,
elegant solutions inspire elegant variations. The process of generating 514 validated
defect patches across 239 ecosystems in a single research wave demonstrates how truth,
properly seeded, multiplies. Each tested patch validates the correctness of the original
diagnosis & extends light into new programming paradigms.
@ -159,7 +159,7 @@ the missing linkages, applied them, tested them, and benchmarked them across eve
confirmed site — compiler, routing, database, build tool, event streaming, web framework,
query optimizer, and browser runtime.
**501 sites patched. 3 deferred (PostgreSQL -0001/-0005; MongoDB -0005 IndexBounds).
**514 sites patched. 3 deferred (PostgreSQL -0001/-0005; MongoDB -0005 IndexBounds).
1 fixable-upstream (Erlang OTP). 1 fixable-pending (swipl-0003). 2 not-worth-fixing.
3 unpatched (Minecraft, Create mod). No language left behind.
@ -384,6 +384,7 @@ stacks, Spark schemas — this is the dominant build cost.
| kubernetes-0004 | Kubernetes | `pkg/util/taints/taints.go:260` — `TaintSetDiff` `TaintExists` O(T) nested in taint diff loop; O(T²) in `doNoScheduleTaintingPass`; fix: taint key map (100×) | **PATCHED** |
| kubernetes-0005 | Kubernetes | `pkg/scheduler/framework/plugins/tainttoleration/taint_toleration.go:180` — `countIntolerableTaintsPreferNoSchedule` O(T×L) per scheduling cycle; fix: pre-built toleration set (20×) | **PATCHED** |
| kubernetes-0006 | Kubernetes | `pkg/controller/tainteviction/taint_eviction.go:533` — `GetMatchingTolerations` O(T×L) per pod per node-taint event; fix: toleration map (2×) | **PATCHED** |
| kubernetes-0007 | Kubernetes | `pkg/controller/job/pod_failure_policy.go` — `PodFailurePolicy` exit-code list scanned O(R×C×V) per container-status per pod; fix: pre-built `map[int32]struct{}` exit-code set per rule | **PATCHED** |
| go-0001 | Go compiler | `src/cmd/compile/internal/types2/infer.go` — `tpWalker.isParameterized()` `slices.Index(tparams)` O(n) per `*TypeParam`; O(n²) total (200×) | **PATCHED** |
| kotlin-0002 | Kotlin compiler | `compiler/frontend/src/org/jetbrains/kotlin/types/TypeBoundsImpl.kt` — `bounds ArrayList.contains()` O(n) per `addBound()`; O(n²) constraint system (250×) | **PATCHED** |
| scala-0001 | Scala compiler | `src/compiler/scala/tools/nsc/typechecker/Checkable.scala` — `to.baseClasses.contains(bc)` O(M×N) per pattern match expression; fix: `toSet` before loop (50×) | **PATCHED** |
@ -402,7 +403,10 @@ stacks, Spark schemas — this is the dominant build cost.
| istio-0002 | Istio | `pilot/pkg/model/push_context.go:1839` — `slices.Contains(rule.Gateways, ...)` in `VirtualService` foreach over gateways; O(V×G) reconciliation; fix: `map[string]bool` gateway set | **PATCHED** |
| cilium-0001 | Cilium | `pkg/labels/selector.go` — `Requirement.hasValue()` `slices.Contains(strValues)` per identity in selector cache; fix: `map[string]struct{}` (100×) | **PATCHED** |
| cilium-0002 | Cilium | `pkg/policy/rule.go:310` — `L7Rules.Exists()` `slices.ContainsFunc` O(N×M) in `mergeL4Filter()` per CNP reconciliation; fix: `map[ruleKey]struct{}` pre-index (50×) | **PATCHED** |
| cilium-0003 | Cilium | `pkg/node/manager/manager.go` — `ipAddresses []nodeTypes.Address` scanned O(A) per new-address in `nodeAddressChanged()` hot path; O(N×A) per reconciliation cycle; fix: `map[string]nodeTypes.Address` (13×) | **PATCHED** |
| cilium-0004 | Cilium | `pkg/ebpf/verifier/cfg.go` — `predecessors []int` scanned `slices.Contains` O(P) per edge in CFG analysis inner loop; O(E×P) total; fix: `map[int]struct{}` (6×) | **PATCHED** |
| linkerd2-0001 | Linkerd2 | `controller/api/destination/server.go` — `federatedService.update()` `slices.Contains` in O(N²) diff; fix: `remoteDiscovery map[ID]struct{}` (1,650×) | **PATCHED** |
| linkerd2-0002 | Linkerd2 | `proxy-injector/inject.go` — `opaque-ports annotation List.contains()` scanned per-container-port in inject loop; O(C×P); fix: `map[int]struct{}` (10×) | **PATCHED** |
| linux-0001 | Linux kernel | `kernel/auditsc.c` — `audit_filter_inodes()` O(F²×R) per syscall exit; audit rule × names re-scan; fix: inode hash bucket routing | **PATCHED** |
| linux-0002 | Linux kernel | `net/core/dev.c` — `__dev_alloc_name()` O(D×A) nested sscanf per alt-name on interface rename; fix: per-prefix bitmap | **PATCHED** |
| linux-0003 | Linux kernel | `net/core/neighbour.c` — `lookup_neigh_parms()` O(P) linear ifindex scan per neighbour lookup; fix: `rhashtable` | **PATCHED** |
@ -427,6 +431,7 @@ stacks, Spark schemas — this is the dominant build cost.
| geth-0001 | go-ethereum | `eth/filters/filter.go` — `FilterLogs` O(n×logs) address slice scan per block; fix: `map[common.Address]struct{}` (357×) | **PATCHED** |
| hadoop-0002 | Apache Hadoop | `hdfs/server/blockmanagement/PendingReconstructionBlocks.java` — O(B×R) pending block scan per reconstruction event; fix: `HashSet` (301×) | **PATCHED** |
| hadoop-0003 | Apache Hadoop | `hdfs/server/blockmanagement/StoragePolicySatisfier.java` — O(T×N×E) storage policy evaluation scan; fix: type-indexed `HashSet` (49×) | **PATCHED** |
| hadoop-0004 | Apache Hadoop | `hdfs/server/balancer/Dispatcher.java` — `srcBlocks ArrayList.contains()` O(B²) in block selection loop + `MovedBlocks.locations ArrayList.contains()` O(B²) in move recording; fix: `HashSet` at both sites (1000×) | **PATCHED** |
| keystone-0001 | Keystone | `keystone/assignment/` — implied role computation O(R²) per token validation; fix: pre-computed role graph | **PATCHED** |
| keystone-0002 | Keystone | `keystone/token/` — `token_roles` list O(N) scan per auth check; fix: `set` (100×) | **PATCHED** |
| libgit2-0001 | libgit2 | `src/libgit2/refs.c` — `git_refdb_backend_fs.ref_available()` O(R) packed-ref list scan per segment per path check; O(R²) total; fix: binary search on sorted refs (17 sites) | **PATCHED** |
@ -561,6 +566,7 @@ stacks, Spark schemas — this is the dominant build cost.
| hive-0002 | Apache Hive | `optimizer/GenMRProcContext.java:142` — `List<FileSinkOperator>.contains()` in file sink dedup | **PATCHED** |
| spark-0001 | Apache Spark | `sql/catalyst/.../analysis/Analyzer.scala:3286` — `ArrayBuffer[AggregateExpression].contains(agg)` in window func extraction | **PATCHED** |
| spark-0002 | Apache Spark | `core/src/main/scala/.../scheduler/DAGScheduler.scala` — 6 BFS traversal functions use `ListBuffer.remove(0)` O(N) dequeue; O(N²) total; fix: `ArrayDeque` | **PATCHED** |
| spark-0003 | Apache Spark | `core/src/main/scala/.../deploy/master/Master.scala` — `completedApps ArrayBuffer[ApplicationInfo].contains()` inside `for (worker)` loop on worker failure; O(A×C); fix: `HashSet` (200×–1000×) | **PATCHED** |
| hudi-0001 | Apache Hudi | `BaseHoodieTimeline.java:126` — `List<HoodieInstant>.contains()` in appendLoadedInstants stream filter; O(N×M) (625×) | **PATCHED** |
| hudi-0002 | Apache Hudi | `InternalSchemaUtils.java:69,113` — `ArrayList<Integer>.contains()` in pruneInternalSchema forEach+pruneType; O(N²)+O(F×D) (90×) | **PATCHED** |
| hudi-0003 | Apache Hudi | `HoodieTableMetadataUtil.java:1006` — `List<String>.contains()` in log file dedup filter; O(N×M) (312×) | **PATCHED** |
@ -578,6 +584,9 @@ stacks, Spark schemas — this is the dominant build cost.
| kafka-0005 | Apache Kafka | `AbstractStickyAssignor.java:1052` — `consumerSubscription.topics() List<String>.contains()` inside for-in-for loop; O(C×P×T) (300×) | **PATCHED** |
| flink-0002 | Apache Flink | `table/api/.../RowTypeUtils.java:43,49` — `checklist/result List<String>.contains()` in nested for+do-while; O(N×M²) field dedup (37×) | **PATCHED** |
| flink-0003 | Apache Flink | `flink-table/.../AggregateReduceGroupingRule.java:88` — `newGroupingList List<Integer>.contains()` inside for loop; O(G²) query planning (50×) | **PATCHED** |
| flink-0004 | Apache Flink | `flink-table/.../DynamicSinkUtils.java` — `updatedColumnNames List<String>.contains()+indexOf()` in schema-columns loop; O(C×U); fix: `HashSet`+`Map` (48×) | **PATCHED** |
| nifi-0001 | Apache NiFi | `StandardControllerServiceProvider.determineEnablingOrder()` — recursive topo-sort uses `List<ControllerServiceNode>.contains()` O(S²); same structural defect as airflow/maven; fix: companion `HashSet` (16.7×) | **PATCHED** |
| artemis-0001 | ActiveMQ Artemis | `BindingsImpl.routeFromCluster()` — `idsToAckList List<Long>.contains()` inside `while (buff.hasRemaining())` per-message hot routing loop; O(R×A); fix: `HashSet<Long>` (25×) | **PATCHED** |
| pulsar-0001 | Apache Pulsar | `client/.../GetTopicsResult.java:117` — `grouped ArrayList.contains()` in for loop over topic list; O(N²) dedup (25×) | **PATCHED** |
| pulsar-0002 | Apache Pulsar | `functions/runtime/.../JavaInstanceRunnable.java:987` — `allFields List<String>.contains()` in for loop; O(F×K) schema field scan (87×) | **PATCHED** |
| kafka-0006 | Apache Kafka | `streams/.../tasks/DefaultTaskManager.java:62,105` — `lockedTasks ArrayList<TaskId>.contains()` in `assignNextTask()` per executor cycle; O(T×L) rebalance stall (76×) | **PATCHED** |
@ -719,6 +728,9 @@ stacks, Spark schemas — this is the dominant build cost.
| opensearch-0001 | OpenSearch | `server/src/main/java/.../ImmutableCacheStatsHolder.java` — `filterLevels()` O(n²) `levelsList.contains()` per stat level; fix: `HashSet` | **PATCHED** |
| opensearch-0002 | OpenSearch | `server/src/main/java/.../MustToFilterRewriter.java` — `rewrite()` O(n²) filter dedup `List.contains()`; fix: `HashSet` (500×) | **PATCHED** |
| elasticsearch-0003 | Elasticsearch | `libs/x-content/src/main/java/.../XContentHelper.java` — `mergeList()` `List.contains()` O(n) inside outer merge loop; O(N²) merge of large arrays (150×) | **PATCHED** |
| elasticsearch-004 | Elasticsearch | `server/src/main/java/.../IndexGraveyard.java` — `containsIndex()` O(T) linear tombstone scan called per-index-file in `DanglingIndicesState` loop; O(I×T) total; fix: `HashSet<Index>` per scan (250×) | **PATCHED** |
| opensearch-0005 | OpenSearch | `server/src/main/java/.../IndexGraveyard.java` — same `containsIndex()` O(T) defect as ES + additional `removeIf(graveyard::containsIndex)` exposure; fix: `HashSet<Index>` (250×) | **PATCHED** |
| solr-003 | Apache Solr | `solr/core/src/java/.../SplitShardCmd.java` — `subSlices List<String>.contains()` in `cleanupAfterFailedSplit()` slices loop; O(S×n) where n=MAX_NUM_SUB_SHARDS=8; fix: `HashSet<String>` (8×) | **PATCHED** |
| opensearch-0003 | OpenSearch | `server/src/main/java/.../IndexShardRoutingTable.java:1065` — `weightedRoutings List<ShardRouting>.contains()` in stream filter; O(N²) shard routing selection (200×) | **PATCHED** |
| opensearch-0004 | OpenSearch | `server/src/main/java/.../SegmentReplicationTargetService.java` — `shardsToFetch List.contains()` O(S×F) in segment replication fetch loop (50×) | **PATCHED** |
| solr-0001 | Apache Solr | `solr/core/src/java/.../ClusterStatusCommand.java` — `liveNodes List.contains()` O(n) per replica per status request; fix: `Set` (100×) | **PATCHED** |
@ -729,6 +741,7 @@ stacks, Spark schemas — this is the dominant build cost.
| raylib-0002 | raylib | `src/rshapes.c` — `GenerateImageCellular()` random-sequence dedup O(n²) `std::find`; fix: `HashSet` | **PATCHED** |
| hadoop-0001 | Apache Hadoop | `hdfs/server/blockmanagement/HeartbeatManager.java` — `ArrayList<DatanodeDescriptor>.contains()` O(K) dead-node check per storage per datanode; O(D×S×K) per heartbeat cycle; fix: `HashSet` (3.3×) | **PATCHED** |
| hbase-0001 | Apache HBase | `hbase-server/.../store/DefaultStoreFileManager.java` — `filesCompacting ArrayList.contains()` O(C) per store file in `getUnneededFiles()`; O(F×C) per compaction; fix: hoisted `HashSet` (43×) | **PATCHED** |
| hbase-0002 | Apache HBase | `hbase-server/.../master/balancer/BaseLoadBalancer.java` — `usedSNs ArrayList.contains()` O(S) per random-slot selection in O(S²) assignment loop; fix: `HashSet` (402×–1591×) | **PATCHED** |
| nova-0001 | OpenStack Nova | `nova/scheduler/filters/affinity.py` — `_GroupAffinityFilter.host_passes()` `group_hosts list.contains()` O(G) per host per filter; fix: `set` (50×) | **PATCHED** |
| nova-0002 | OpenStack Nova | `nova/scheduler/filters/` — `policies` list scan per host in scheduler filter pass; fix: `frozenset` before loop | **PATCHED** |
| neutron-0001 | OpenStack Neutron | `neutron/agent/linux/iptables_firewall.py` — `trusted_ports List.contains()` + `remove()` O(n²) per port update; fix: `set` (50×) | **PATCHED** |
@ -776,7 +789,7 @@ where D is the depth of the diamond chain. For a diamond of depth 10, that is 2^
1,024 redundant node visits per edge check. Large modpacks produce diamond dependency
chains with depths in this range.
**501 sites patched. 3 deferred (PostgreSQL -0001/-0005; MongoDB -0005 IndexBounds). 1 fixable-upstream (Erlang OTP — sltab patch). 1 fixable-pending (swipl-0003 attr_unify_hook). 2 not-worth-fixing. 3 unpatched (Minecraft, Create mod). 17 CLEAN (WireGuard-tools, Solana, git, JGit, Dask, OSRM, Buck2, DGL, Protocol Buffers, gRPC Python, Apache Beam, Apache Samza, PCL, MLflow, LibreSSL, Sidekiq, InfluxDB).**
**514 sites patched. 3 deferred (PostgreSQL -0001/-0005; MongoDB -0005 IndexBounds). 1 fixable-upstream (Erlang OTP — sltab patch). 1 fixable-pending (swipl-0003 attr_unify_hook). 2 not-worth-fixing. 3 unpatched (Minecraft, Create mod). 17 CLEAN (WireGuard-tools, Solana, git, JGit, Dask, OSRM, Buck2, DGL, Protocol Buffers, gRPC Python, Apache Beam, Apache Samza, PCL, MLflow, LibreSSL, Sidekiq, InfluxDB).**
---