circle-ir 3.53.0 → 3.55.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.
Files changed (37) hide show
  1. package/dist/analysis/config-loader.d.ts.map +1 -1
  2. package/dist/analysis/config-loader.js +87 -3
  3. package/dist/analysis/config-loader.js.map +1 -1
  4. package/dist/analysis/findings.d.ts.map +1 -1
  5. package/dist/analysis/findings.js +11 -6
  6. package/dist/analysis/findings.js.map +1 -1
  7. package/dist/analysis/passes/csrf-protection-disabled-pass.d.ts +42 -0
  8. package/dist/analysis/passes/csrf-protection-disabled-pass.d.ts.map +1 -0
  9. package/dist/analysis/passes/csrf-protection-disabled-pass.js +185 -0
  10. package/dist/analysis/passes/csrf-protection-disabled-pass.js.map +1 -0
  11. package/dist/analysis/passes/jwt-verify-disabled-pass.d.ts +45 -0
  12. package/dist/analysis/passes/jwt-verify-disabled-pass.d.ts.map +1 -0
  13. package/dist/analysis/passes/jwt-verify-disabled-pass.js +164 -0
  14. package/dist/analysis/passes/jwt-verify-disabled-pass.js.map +1 -0
  15. package/dist/analysis/passes/mass-assignment-pass.d.ts +41 -0
  16. package/dist/analysis/passes/mass-assignment-pass.d.ts.map +1 -0
  17. package/dist/analysis/passes/mass-assignment-pass.js +124 -0
  18. package/dist/analysis/passes/mass-assignment-pass.js.map +1 -0
  19. package/dist/analysis/passes/xml-entity-expansion-pass.d.ts +58 -0
  20. package/dist/analysis/passes/xml-entity-expansion-pass.d.ts.map +1 -0
  21. package/dist/analysis/passes/xml-entity-expansion-pass.js +196 -0
  22. package/dist/analysis/passes/xml-entity-expansion-pass.js.map +1 -0
  23. package/dist/analysis/rules.d.ts.map +1 -1
  24. package/dist/analysis/rules.js +36 -0
  25. package/dist/analysis/rules.js.map +1 -1
  26. package/dist/analysis/taint-propagation.d.ts.map +1 -1
  27. package/dist/analysis/taint-propagation.js +1 -0
  28. package/dist/analysis/taint-propagation.js.map +1 -1
  29. package/dist/analyzer.d.ts.map +1 -1
  30. package/dist/analyzer.js +12 -0
  31. package/dist/analyzer.js.map +1 -1
  32. package/dist/browser/circle-ir.js +549 -11
  33. package/dist/core/circle-ir-core.cjs +93 -5
  34. package/dist/core/circle-ir-core.js +93 -5
  35. package/dist/types/index.d.ts +1 -1
  36. package/dist/types/index.d.ts.map +1 -1
  37. 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,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;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,cAAc,EAAE,MAAM,EAAE,EACxB,YAAY,EAAE,MAAM,EAAE,GACrB,WAAW,CAQb;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,aAAa,EAob1C,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,WAAW,EA8wCtC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,gBAAgB,EAoMhD,CAAC;AAEF;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,WAAW,CAM9C;AAMD;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,EAAE,UAAU,EA8F5C,CAAC"}
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,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;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,cAAc,EAAE,MAAM,EAAE,EACxB,YAAY,EAAE,MAAM,EAAE,GACrB,WAAW,CAQb;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,aAAa,EAob1C,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,WAAW,EAs2CtC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,gBAAgB,EAoMhD,CAAC;AAEF;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,WAAW,CAM9C;AAMD;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,EAAE,UAAU,EA8F5C,CAAC"}
@@ -732,9 +732,16 @@ export const DEFAULT_SINKS = [
732
732
  { method: 'println', class: 'ServletOutputStream', type: 'xss', cwe: 'CWE-79', severity: 'high', arg_positions: [0] },
733
733
  // XSS in error messages (CWE-81)
734
734
  { method: 'sendError', class: 'HttpServletResponse', type: 'xss', cwe: 'CWE-79', severity: 'high', arg_positions: [1] },
735
- // Response header injection (can lead to header XSS)
736
- { method: 'setHeader', class: 'HttpServletResponse', type: 'xss', cwe: 'CWE-79', severity: 'high', arg_positions: [1] },
737
- { method: 'addHeader', class: 'HttpServletResponse', type: 'xss', cwe: 'CWE-79', severity: 'high', arg_positions: [1] },
735
+ // Response header injection re-categorised from `xss` to `crlf`
736
+ // (CWE-113) in Sprint 6 of #86. Header injection is HTTP response
737
+ // splitting / cache-poisoning / cookie forging; reflected XSS via header
738
+ // reflection remains a downstream concern of body-writing sinks.
739
+ { method: 'setHeader', class: 'HttpServletResponse', type: 'crlf', cwe: 'CWE-113', severity: 'medium', arg_positions: [1] },
740
+ { method: 'addHeader', class: 'HttpServletResponse', type: 'crlf', cwe: 'CWE-113', severity: 'medium', arg_positions: [1] },
741
+ // Note: `sendRedirect` is primarily classified as `ssrf` / open-redirect
742
+ // (CWE-601) further down — see entry near line 1195. CRLF via Location
743
+ // header is a secondary concern; keeping the canonical SSRF entry avoids
744
+ // double-emission that would mask the open-redirect chain.
738
745
  { method: 'setContentType', class: 'HttpServletResponse', type: 'xss', cwe: 'CWE-79', severity: 'medium', arg_positions: [0] },
739
746
  // JSP output
740
747
  { method: 'setAttribute', class: 'PageContext', type: 'xss', cwe: 'CWE-79', severity: 'high', arg_positions: [1] },
@@ -1652,6 +1659,83 @@ export const DEFAULT_SINKS = [
1652
1659
  { method: 'from_reader', class: 'serde_yaml', type: 'deserialization', cwe: 'CWE-502', severity: 'high', arg_positions: [0] },
1653
1660
  { method: 'from_str', class: 'serde_json', type: 'deserialization', cwe: 'CWE-502', severity: 'medium', arg_positions: [0] },
1654
1661
  { method: 'from_slice', class: 'serde_json', type: 'deserialization', cwe: 'CWE-502', severity: 'medium', arg_positions: [0] },
1662
+ // =========================================================================
1663
+ // ReDoS sinks (CWE-1333) — issue #86 / Sprint 5
1664
+ // =========================================================================
1665
+ // First argument of regex compile/match functions is the pattern. Tainted
1666
+ // patterns enable catastrophic-backtracking DoS.
1667
+ // Python: re.{match,search,compile,findall,fullmatch,sub,subn,split}
1668
+ { method: 'match', class: 're', type: 'redos', cwe: 'CWE-1333', severity: 'high', arg_positions: [0], languages: ['python'] },
1669
+ { method: 'search', class: 're', type: 'redos', cwe: 'CWE-1333', severity: 'high', arg_positions: [0], languages: ['python'] },
1670
+ { method: 'fullmatch', class: 're', type: 'redos', cwe: 'CWE-1333', severity: 'high', arg_positions: [0], languages: ['python'] },
1671
+ { method: 'compile', class: 're', type: 'redos', cwe: 'CWE-1333', severity: 'high', arg_positions: [0], languages: ['python'] },
1672
+ { method: 'findall', class: 're', type: 'redos', cwe: 'CWE-1333', severity: 'high', arg_positions: [0], languages: ['python'] },
1673
+ { method: 'finditer', class: 're', type: 'redos', cwe: 'CWE-1333', severity: 'high', arg_positions: [0], languages: ['python'] },
1674
+ { method: 'sub', class: 're', type: 'redos', cwe: 'CWE-1333', severity: 'high', arg_positions: [0], languages: ['python'] },
1675
+ { method: 'subn', class: 're', type: 'redos', cwe: 'CWE-1333', severity: 'high', arg_positions: [0], languages: ['python'] },
1676
+ { method: 'split', class: 're', type: 'redos', cwe: 'CWE-1333', severity: 'high', arg_positions: [0], languages: ['python'] },
1677
+ // Java: Pattern.compile / Pattern.matches; String.matches/replaceAll/replaceFirst/split
1678
+ { method: 'compile', class: 'Pattern', type: 'redos', cwe: 'CWE-1333', severity: 'high', arg_positions: [0], languages: ['java'] },
1679
+ { method: 'matches', class: 'Pattern', type: 'redos', cwe: 'CWE-1333', severity: 'high', arg_positions: [0], languages: ['java'] },
1680
+ { method: 'matches', class: 'String', type: 'redos', cwe: 'CWE-1333', severity: 'high', arg_positions: [0], languages: ['java'] },
1681
+ { method: 'replaceAll', class: 'String', type: 'redos', cwe: 'CWE-1333', severity: 'high', arg_positions: [0], languages: ['java'] },
1682
+ { method: 'replaceFirst', class: 'String', type: 'redos', cwe: 'CWE-1333', severity: 'high', arg_positions: [0], languages: ['java'] },
1683
+ { method: 'split', class: 'String', type: 'redos', cwe: 'CWE-1333', severity: 'high', arg_positions: [0], languages: ['java'] },
1684
+ // JS/TS: new RegExp(pat) ctor; receiver_type === 'RegExp'. Also string.match
1685
+ // and string.matchAll, replace, search take a regex/string pattern.
1686
+ { method: 'RegExp', class: 'constructor', type: 'redos', cwe: 'CWE-1333', severity: 'high', arg_positions: [0], languages: ['javascript', 'typescript'] },
1687
+ // Go: regexp.Compile / MustCompile / Match / MatchString
1688
+ { method: 'Compile', class: 'regexp', type: 'redos', cwe: 'CWE-1333', severity: 'medium', arg_positions: [0], languages: ['go'] },
1689
+ { method: 'MustCompile', class: 'regexp', type: 'redos', cwe: 'CWE-1333', severity: 'medium', arg_positions: [0], languages: ['go'] },
1690
+ { method: 'Match', class: 'regexp', type: 'redos', cwe: 'CWE-1333', severity: 'medium', arg_positions: [0], languages: ['go'] },
1691
+ { method: 'MatchString', class: 'regexp', type: 'redos', cwe: 'CWE-1333', severity: 'medium', arg_positions: [0], languages: ['go'] },
1692
+ // =========================================================================
1693
+ // Format-string sinks (CWE-134) — issue #86 / Sprint 5
1694
+ // =========================================================================
1695
+ // First argument is the format string. Tainted format strings enable
1696
+ // information disclosure and (for C-style runtimes) memory writes.
1697
+ // Java: String.format / Formatter.format / printf / format on PrintStream
1698
+ // (note: printf/format on PrintWriter/PrintStream are already XSS sinks above)
1699
+ { method: 'format', class: 'String', type: 'format_string', cwe: 'CWE-134', severity: 'high', arg_positions: [0], languages: ['java'] },
1700
+ { method: 'format', class: 'Formatter', type: 'format_string', cwe: 'CWE-134', severity: 'high', arg_positions: [0], languages: ['java'] },
1701
+ { method: 'printf', class: 'System.out', type: 'format_string', cwe: 'CWE-134', severity: 'high', arg_positions: [0], languages: ['java'] },
1702
+ // NOTE: Python `userFmt.format(...)` and `userFmt % args` require
1703
+ // receiver-taint or operator-LHS-taint tracking — the format string is the
1704
+ // receiver, not an argument. Deferred to Sprint 6 (#86 follow-up).
1705
+ // C-style: printf / fprintf / sprintf / snprintf via ctypes/cffi.
1706
+ { method: 'printf', type: 'format_string', cwe: 'CWE-134', severity: 'high', arg_positions: [0], languages: ['python'] },
1707
+ { method: 'fprintf', type: 'format_string', cwe: 'CWE-134', severity: 'high', arg_positions: [1], languages: ['python'] },
1708
+ // Go: fmt.Sprintf/Printf/Fprintf/Errorf — format string is first/second arg
1709
+ { method: 'Sprintf', class: 'fmt', type: 'format_string', cwe: 'CWE-134', severity: 'medium', arg_positions: [0], languages: ['go'] },
1710
+ { method: 'Printf', class: 'fmt', type: 'format_string', cwe: 'CWE-134', severity: 'medium', arg_positions: [0], languages: ['go'] },
1711
+ { method: 'Errorf', class: 'fmt', type: 'format_string', cwe: 'CWE-134', severity: 'medium', arg_positions: [0], languages: ['go'] },
1712
+ { method: 'Fprintf', class: 'fmt', type: 'format_string', cwe: 'CWE-134', severity: 'medium', arg_positions: [1], languages: ['go'] },
1713
+ // CRLF / HTTP response splitting (CWE-113) — Sprint 6, #86.
1714
+ // Node.js / Express response header / cookie sinks. The header *name* (arg 0)
1715
+ // is also CRLF-sensitive but is almost always a string literal; we model
1716
+ // arg 1 (the value) as the primary sink.
1717
+ { method: 'setHeader', type: 'crlf', cwe: 'CWE-113', severity: 'medium', arg_positions: [1], languages: ['javascript', 'typescript'] },
1718
+ { method: 'writeHead', type: 'crlf', cwe: 'CWE-113', severity: 'medium', arg_positions: [2], languages: ['javascript', 'typescript'] },
1719
+ // Express: res.cookie(name, value, options) — value is CRLF-sensitive.
1720
+ { method: 'cookie', type: 'crlf', cwe: 'CWE-113', severity: 'medium', arg_positions: [1], languages: ['javascript', 'typescript'] },
1721
+ // Express: res.location(url) and res.redirect(url) — Location header.
1722
+ { method: 'location', type: 'crlf', cwe: 'CWE-113', severity: 'medium', arg_positions: [0], languages: ['javascript', 'typescript'] },
1723
+ { method: 'redirect', type: 'crlf', cwe: 'CWE-113', severity: 'medium', arg_positions: [0], languages: ['javascript', 'typescript'] },
1724
+ // Go net/http: w.Header().Set(k, v) / Add(k, v) — first arg is the value
1725
+ // (Header is a map; the actual `value` is arg 1 of the call). We flag the
1726
+ // value position so a tainted variable is detected.
1727
+ { method: 'Set', class: 'Header', type: 'crlf', cwe: 'CWE-113', severity: 'medium', arg_positions: [1], languages: ['go'] },
1728
+ { method: 'Add', class: 'Header', type: 'crlf', cwe: 'CWE-113', severity: 'medium', arg_positions: [1], languages: ['go'] },
1729
+ // Mass-assignment (CWE-915) — Sprint 6, #86.
1730
+ // JS Object.assign(target, ...sources) — sources are arg 1..N, and if any
1731
+ // source is request-tainted, every key gets written onto the target. We
1732
+ // flag the source positions; the analyzer only needs one tainted to fire.
1733
+ { method: 'assign', class: 'Object', type: 'mass_assignment', cwe: 'CWE-915', severity: 'high', arg_positions: [1, 2, 3], languages: ['javascript', 'typescript'] },
1734
+ // Lodash bulk-merge helpers behave identically.
1735
+ { method: 'merge', class: '_', type: 'mass_assignment', cwe: 'CWE-915', severity: 'high', arg_positions: [1, 2, 3], languages: ['javascript', 'typescript'] },
1736
+ { method: 'extend', class: '_', type: 'mass_assignment', cwe: 'CWE-915', severity: 'high', arg_positions: [1, 2, 3], languages: ['javascript', 'typescript'] },
1737
+ // jQuery $.extend(target, source) (legacy).
1738
+ { method: 'extend', class: '$', type: 'mass_assignment', cwe: 'CWE-915', severity: 'high', arg_positions: [1, 2, 3], languages: ['javascript', 'typescript'] },
1655
1739
  ];
1656
1740
  export const DEFAULT_SANITIZERS = [
1657
1741
  // SQL Injection - proper parameter binding sanitizes input