circle-ir 3.51.0 → 3.53.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 (35) hide show
  1. package/configs/sinks/path.yaml +0 -16
  2. package/configs/sources/file_sources.yaml +32 -0
  3. package/dist/analysis/config-loader.d.ts.map +1 -1
  4. package/dist/analysis/config-loader.js +17 -20
  5. package/dist/analysis/config-loader.js.map +1 -1
  6. package/dist/analysis/passes/insecure-cookie-pass.d.ts +23 -23
  7. package/dist/analysis/passes/insecure-cookie-pass.d.ts.map +1 -1
  8. package/dist/analysis/passes/insecure-cookie-pass.js +169 -79
  9. package/dist/analysis/passes/insecure-cookie-pass.js.map +1 -1
  10. package/dist/analysis/passes/tls-verify-disabled-pass.d.ts +52 -0
  11. package/dist/analysis/passes/tls-verify-disabled-pass.d.ts.map +1 -0
  12. package/dist/analysis/passes/tls-verify-disabled-pass.js +247 -0
  13. package/dist/analysis/passes/tls-verify-disabled-pass.js.map +1 -0
  14. package/dist/analysis/passes/weak-crypto-pass.d.ts +59 -0
  15. package/dist/analysis/passes/weak-crypto-pass.d.ts.map +1 -0
  16. package/dist/analysis/passes/weak-crypto-pass.js +392 -0
  17. package/dist/analysis/passes/weak-crypto-pass.js.map +1 -0
  18. package/dist/analysis/passes/weak-hash-pass.d.ts +45 -0
  19. package/dist/analysis/passes/weak-hash-pass.d.ts.map +1 -0
  20. package/dist/analysis/passes/weak-hash-pass.js +150 -0
  21. package/dist/analysis/passes/weak-hash-pass.js.map +1 -0
  22. package/dist/analysis/passes/weak-random-pass.d.ts +53 -0
  23. package/dist/analysis/passes/weak-random-pass.d.ts.map +1 -0
  24. package/dist/analysis/passes/weak-random-pass.js +181 -0
  25. package/dist/analysis/passes/weak-random-pass.js.map +1 -0
  26. package/dist/analysis/taint-matcher.d.ts.map +1 -1
  27. package/dist/analysis/taint-matcher.js +28 -13
  28. package/dist/analysis/taint-matcher.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 +852 -57
  33. package/dist/core/circle-ir-core.cjs +25 -26
  34. package/dist/core/circle-ir-core.js +25 -26
  35. package/package.json +1 -1
@@ -668,22 +668,6 @@
668
668
  "arg_positions": [0],
669
669
  "note": "Unzip operation - zip slip"
670
670
  },
671
- {
672
- "method": "getPath",
673
- "class": "ZipEntry",
674
- "type": "path_traversal",
675
- "cwe": "CWE-022",
676
- "severity": "high",
677
- "note": "Zip entry path - may contain ../"
678
- },
679
- {
680
- "method": "getName",
681
- "class": "ZipEntry",
682
- "type": "path_traversal",
683
- "cwe": "CWE-022",
684
- "severity": "high",
685
- "note": "Zip entry name - may contain ../"
686
- },
687
671
  {
688
672
  "method": "getEnvironment",
689
673
  "class": "ConfigServicePropertySourceLocator",
@@ -144,6 +144,38 @@
144
144
  "return_tainted": true,
145
145
  "note": "File content as InputStream"
146
146
  },
