circle-ir 3.52.0 → 3.54.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/configs/sinks/path.yaml +0 -16
- package/configs/sources/file_sources.yaml +32 -0
- package/dist/analysis/config-loader.d.ts.map +1 -1
- package/dist/analysis/config-loader.js +59 -1
- package/dist/analysis/config-loader.js.map +1 -1
- package/dist/analysis/passes/jwt-verify-disabled-pass.d.ts +45 -0
- package/dist/analysis/passes/jwt-verify-disabled-pass.d.ts.map +1 -0
- package/dist/analysis/passes/jwt-verify-disabled-pass.js +164 -0
- package/dist/analysis/passes/jwt-verify-disabled-pass.js.map +1 -0
- package/dist/analysis/passes/weak-crypto-pass.d.ts +17 -7
- package/dist/analysis/passes/weak-crypto-pass.d.ts.map +1 -1
- package/dist/analysis/passes/weak-crypto-pass.js +179 -10
- package/dist/analysis/passes/weak-crypto-pass.js.map +1 -1
- package/dist/analysis/rules.d.ts.map +1 -1
- package/dist/analysis/rules.js +18 -0
- package/dist/analysis/rules.js.map +1 -1
- package/dist/analysis/taint-matcher.d.ts.map +1 -1
- package/dist/analysis/taint-matcher.js +28 -13
- package/dist/analysis/taint-matcher.js.map +1 -1
- package/dist/analysis/taint-propagation.d.ts.map +1 -1
- package/dist/analysis/taint-propagation.js +1 -0
- package/dist/analysis/taint-propagation.js.map +1 -1
- package/dist/analyzer.d.ts.map +1 -1
- package/dist/analyzer.js +3 -0
- package/dist/analyzer.js.map +1 -1
- package/dist/browser/circle-ir.js +269 -11
- package/dist/core/circle-ir-core.cjs +71 -9
- package/dist/core/circle-ir-core.js +71 -9
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
package/configs/sinks/path.yaml
CHANGED
|
@@ -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,
|
|
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,EAm0CtC,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
|
-
|
|
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] },
|
|
@@ -1645,6 +1652,57 @@ export const DEFAULT_SINKS = [
|
|
|
1645
1652
|
{ method: 'from_reader', class: 'serde_yaml', type: 'deserialization', cwe: 'CWE-502', severity: 'high', arg_positions: [0] },
|
|
1646
1653
|
{ method: 'from_str', class: 'serde_json', type: 'deserialization', cwe: 'CWE-502', severity: 'medium', arg_positions: [0] },
|
|
1647
1654
|
{ method: 'from_slice', class: 'serde_json', type: 'deserialization', cwe: 'CWE-502', severity: 'medium', arg_positions: [0] },
|
|
1655
|
+
// =========================================================================
|
|
1656
|
+
// ReDoS sinks (CWE-1333) — issue #86 / Sprint 5
|
|
1657
|
+
// =========================================================================
|
|
1658
|
+
// First argument of regex compile/match functions is the pattern. Tainted
|
|
1659
|
+
// patterns enable catastrophic-backtracking DoS.
|
|
1660
|
+
// Python: re.{match,search,compile,findall,fullmatch,sub,subn,split}
|
|
1661
|
+
{ method: 'match', class: 're', type: 'redos', cwe: 'CWE-1333', severity: 'high', arg_positions: [0], languages: ['python'] },
|
|
1662
|
+
{ method: 'search', class: 're', type: 'redos', cwe: 'CWE-1333', severity: 'high', arg_positions: [0], languages: ['python'] },
|
|
1663
|
+
{ method: 'fullmatch', class: 're', type: 'redos', cwe: 'CWE-1333', severity: 'high', arg_positions: [0], languages: ['python'] },
|
|
1664
|
+
{ method: 'compile', class: 're', type: 'redos', cwe: 'CWE-1333', severity: 'high', arg_positions: [0], languages: ['python'] },
|
|
1665
|
+
{ method: 'findall', class: 're', type: 'redos', cwe: 'CWE-1333', severity: 'high', arg_positions: [0], languages: ['python'] },
|
|
1666
|
+
{ method: 'finditer', class: 're', type: 'redos', cwe: 'CWE-1333', severity: 'high', arg_positions: [0], languages: ['python'] },
|
|
1667
|
+
{ method: 'sub', class: 're', type: 'redos', cwe: 'CWE-1333', severity: 'high', arg_positions: [0], languages: ['python'] },
|
|
1668
|
+
{ method: 'subn', class: 're', type: 'redos', cwe: 'CWE-1333', severity: 'high', arg_positions: [0], languages: ['python'] },
|
|
1669
|
+
{ method: 'split', class: 're', type: 'redos', cwe: 'CWE-1333', severity: 'high', arg_positions: [0], languages: ['python'] },
|
|
1670
|
+
// Java: Pattern.compile / Pattern.matches; String.matches/replaceAll/replaceFirst/split
|
|
1671
|
+
{ method: 'compile', class: 'Pattern', type: 'redos', cwe: 'CWE-1333', severity: 'high', arg_positions: [0], languages: ['java'] },
|
|
1672
|
+
{ method: 'matches', class: 'Pattern', type: 'redos', cwe: 'CWE-1333', severity: 'high', arg_positions: [0], languages: ['java'] },
|
|
1673
|
+
{ method: 'matches', class: 'String', type: 'redos', cwe: 'CWE-1333', severity: 'high', arg_positions: [0], languages: ['java'] },
|
|
1674
|
+
{ method: 'replaceAll', class: 'String', type: 'redos', cwe: 'CWE-1333', severity: 'high', arg_positions: [0], languages: ['java'] },
|
|
1675
|
+
{ method: 'replaceFirst', class: 'String', type: 'redos', cwe: 'CWE-1333', severity: 'high', arg_positions: [0], languages: ['java'] },
|
|
1676
|
+
{ method: 'split', class: 'String', type: 'redos', cwe: 'CWE-1333', severity: 'high', arg_positions: [0], languages: ['java'] },
|
|
1677
|
+
// JS/TS: new RegExp(pat) ctor; receiver_type === 'RegExp'. Also string.match
|
|
1678
|
+
// and string.matchAll, replace, search take a regex/string pattern.
|
|
1679
|
+
{ method: 'RegExp', class: 'constructor', type: 'redos', cwe: 'CWE-1333', severity: 'high', arg_positions: [0], languages: ['javascript', 'typescript'] },
|
|
1680
|
+
// Go: regexp.Compile / MustCompile / Match / MatchString
|
|
1681
|
+
{ method: 'Compile', class: 'regexp', type: 'redos', cwe: 'CWE-1333', severity: 'medium', arg_positions: [0], languages: ['go'] },
|
|
1682
|
+
{ method: 'MustCompile', class: 'regexp', type: 'redos', cwe: 'CWE-1333', severity: 'medium', arg_positions: [0], languages: ['go'] },
|
|
1683
|
+
{ method: 'Match', class: 'regexp', type: 'redos', cwe: 'CWE-1333', severity: 'medium', arg_positions: [0], languages: ['go'] },
|
|
1684
|
+
{ method: 'MatchString', class: 'regexp', type: 'redos', cwe: 'CWE-1333', severity: 'medium', arg_positions: [0], languages: ['go'] },
|
|
1685
|
+
// =========================================================================
|
|
1686
|
+
// Format-string sinks (CWE-134) — issue #86 / Sprint 5
|
|
1687
|
+
// =========================================================================
|
|
1688
|
+
// First argument is the format string. Tainted format strings enable
|
|
1689
|
+
// information disclosure and (for C-style runtimes) memory writes.
|
|
1690
|
+
// Java: String.format / Formatter.format / printf / format on PrintStream
|
|
1691
|
+
// (note: printf/format on PrintWriter/PrintStream are already XSS sinks above)
|
|
1692
|
+
{ method: 'format', class: 'String', type: 'format_string', cwe: 'CWE-134', severity: 'high', arg_positions: [0], languages: ['java'] },
|
|
1693
|
+
{ method: 'format', class: 'Formatter', type: 'format_string', cwe: 'CWE-134', severity: 'high', arg_positions: [0], languages: ['java'] },
|
|
1694
|
+
{ method: 'printf', class: 'System.out', type: 'format_string', cwe: 'CWE-134', severity: 'high', arg_positions: [0], languages: ['java'] },
|
|
1695
|
+
// NOTE: Python `userFmt.format(...)` and `userFmt % args` require
|
|
1696
|
+
// receiver-taint or operator-LHS-taint tracking — the format string is the
|
|
1697
|
+
// receiver, not an argument. Deferred to Sprint 6 (#86 follow-up).
|
|
1698
|
+
// C-style: printf / fprintf / sprintf / snprintf via ctypes/cffi.
|
|
1699
|
+
{ method: 'printf', type: 'format_string', cwe: 'CWE-134', severity: 'high', arg_positions: [0], languages: ['python'] },
|
|
1700
|
+
{ method: 'fprintf', type: 'format_string', cwe: 'CWE-134', severity: 'high', arg_positions: [1], languages: ['python'] },
|
|
1701
|
+
// Go: fmt.Sprintf/Printf/Fprintf/Errorf — format string is first/second arg
|
|
1702
|
+
{ method: 'Sprintf', class: 'fmt', type: 'format_string', cwe: 'CWE-134', severity: 'medium', arg_positions: [0], languages: ['go'] },
|
|
1703
|
+
{ method: 'Printf', class: 'fmt', type: 'format_string', cwe: 'CWE-134', severity: 'medium', arg_positions: [0], languages: ['go'] },
|
|
1704
|
+
{ method: 'Errorf', class: 'fmt', type: 'format_string', cwe: 'CWE-134', severity: 'medium', arg_positions: [0], languages: ['go'] },
|
|
1705
|
+
{ method: 'Fprintf', class: 'fmt', type: 'format_string', cwe: 'CWE-134', severity: 'medium', arg_positions: [1], languages: ['go'] },
|
|
1648
1706
|
];
|
|
1649
1707
|
export const DEFAULT_SANITIZERS = [
|
|
1650
1708
|
// SQL Injection - proper parameter binding sanitizes input
|