/** * Pass: missing-sanitizer-gate (#107, CWE-79) * * Detects HTML-attribute / HTML-output methods that pass caller-supplied * values to a sink (writer.addAttribute, print, write, etc.) without any * sanitizer-shaped call dominating the sink on all control-flow paths. * * Motivating pattern — CVE-2023-37908 (xwiki-rendering `XHTMLWikiPrinter`): * * void cleanAttributes(String elementName, Map attributes) { * for (Entry e : attributes.entrySet()) { * writer.addAttribute(e.getKey(), e.getValue()); // SINK * } * } * * The fix wraps the sink in `isAttributeAllowed(elementName, k, v)`. This * pass models that shape as a dominator check: for each HTML output sink * in a candidate method, at least one sanitizer-named call must dominate * the sink block. If none does, we emit a speculative finding. * * Detection is intentionally permissive (name-only matching on both sinks * and sanitizers, no receiver-type resolution). To keep the default CLI * surface unchanged, findings are marked `confidence: 'medium'` and are * suppressed by `applyConfidenceFilter` unless the caller opts in via * `analyze(..., { includeSpeculative: true })`. Downstream verifiers * (`circle-ir-ai`, `cognium-ai`) receive the full stream and adjudicate. * * Language: Java only. Deferred to future work for JS/Python once we have * real-world FP/TP telemetry from downstream adjudication. * * Dedup: at most one finding per method. * * See: docs/PASSES.md #107, cognium-dev#153. */ import type { AnalysisPass, PassContext } from '../../graph/analysis-pass.js'; export interface MissingSanitizerGateResult { findings: number; } export declare class MissingSanitizerGatePass implements AnalysisPass { readonly name = "missing-sanitizer-gate"; readonly category: "security"; run(ctx: PassContext): MissingSanitizerGateResult; } //# sourceMappingURL=missing-sanitizer-gate-pass.d.ts.map