circle-ir 4.9.28 → 4.10.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 +63 -2
- package/dist/analysis/config-loader.js.map +1 -1
- package/dist/analysis/passes/language-sources-pass.d.ts.map +1 -1
- package/dist/analysis/passes/language-sources-pass.js +54 -7
- package/dist/analysis/passes/language-sources-pass.js.map +1 -1
- package/dist/analysis/passes/taint-propagation-pass.js +117 -12
- package/dist/analysis/passes/taint-propagation-pass.js.map +1 -1
- package/dist/analysis/taint-matcher.d.ts.map +1 -1
- package/dist/analysis/taint-matcher.js +41 -0
- package/dist/analysis/taint-matcher.js.map +1 -1
- package/dist/analyzer.d.ts +12 -0
- package/dist/analyzer.d.ts.map +1 -1
- package/dist/analyzer.js +1 -1
- package/dist/analyzer.js.map +1 -1
- package/dist/browser/circle-ir.js +260 -28
- package/dist/core/circle-ir-core.cjs +179 -12
- package/dist/core/circle-ir-core.js +179 -12
- package/dist/core/extractors/calls.js +29 -1
- package/dist/core/extractors/calls.js.map +1 -1
- package/dist/core/extractors/types.d.ts +28 -1
- package/dist/core/extractors/types.d.ts.map +1 -1
- package/dist/core/extractors/types.js +136 -10
- package/dist/core/extractors/types.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/navigation/index.d.ts +8 -0
- package/dist/navigation/index.d.ts.map +1 -0
- package/dist/navigation/index.js +6 -0
- package/dist/navigation/index.js.map +1 -0
- package/dist/navigation/navigation-index.d.ts +208 -0
- package/dist/navigation/navigation-index.d.ts.map +1 -0
- package/dist/navigation/navigation-index.js +968 -0
- package/dist/navigation/navigation-index.js.map +1 -0
- package/dist/navigation/types.d.ts +160 -0
- package/dist/navigation/types.d.ts.map +1 -0
- package/dist/navigation/types.js +17 -0
- package/dist/navigation/types.js.map +1 -0
- package/dist/types/config.d.ts +14 -0
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/index.d.ts +19 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- 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,
|
|
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,EAy0B1C,CAAC;AA+KF,eAAO,MAAM,aAAa,EAAE,WAAW,EA2qEtC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,gBAAgB,EAgjBhD,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,sBAAsB,EAAE,kBAAkB,EAiDtD,CAAC;AAEF;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,WAAW,CAO9C;AAMD;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,EAAE,UAAU,EA8F5C,CAAC"}
|
|
@@ -137,6 +137,23 @@ export const DEFAULT_SOURCES = [
|
|
|
137
137
|
{ method: 'next', class: 'Scanner', type: 'io_input', severity: 'high', return_tainted: true },
|
|
138
138
|
{ method: 'nextInt', class: 'Scanner', type: 'io_input', severity: 'high', return_tainted: true },
|
|
139
139
|
// Database result sources
|
|
140
|
+
// C# I/O, network and database reads (cognium-dev#502). Mirrors the Java
|
|
141
|
+
// rows above one-for-one, including the severity split: console/file I/O is
|
|
142
|
+
// `io_input` at high, a database row read is `db_input` at medium. There is
|
|
143
|
+
// no separate confidence tier — `type` + `severity` IS the tier, exactly as
|
|
144
|
+
// for `BufferedReader.readLine` vs `ResultSet.getString`.
|
|
145
|
+
{ method: 'ReadLine', class: 'StreamReader', type: 'io_input', severity: 'high', return_tainted: true, languages: ['csharp'] },
|
|
146
|
+
{ method: 'ReadLineAsync', class: 'StreamReader', type: 'io_input', severity: 'high', return_tainted: true, languages: ['csharp'] },
|
|
147
|
+
{ method: 'ReadToEnd', class: 'StreamReader', type: 'io_input', severity: 'high', return_tainted: true, languages: ['csharp'] },
|
|
148
|
+
{ method: 'ReadToEndAsync', class: 'StreamReader', type: 'io_input', severity: 'high', return_tainted: true, languages: ['csharp'] },
|
|
149
|
+
// Socket and HTTP-client reads. `GetStream` / `AcceptTcpClient` /
|
|
150
|
+
// `OpenRead` return the channel; the read off it is covered by the
|
|
151
|
+
// StreamReader rows above, and seeding the channel too lets a flow form when
|
|
152
|
+
// the read is inlined.
|
|
153
|
+
{ method: 'GetStream', class: 'TcpClient', type: 'network_input', severity: 'high', return_tainted: true, languages: ['csharp'] },
|
|
154
|
+
{ method: 'AcceptTcpClient', class: 'TcpListener', type: 'network_input', severity: 'high', return_tainted: true, languages: ['csharp'] },
|
|
155
|
+
{ method: 'OpenRead', class: 'WebClient', type: 'network_input', severity: 'high', return_tainted: true, languages: ['csharp'] },
|
|
156
|
+
{ method: 'DownloadString', class: 'WebClient', type: 'network_input', severity: 'high', return_tainted: true, languages: ['csharp'] },
|
|
140
157
|
{ method: 'getString', class: 'ResultSet', type: 'db_input', severity: 'medium', return_tainted: true },
|
|
141
158
|
{ method: 'getObject', class: 'ResultSet', type: 'db_input', severity: 'medium', return_tainted: true },
|
|
142
159
|
{ method: 'getInt', class: 'ResultSet', type: 'db_input', severity: 'medium', return_tainted: true },
|
|
@@ -2422,6 +2439,29 @@ export const DEFAULT_SINKS = [
|
|
|
2422
2439
|
{ method: 'deserialize', class: 'bincode', type: 'deserialization', cwe: 'CWE-502', severity: 'critical', arg_positions: [0] },
|
|
2423
2440
|
{ method: 'from_str', class: 'toml', type: 'deserialization', cwe: 'CWE-502', severity: 'high', arg_positions: [0] },
|
|
2424
2441
|
{ method: 'from_str', class: 'ron', type: 'deserialization', cwe: 'CWE-502', severity: 'high', arg_positions: [0] },
|
|
2442
|
+
// cognium-dev#541 — the crates the removed classless rows were silently
|
|
2443
|
+
// covering. #484 replaced a classless `from_str` / `from_slice` with
|
|
2444
|
+
// class-scoped rows, but only for the four formats that already had entries;
|
|
2445
|
+
// every other serde data format lost its sink, and `rmp_serde::from_slice`
|
|
2446
|
+
// on bytes read straight off a `TcpStream` stopped being reported. Each row
|
|
2447
|
+
// below is a serde *data format* entry point — a function whose whole job is
|
|
2448
|
+
// to build a typed value out of untrusted bytes or text.
|
|
2449
|
+
{ method: 'from_slice', class: 'rmp_serde', type: 'deserialization', cwe: 'CWE-502', severity: 'high', arg_positions: [0] },
|
|
2450
|
+
{ method: 'from_read', class: 'rmp_serde', type: 'deserialization', cwe: 'CWE-502', severity: 'high', arg_positions: [0] },
|
|
2451
|
+
{ method: 'from_read_ref', class: 'rmp_serde', type: 'deserialization', cwe: 'CWE-502', severity: 'high', arg_positions: [0] },
|
|
2452
|
+
{ method: 'from_slice', class: 'serde_yaml', type: 'deserialization', cwe: 'CWE-502', severity: 'high', arg_positions: [0] },
|
|
2453
|
+
{ method: 'from_slice', class: 'toml', type: 'deserialization', cwe: 'CWE-502', severity: 'high', arg_positions: [0] },
|
|
2454
|
+
{ method: 'from_reader', class: 'ron', type: 'deserialization', cwe: 'CWE-502', severity: 'high', arg_positions: [0] },
|
|
2455
|
+
{ method: 'from_bytes', class: 'postcard', type: 'deserialization', cwe: 'CWE-502', severity: 'high', arg_positions: [0] },
|
|
2456
|
+
{ method: 'from_slice', class: 'serde_cbor', type: 'deserialization', cwe: 'CWE-502', severity: 'high', arg_positions: [0] },
|
|
2457
|
+
{ method: 'from_reader', class: 'serde_cbor', type: 'deserialization', cwe: 'CWE-502', severity: 'high', arg_positions: [0] },
|
|
2458
|
+
{ method: 'from_reader', class: 'ciborium', type: 'deserialization', cwe: 'CWE-502', severity: 'high', arg_positions: [0] },
|
|
2459
|
+
{ method: 'from_str', class: 'serde_xml_rs', type: 'deserialization', cwe: 'CWE-502', severity: 'high', arg_positions: [0] },
|
|
2460
|
+
{ method: 'from_reader', class: 'serde_xml_rs', type: 'deserialization', cwe: 'CWE-502', severity: 'high', arg_positions: [0] },
|
|
2461
|
+
{ method: 'from_str', class: 'quick_xml', type: 'deserialization', cwe: 'CWE-502', severity: 'high', arg_positions: [0] },
|
|
2462
|
+
{ method: 'from_reader', class: 'quick_xml', type: 'deserialization', cwe: 'CWE-502', severity: 'high', arg_positions: [0] },
|
|
2463
|
+
{ method: 'from_slice', class: 'bincode', type: 'deserialization', cwe: 'CWE-502', severity: 'critical', arg_positions: [0] },
|
|
2464
|
+
{ method: 'deserialize_from', class: 'bincode', type: 'deserialization', cwe: 'CWE-502', severity: 'critical', arg_positions: [0] },
|
|
2425
2465
|
// #294/#484: no classless `from_str` / `from_slice` deserialization sink.
|
|
2426
2466
|
// Those rows matched EVERY `T::from_str` / `from_slice` — `u32::from_str`,
|
|
2427
2467
|
// `Url::from_str`, `PublicKey::from_slice` — i.e. ordinary `FromStr` / byte
|
|
@@ -2745,8 +2785,12 @@ export const DEFAULT_SINKS = [
|
|
|
2745
2785
|
{ method: 'OpenRead', class: 'File', type: 'path_traversal', cwe: 'CWE-22', severity: 'high', arg_positions: [0], languages: ['csharp'] },
|
|
2746
2786
|
{ method: 'OpenWrite', class: 'File', type: 'path_traversal', cwe: 'CWE-22', severity: 'high', arg_positions: [0], languages: ['csharp'] },
|
|
2747
2787
|
{ method: 'FileStream', type: 'path_traversal', cwe: 'CWE-22', severity: 'high', arg_positions: [0], languages: ['csharp'] },
|
|
2748
|
-
|
|
2749
|
-
|
|
2788
|
+
// #502: the `(Stream)` overload takes no path — `new StreamReader(tcp.GetStream())`
|
|
2789
|
+
// is not CWE-22. The `(string path)` overload still matches.
|
|
2790
|
+
{ method: 'StreamReader', type: 'path_traversal', cwe: 'CWE-22', severity: 'high', arg_positions: [0], safe_if_stream_arg_at: 0, languages: ['csharp'] },
|
|
2791
|
+
// #502: the `(Stream)` overload takes no path — `new StreamWriter(tcp.GetStream())`
|
|
2792
|
+
// is not CWE-22. The `(string path)` overload still matches.
|
|
2793
|
+
{ method: 'StreamWriter', type: 'path_traversal', cwe: 'CWE-22', severity: 'high', arg_positions: [0], safe_if_stream_arg_at: 0, languages: ['csharp'] },
|
|
2750
2794
|
// Remaining System.IO.File path APIs — class-scoped so they don't collide
|
|
2751
2795
|
// with unrelated methods. Copy/Move take a source AND destination path (both
|
|
2752
2796
|
// attacker-controllable → read-anywhere / write-anywhere), hence [0, 1].
|
|
@@ -2790,6 +2834,23 @@ export const DEFAULT_SINKS = [
|
|
|
2790
2834
|
// `new RestClient(userUrl)` points every later request at attacker-controlled
|
|
2791
2835
|
// infrastructure. Ctor arg 0, taint-gated.
|
|
2792
2836
|
{ method: 'RestClient', class: 'constructor', type: 'ssrf', cwe: 'CWE-918', severity: 'high', arg_positions: [0], languages: ['csharp'] },
|
|
2837
|
+
// C# code injection — CodeDOM runtime compilation (CWE-94), cognium-dev#503
|
|
2838
|
+
// part 2. `provider.CompileAssemblyFromSource(parameters, source)` compiles
|
|
2839
|
+
// and can then execute attacker-supplied C#, so the source argument is the
|
|
2840
|
+
// injection point. The signature is
|
|
2841
|
+
// `CompileAssemblyFromSource(CompilerParameters, params string[] sources)`,
|
|
2842
|
+
// so the sources begin at position 1 — position 0 is the options object.
|
|
2843
|
+
//
|
|
2844
|
+
// These rows are only useful together with the #530 StringBuilder
|
|
2845
|
+
// propagation fix: the Juliet CWE-94 corpus accumulates the compiled source
|
|
2846
|
+
// through `sb.Append(...)` and reads it back with `ToString()`, so before
|
|
2847
|
+
// that fix the sink registered but no taint ever reached it.
|
|
2848
|
+
{ method: 'CompileAssemblyFromSource', type: 'code_injection', cwe: 'CWE-94', severity: 'critical', arg_positions: [1, 2], languages: ['csharp'] },
|
|
2849
|
+
{ method: 'CompileAssemblyFromSourceBatch', type: 'code_injection', cwe: 'CWE-94', severity: 'critical', arg_positions: [1, 2], languages: ['csharp'] },
|
|
2850
|
+
// Roslyn's equivalent pair. `ParseText` turns text into a syntax tree and
|
|
2851
|
+
// `Create` compiles it; either is the point where attacker text becomes code.
|
|
2852
|
+
{ method: 'ParseText', class: 'CSharpSyntaxTree', type: 'code_injection', cwe: 'CWE-94', severity: 'critical', arg_positions: [0], languages: ['csharp'] },
|
|
2853
|
+
{ method: 'ParseText', class: 'SyntaxFactory', type: 'code_injection', cwe: 'CWE-94', severity: 'critical', arg_positions: [0], languages: ['csharp'] },
|
|
2793
2854
|
// C# code injection — dynamic script/assembly loading (CWE-94).
|
|
2794
2855
|
{ method: 'EvaluateAsync', type: 'code_injection', cwe: 'CWE-94', severity: 'critical', arg_positions: [0], languages: ['csharp'] },
|
|
2795
2856
|
{ method: 'RunAsync', class: 'CSharpScript', type: 'code_injection', cwe: 'CWE-94', severity: 'critical', arg_positions: [0], languages: ['csharp'] },
|