feat: update libddwaf to v2.2.1 with large array and map support #241
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.45 · 428 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.363
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #241"
general
weight: 0.35
eliottness
Upgrade the embedded libddwaf from
2.0.1to2.2.1, the latest release. Since2.1.0, libddwaf can build arrays and maps with more than 65,535 items ("large" containers,0xA0/0xC0). go-libddwaf could neither read nor write them, so a result with such a container failed to decode, and a config with one was cut at 65,535 items without any error.What changes
internal/log/ddwaf.hare the2.2.1release files (made withlibddwaf-updater).2.2.1only restores support for glibc older than 2.16 in the Linux libraries (libddwaf#528);ddwaf.his the same as in2.2.0.WAFLargeArrayTypeandWAFLargeMapType.IsArray,IsMap,ArrayValues,MapEntries,ArrayValue,MapValueandAnyValueaccept both layouts. NewSize() (uint32, error)returns the size of an array or a map in both layouts.ArraySize/MapSizekeep theiruint16result (they are exported, and inv5.1.0): they return an error for a large container, and are now deprecated in favor ofSize.SetArraySize/SetMapSizedo nothing on a large container.SetArrayData/SetMapDataand theEncoderbuilders write the large layout when the capacity is more than 65,535. The new limit isbindings.MaxLargeContainerSize(1<<28 - 1); above it,SetArrayData/SetMapDatareturn an error. Objects with 65,535 items or fewer have the same bytes as before. TheEncoderConfiglimits (MaxContainerSize,MaxStringSize,MaxObjectDepth) and the default run limits (256 items, 4,096 bytes, depth 20) do not change.2.2.0): a rejected config map is no longer kept inConfigPaths, and a test now covers it.Behavior change for users
Configs and
SetArrayData/SetMapDatainputs with more than 65,535 items are no longer cut. For example, a remote-config list of blocked IP addresses is now loaded in full. Run data keeps its default limits. At 100,000 items, a config update takes about 5 ms, a handle build about 11 ms, and the process peak RSS is about 91 MB (the old cut saved about 1 ms, 1 ms and 7 MB of that).Linux library dependencies
The Linux libraries now list
libpthread.so.0,libdl.so.2andlibc.so.6asNEEDED(none in2.0.1). They still have no libm dependency and no symbol-version reference.TestVerifyHeaderasserts the list.Validation not done by CI
2.2.1, on arm64 and amd64: aCGO_ENABLED=0 -tags appsecbinary ongcr.io/distroless/base-debian12, and aCGO_ENABLED=1binary built ongolang:1.25-alpineand run on plainalpine:3.ASM_DDconfig restores the default ruleset.Known limits, not caused by this PR
CGO_ENABLED=0binaries need the glibc loader, so they do not start on plain Alpine. This is the same with2.0.1.rules_dataentry with an emptydatalist crashes libddwaf inddwaf_builder_build_instance. This is the same with2.0.1, and fixed upstream in libddwaf#530.