147
+ {
148
+ "method": "getName",
149
+ "class": "ZipEntry",
150
+ "type": "file_input",
151
+ "severity": "high",
152
+ "return_tainted": true,
153
+ "note": "Zip entry name - may contain ../ (Zip-Slip CWE-22, issue #52)"
154
+ },
155
+ {
156
+ "method": "getName",
157
+ "class": "ZipArchiveEntry",
158
+ "type": "file_input",
159
+ "severity": "high",
160
+ "return_tainted": true,
161
+ "note": "Apache Commons Compress zip entry name - may contain ../ (Zip-Slip)"
162
+ },
163
+ {
164
+ "method": "getName",
165
+ "class": "TarArchiveEntry",
166
+ "type": "file_input",
167
+ "severity": "high",
168
+ "return_tainted": true,
169
+ "note": "Apache Commons Compress tar entry name - may contain ../ (Tar-Slip)"
170
+ },
171
+ {
172
+ "method": "getName",
173
+ "class": "ArchiveEntry",
174
+ "type": "file_input",
175
+ "severity": "high",
176
+ "return_tainted": true,
177
+ "note": "Generic archive entry name - may contain ../ (Zip/Tar-Slip)"
178
+ },
147
179
  {
148
180
  "method": "getProperty",
149
181
  "class": "Properties",
@@ -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,EA4a1C,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,WAAW,EA4xCtC,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,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"}
@@ -176,6 +176,13 @@ export const DEFAULT_SOURCES = [
176
176
  { method: 'getFileName', class: 'BodyPart', type: 'file_input', severity: 'high', return_tainted: true },
177
177
  { method: 'getFileName', class: 'MimeBodyPart', type: 'file_input', severity: 'high', return_tainted: true },
178
178
  { method: 'getDisposition', class: 'Part', type: 'file_input', severity: 'medium', return_tainted: true },
179
+ // Archive entry names (Zip-Slip / Tar-Slip CWE-22, issue #52)
180
+ // entry.getName() returns a path that may contain ../ — flowing into File()/FileOutputStream()
181
+ // is a classic Zip-Slip vulnerability.
182
+ { method: 'getName', class: 'ZipEntry', type: 'file_input', severity: 'high', return_tainted: true },
183
+ { method: 'getName', class: 'ZipArchiveEntry', type: 'file_input', severity: 'high', return_tainted: true },
184
+ { method: 'getName', class: 'TarArchiveEntry', type: 'file_input', severity: 'high', return_tainted: true },
185
+ { method: 'getName', class: 'ArchiveEntry', type: 'file_input', severity: 'high', return_tainted: true },
179
186
  // Command line arguments
180
187
  { method: 'getArgs', type: 'io_input', severity: 'high', return_tainted: true },
181
188
  { method: 'getOptionValue', class: 'CommandLine', type: 'io_input', severity: 'high', return_tainted: true },
@@ -610,7 +617,7 @@ export const DEFAULT_SINKS = [
610
617
  { method: 'staticFileLocation', type: 'path_traversal', cwe: 'CWE-22', severity: 'high', arg_positions: [0] },
611
618
  // Zip/archive handling
612
619
  { method: 'getEntry', class: 'ZipFile', type: 'path_traversal', cwe: 'CWE-22', severity: 'high', arg_positions: [0] },
613
- { method: 'getName', class: 'ZipEntry', type: 'path_traversal', cwe: 'CWE-22', severity: 'high', arg_positions: [] },
620
+ // ZipEntry.getName moved to file_sources.yaml as a taint SOURCE (type=archive_entry, issue #52)
614
621
  // Resource loading classes (various frameworks)
615
622
  { method: 'ClassPathResource', class: 'constructor', type: 'path_traversal', cwe: 'CWE-22', severity: 'high', arg_positions: [0] },
616
623
  { method: 'FileSystemResource', class: 'constructor', type: 'path_traversal', cwe: 'CWE-22', severity: 'high', arg_positions: [0] },
@@ -1086,26 +1093,16 @@ export const DEFAULT_SINKS = [
1086
1093
  { method: 'get', class: 'WebClient', type: 'ssrf', cwe: 'CWE-918', severity: 'high', arg_positions: [] },
1087
1094
  { method: 'post', class: 'WebClient', type: 'ssrf', cwe: 'CWE-918', severity: 'high', arg_positions: [] },
1088
1095
  // =============================================================================
1089
- // Weak Cryptography Sinks (no taint flow required - presence alone is vulnerability)
1096
+ // Config / Absence Vulnerabilities (handled by dedicated pattern passes)
1090
1097
  // =============================================================================
1091
- // Weak Random (CWE-330) - java.util.Random is not cryptographically secure
1092
- { method: 'Random', class: 'constructor', type: 'weak_random', cwe: 'CWE-330', severity: 'medium', arg_positions: [] },
1093
- { method: 'nextInt', class: 'Random', type: 'weak_random', cwe: 'CWE-330', severity: 'medium', arg_positions: [] },
1094
- { method: 'nextLong', class: 'Random', type: 'weak_random', cwe: 'CWE-330', severity: 'medium', arg_positions: [] },
1095
- { method: 'nextFloat', class: 'Random', type: 'weak_random', cwe: 'CWE-330', severity: 'medium', arg_positions: [] },
1096
- { method: 'nextDouble', class: 'Random', type: 'weak_random', cwe: 'CWE-330', severity: 'medium', arg_positions: [] },
1097
- { method: 'nextBoolean', class: 'Random', type: 'weak_random', cwe: 'CWE-330', severity: 'medium', arg_positions: [] },
1098
- { method: 'nextBytes', class: 'Random', type: 'weak_random', cwe: 'CWE-330', severity: 'medium', arg_positions: [] },
1099
- // Weak Hash (CWE-328) - MD5/SHA1 are cryptographically broken
1100
- // Note: Detection requires checking algorithm argument - handled in runner
1101
- { method: 'getInstance', class: 'MessageDigest', type: 'weak_hash', cwe: 'CWE-328', severity: 'medium', arg_positions: [0] },
1102
- // Weak Crypto (CWE-327) - DES/RC4/Blowfish are weak ciphers
1103
- // Note: Detection requires checking algorithm argument - handled in runner
1104
- { method: 'getInstance', class: 'Cipher', type: 'weak_crypto', cwe: 'CWE-327', severity: 'high', arg_positions: [0] },
1105
- { method: 'getInstance', class: 'KeyGenerator', type: 'weak_crypto', cwe: 'CWE-327', severity: 'high', arg_positions: [0] },
1106
- // Insecure Cookie (CWE-614) - cookies without secure/httpOnly flags
1107
- // Note: Detection requires checking if setSecure(true)/setHttpOnly(true) called - handled in runner
1108
- { method: 'Cookie', class: 'constructor', type: 'insecure_cookie', cwe: 'CWE-614', severity: 'medium', arg_positions: [] },
1098
+ // weak_random → WeakRandomPass (src/analysis/passes/weak-random-pass.ts)
1099
+ // weak_hash → WeakHashPass (src/analysis/passes/weak-hash-pass.ts)
1100
+ // weak_crypto → WeakCryptoPass (src/analysis/passes/weak-crypto-pass.ts)
1101
+ // insecure_cookie InsecureCookiePass (src/analysis/passes/insecure-cookie-pass.ts)
1102
+ // tls_verify_disabled TlsVerifyDisabledPass
1103
+ // These patterns are detected by call-site literal inspection, not taint flow,
1104
+ // so they are NOT registered here as sinks (they could never match a "tainted
1105
+ // value flowing into a sink" because the bad value is a hard-coded constant).
1109
1106
  // Trust Boundary (CWE-501) - using untrusted data as session attribute NAME
1110
1107
  // The vulnerability is attacker controlling which key to use, not the value
1111
1108
  { method: 'setAttribute', class: 'HttpSession', type: 'trust_boundary', cwe: 'CWE-501', severity: 'medium', arg_positions: [0] },