circle-ir 3.185.0 → 3.186.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analysis/config-loader.d.ts.map +1 -1
- package/dist/analysis/config-loader.js +85 -0
- package/dist/analysis/config-loader.js.map +1 -1
- package/dist/browser/circle-ir.js +85 -0
- package/dist/core/circle-ir-core.cjs +85 -0
- package/dist/core/circle-ir-core.js +85 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-loader.d.ts","sourceRoot":"","sources":["../../src/analysis/config-loader.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EACV,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACX,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,UAAU,EACX,MAAM,oBAAoB,CAAC;AAE5B;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC,CAEjD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,aAAa,EAAE,CAiB1E;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG;IACtD,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,UAAU,EAAE,gBAAgB,EAAE,CAAC;CAChC,CAcA;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,mBAAmB,EAAE,GAC7B,kBAAkB,EAAE,CAQtB;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,cAAc,EAAE,MAAM,EAAE,EACxB,YAAY,EAAE,MAAM,EAAE,EACtB,qBAAqB,GAAE,MAAM,EAAO,GACnC,WAAW,CAYb;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,aAAa,EAymB1C,CAAC;AA+KF,eAAO,MAAM,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AACH,eAAO,MAAM,oBAAoB,EAAE,UAAU,EA8F5C,CAAC"}
|
|
@@ -2626,6 +2626,91 @@ export const DEFAULT_SANITIZERS = [
|
|
|
2626
2626
|
// Command injection - shell escaping
|
|
2627
2627
|
{ method: 'quote', class: 'shell', removes: ['command_injection'] },
|
|
2628
2628
|
{ method: 'escape', class: 'shell-escape', removes: ['command_injection'] },
|
|
2629
|
+
// JS/Node — additional XSS/HTML encoders (cognium-dev #213 sixth slice).
|
|
2630
|
+
//
|
|
2631
|
+
// he.encode(x) / he.escape(x) — `he` npm package
|
|
2632
|
+
// sanitizeHtml(x) — `sanitize-html` npm
|
|
2633
|
+
// xss(x) / filterXSS(x) — `xss` npm (Yahoo)
|
|
2634
|
+
// escapeHtml(x) / escapeHTML(x) — common bare helpers
|
|
2635
|
+
// entities.encode(x) / entities.escape(x) — `entities` npm
|
|
2636
|
+
// xssFilters.inHTMLData(x) / inHTMLComment(x) / uriInHTMLData(x)
|
|
2637
|
+
// — `xss-filters` npm (Yahoo)
|
|
2638
|
+
//
|
|
2639
|
+
// `external_taint_escape` is included alongside `xss` — the CWE-668
|
|
2640
|
+
// fallback fires on any call receiving tainted data that the engine
|
|
2641
|
+
// does not otherwise recognize. Since these functions are explicitly
|
|
2642
|
+
// registered as sanitizers (they PURIFY input), they should also
|
|
2643
|
+
// suppress the fallback so a `res.send(sanitizeHtml(x))` flow does
|
|
2644
|
+
// not report an external-taint-escape at the sanitizer call itself.
|
|
2645
|
+
{ method: 'encode', class: 'he', removes: ['xss', 'external_taint_escape'] },
|
|
2646
|
+
{ method: 'escape', class: 'he', removes: ['xss', 'external_taint_escape'] },
|
|
2647
|
+
{ method: 'sanitizeHtml', removes: ['xss', 'external_taint_escape'] },
|
|
2648
|
+
{ method: 'xss', removes: ['xss', 'external_taint_escape'] },
|
|
2649
|
+
{ method: 'filterXSS', removes: ['xss', 'external_taint_escape'] },
|
|
2650
|
+
{ method: 'escapeHtml', removes: ['xss', 'external_taint_escape'] },
|
|
2651
|
+
{ method: 'escapeHTML', removes: ['xss', 'external_taint_escape'] },
|
|
2652
|
+
{ method: 'encode', class: 'entities', removes: ['xss', 'external_taint_escape'] },
|
|
2653
|
+
{ method: 'escape', class: 'entities', removes: ['xss', 'external_taint_escape'] },
|
|
2654
|
+
// xss-filters: context-specific helpers, all XSS-safe by construction.
|
|
2655
|
+
{ method: 'inHTMLData', class: 'xssFilters', removes: ['xss', 'external_taint_escape'] },
|
|
2656
|
+
{ method: 'inHTMLComment', class: 'xssFilters', removes: ['xss', 'external_taint_escape'] },
|
|
2657
|
+
{ method: 'uriInHTMLData', class: 'xssFilters', removes: ['xss', 'external_taint_escape'] },
|
|
2658
|
+
// JS/Node — SQL escaping (in addition to the mysql class above).
|
|
2659
|
+
//
|
|
2660
|
+
// SqlString.escape / .escapeId — `sqlstring` npm (raw
|
|
2661
|
+
// escape used by mysql /
|
|
2662
|
+
// node-mysql2 drivers)
|
|
2663
|
+
// pgFormat(sql, ...args) / format(bare) — `pg-format` npm
|
|
2664
|
+
// SQL.raw / SQL(bare) — `sql-template-strings`
|
|
2665
|
+
//
|
|
2666
|
+
// Bare `format` is intentionally NOT registered — it collides with
|
|
2667
|
+
// string.format-style helpers unrelated to SQL. Callers should use the
|
|
2668
|
+
// qualified form.
|
|
2669
|
+
{ method: 'escape', class: 'SqlString', removes: ['sql_injection', 'external_taint_escape'] },
|
|
2670
|
+
{ method: 'escapeId', class: 'SqlString', removes: ['sql_injection', 'external_taint_escape'] },
|
|
2671
|
+
{ method: 'format', class: 'SqlString', removes: ['sql_injection', 'external_taint_escape'] },
|
|
2672
|
+
{ method: 'format', class: 'pgFormat', removes: ['sql_injection', 'external_taint_escape'] },
|
|
2673
|
+
{ method: 'ident', class: 'pgFormat', removes: ['sql_injection', 'external_taint_escape'] },
|
|
2674
|
+
{ method: 'literal', class: 'pgFormat', removes: ['sql_injection', 'external_taint_escape'] },
|
|
2675
|
+
// JS/Node — crypto.randomUUID() and Node's crypto.randomBytes(...)toString()
|
|
2676
|
+
// produce cryptographically-secure typed strings that cannot carry
|
|
2677
|
+
// attacker-injected payload. Registered as type coercion.
|
|
2678
|
+
{ method: 'randomUUID', class: 'crypto', removes: ['sql_injection', 'nosql_injection', 'command_injection', 'path_traversal', 'code_injection', 'xss'] },
|
|
2679
|
+
// Bare `randomUUID()` alias — `import { randomUUID } from 'crypto'`.
|
|
2680
|
+
{ method: 'randomUUID', removes: ['sql_injection', 'nosql_injection', 'command_injection', 'path_traversal', 'code_injection', 'xss'] },
|
|
2681
|
+
// JS/Node — URL construction. `new URL(x, base)` (constructor-call
|
|
2682
|
+
// matched by method_name === 'URL') and `URLSearchParams.toString()`
|
|
2683
|
+
// safely encode components for URL context.
|
|
2684
|
+
{ method: 'toString', class: 'URLSearchParams', removes: ['ssrf', 'open_redirect', 'xss'] },
|
|
2685
|
+
// Go — additional sanitizers (cognium-dev #213 sixth slice).
|
|
2686
|
+
//
|
|
2687
|
+
// regexp.QuoteMeta(x) — mirror of Python re.escape; strips regex
|
|
2688
|
+
// metacharacters so downstream compile/match
|
|
2689
|
+
// cannot execute attacker-crafted patterns.
|
|
2690
|
+
// bluemonday.Sanitize — dominant Go HTML sanitizer library
|
|
2691
|
+
// (`microcosm-cc/bluemonday`). Called on a
|
|
2692
|
+
// Policy value returned by UGCPolicy() /
|
|
2693
|
+
// StrictPolicy() / etc. Match by method name
|
|
2694
|
+
// alone — Policy is the receiver type.
|
|
2695
|
+
// net.ParseIP(x) — validates the input is a well-formed IP;
|
|
2696
|
+
// returns nil for bad input (developer must
|
|
2697
|
+
// check, but the sanitizer only applies when
|
|
2698
|
+
// the parsed IP flows onward).
|
|
2699
|
+
// sql.Named(name, val) — parameterized query binding.
|
|
2700
|
+
{ method: 'QuoteMeta', class: 'regexp', removes: ['redos', 'code_injection', 'external_taint_escape'] },
|
|
2701
|
+
{ method: 'Sanitize', class: 'bluemonday', removes: ['xss', 'external_taint_escape'] },
|
|
2702
|
+
{ method: 'Sanitize', class: 'Policy', removes: ['xss', 'external_taint_escape'] },
|
|
2703
|
+
// Bare `Sanitize` — the receiver is a Policy variable (`p := bluemonday.UGCPolicy(); p.Sanitize(x)`).
|
|
2704
|
+
// `Policy` class-matching only fires when the IR resolves the receiver type;
|
|
2705
|
+
// since Go DFG rarely propagates the type of a locally-assigned variable
|
|
2706
|
+
// from a package factory call, we also register the bare method name.
|
|
2707
|
+
// Narrow FP risk: `Sanitize` bare is uncommon outside bluemonday context.
|
|
2708
|
+
{ method: 'Sanitize', removes: ['xss', 'external_taint_escape'] },
|
|
2709
|
+
{ method: 'SanitizeBytes', class: 'bluemonday', removes: ['xss', 'external_taint_escape'] },
|
|
2710
|
+
{ method: 'SanitizeBytes', class: 'Policy', removes: ['xss', 'external_taint_escape'] },
|
|
2711
|
+
{ method: 'SanitizeBytes', removes: ['xss', 'external_taint_escape'] },
|
|
2712
|
+
{ method: 'ParseIP', class: 'net', removes: ['ssrf', 'command_injection', 'path_traversal', 'external_taint_escape'] },
|
|
2713
|
+
{ method: 'Named', class: 'sql', removes: ['sql_injection', 'external_taint_escape'] },
|
|
2629
2714
|
// =========================================================================
|
|
2630
2715
|
// Python Sanitizers
|
|
2631
2716
|
// =========================================================================
|