circle-ir 4.9.8 → 4.9.10
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 +56 -0
- package/dist/analysis/config-loader.js.map +1 -1
- package/dist/analysis/findings.d.ts.map +1 -1
- package/dist/analysis/findings.js +8 -2
- package/dist/analysis/findings.js.map +1 -1
- package/dist/analysis/passes/language-sources-pass.d.ts.map +1 -1
- package/dist/analysis/passes/language-sources-pass.js +47 -7
- package/dist/analysis/passes/language-sources-pass.js.map +1 -1
- package/dist/analysis/passes/taint-propagation-pass.js +85 -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 +84 -39
- package/dist/analysis/taint-matcher.js.map +1 -1
- package/dist/browser/circle-ir.js +252 -46
- package/dist/core/circle-ir-core.cjs +174 -23
- package/dist/core/circle-ir-core.js +174 -23
- package/dist/core/extractors/calls.js +102 -3
- package/dist/core/extractors/calls.js.map +1 -1
- package/dist/languages/plugins/rust.d.ts.map +1 -1
- package/dist/languages/plugins/rust.js +5 -8
- package/dist/languages/plugins/rust.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,EAuwB1C,CAAC;AA+KF,eAAO,MAAM,aAAa,EAAE,WAAW,
|
|
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,EAuwB1C,CAAC;AA+KF,eAAO,MAAM,aAAa,EAAE,WAAW,EAqlEtC,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"}
|
|
@@ -2617,6 +2617,23 @@ export const DEFAULT_SINKS = [
|
|
|
2617
2617
|
{ method: 'ExecuteSqlRawAsync', type: 'sql_injection', cwe: 'CWE-89', severity: 'critical', arg_positions: [0], languages: ['csharp'] },
|
|
2618
2618
|
{ method: 'FromSqlRaw', type: 'sql_injection', cwe: 'CWE-89', severity: 'critical', arg_positions: [0], languages: ['csharp'] },
|
|
2619
2619
|
{ method: 'FromSqlRawAsync', type: 'sql_injection', cwe: 'CWE-89', severity: 'critical', arg_positions: [0], languages: ['csharp'] },
|
|
2620
|
+
// Dapper micro-ORM (cognium-dev#275). Every Dapper entry point is an
|
|
2621
|
+
// `IDbConnection` extension whose arg 0 is raw SQL text — `conn.Query<T>(sql)`
|
|
2622
|
+
// is exactly as injectable as `new SqlCommand(sql)`. Taint-gated on arg 0, so
|
|
2623
|
+
// a constant/interpolation-free query never fires, and a same-named method on
|
|
2624
|
+
// an unrelated receiver (e.g. RestSharp's `client.Execute(request)`, whose
|
|
2625
|
+
// arg 0 is a request object rather than a tainted string) stays clean.
|
|
2626
|
+
{ method: 'Query', type: 'sql_injection', cwe: 'CWE-89', severity: 'critical', arg_positions: [0], languages: ['csharp'] },
|
|
2627
|
+
{ method: 'QueryAsync', type: 'sql_injection', cwe: 'CWE-89', severity: 'critical', arg_positions: [0], languages: ['csharp'] },
|
|
2628
|
+
{ method: 'QueryFirst', type: 'sql_injection', cwe: 'CWE-89', severity: 'critical', arg_positions: [0], languages: ['csharp'] },
|
|
2629
|
+
{ method: 'QueryFirstAsync', type: 'sql_injection', cwe: 'CWE-89', severity: 'critical', arg_positions: [0], languages: ['csharp'] },
|
|
2630
|
+
{ method: 'QueryFirstOrDefault', type: 'sql_injection', cwe: 'CWE-89', severity: 'critical', arg_positions: [0], languages: ['csharp'] },
|
|
2631
|
+
{ method: 'QueryFirstOrDefaultAsync', type: 'sql_injection', cwe: 'CWE-89', severity: 'critical', arg_positions: [0], languages: ['csharp'] },
|
|
2632
|
+
{ method: 'QuerySingle', type: 'sql_injection', cwe: 'CWE-89', severity: 'critical', arg_positions: [0], languages: ['csharp'] },
|
|
2633
|
+
{ method: 'QuerySingleOrDefault', type: 'sql_injection', cwe: 'CWE-89', severity: 'critical', arg_positions: [0], languages: ['csharp'] },
|
|
2634
|
+
{ method: 'QueryMultiple', type: 'sql_injection', cwe: 'CWE-89', severity: 'critical', arg_positions: [0], languages: ['csharp'] },
|
|
2635
|
+
{ method: 'Execute', type: 'sql_injection', cwe: 'CWE-89', severity: 'critical', arg_positions: [0], languages: ['csharp'] },
|
|
2636
|
+
{ method: 'ExecuteAsync', type: 'sql_injection', cwe: 'CWE-89', severity: 'critical', arg_positions: [0], languages: ['csharp'] },
|
|
2620
2637
|
// ADO.NET `cmd.CommandText = "…" + x` — emitted as a synthetic call by
|
|
2621
2638
|
// extractCSharpCalls (property-assignment sink; the ctor-arg sink misses it).
|
|
2622
2639
|
{ method: 'CommandText', type: 'sql_injection', cwe: 'CWE-89', severity: 'critical', arg_positions: [0], languages: ['csharp'] },
|
|
@@ -2682,12 +2699,23 @@ export const DEFAULT_SINKS = [
|
|
|
2682
2699
|
{ method: 'DeleteAsync', type: 'ssrf', cwe: 'CWE-918', severity: 'high', arg_positions: [0], languages: ['csharp'] },
|
|
2683
2700
|
{ method: 'GetStringAsync', type: 'ssrf', cwe: 'CWE-918', severity: 'high', arg_positions: [0], languages: ['csharp'] },
|
|
2684
2701
|
{ method: 'GetByteArrayAsync', type: 'ssrf', cwe: 'CWE-918', severity: 'high', arg_positions: [0], languages: ['csharp'] },
|
|
2702
|
+
// Remaining HttpClient/Flurl verbs (cognium-dev#275). For HttpClient these
|
|
2703
|
+
// take the URL at arg 0; for Flurl's fluent form the receiver is surfaced as
|
|
2704
|
+
// arg 0 by CSHARP_RECEIVER_URL_METHODS. Taint-gated either way.
|
|
2705
|
+
// (GetStreamAsync / PutAsync / DeleteAsync are already registered below.)
|
|
2706
|
+
{ method: 'GetJsonAsync', type: 'ssrf', cwe: 'CWE-918', severity: 'high', arg_positions: [0], languages: ['csharp'] },
|
|
2707
|
+
{ method: 'PatchAsync', type: 'ssrf', cwe: 'CWE-918', severity: 'high', arg_positions: [0], languages: ['csharp'] },
|
|
2708
|
+
{ method: 'HeadAsync', type: 'ssrf', cwe: 'CWE-918', severity: 'high', arg_positions: [0], languages: ['csharp'] },
|
|
2685
2709
|
{ method: 'GetStreamAsync', type: 'ssrf', cwe: 'CWE-918', severity: 'high', arg_positions: [0], languages: ['csharp'] },
|
|
2686
2710
|
{ method: 'SendAsync', type: 'ssrf', cwe: 'CWE-918', severity: 'high', arg_positions: [0], languages: ['csharp'] },
|
|
2687
2711
|
{ method: 'DownloadString', type: 'ssrf', cwe: 'CWE-918', severity: 'high', arg_positions: [0], languages: ['csharp'] },
|
|
2688
2712
|
{ method: 'DownloadData', type: 'ssrf', cwe: 'CWE-918', severity: 'high', arg_positions: [0], languages: ['csharp'] },
|
|
2689
2713
|
{ method: 'DownloadFile', type: 'ssrf', cwe: 'CWE-918', severity: 'high', arg_positions: [1], languages: ['csharp'] },
|
|
2690
2714
|
{ method: 'Create', class: 'WebRequest', type: 'ssrf', cwe: 'CWE-918', severity: 'high', arg_positions: [0], languages: ['csharp'] },
|
|
2715
|
+
// RestSharp (cognium-dev#275) — the base URL is fixed at construction, so
|
|
2716
|
+
// `new RestClient(userUrl)` points every later request at attacker-controlled
|
|
2717
|
+
// infrastructure. Ctor arg 0, taint-gated.
|
|
2718
|
+
{ method: 'RestClient', class: 'constructor', type: 'ssrf', cwe: 'CWE-918', severity: 'high', arg_positions: [0], languages: ['csharp'] },
|
|
2691
2719
|
// C# code injection — dynamic script/assembly loading (CWE-94).
|
|
2692
2720
|
{ method: 'EvaluateAsync', type: 'code_injection', cwe: 'CWE-94', severity: 'critical', arg_positions: [0], languages: ['csharp'] },
|
|
2693
2721
|
{ method: 'RunAsync', class: 'CSharpScript', type: 'code_injection', cwe: 'CWE-94', severity: 'critical', arg_positions: [0], languages: ['csharp'] },
|
|
@@ -2727,6 +2755,11 @@ export const DEFAULT_SINKS = [
|
|
|
2727
2755
|
// Blazor `new MarkupString(x)` renders its argument as raw HTML (the framework's
|
|
2728
2756
|
// documented "trusted markup" escape hatch) — attacker-controlled input is XSS. (ca#275)
|
|
2729
2757
|
{ method: 'MarkupString', class: 'constructor', type: 'xss', cwe: 'CWE-79', severity: 'high', arg_positions: [0], languages: ['csharp'] },
|
|
2758
|
+
// `return Content(html, "text/html")` on a controller writes arg 0 to the
|
|
2759
|
+
// response body unescaped (cognium-dev#275). Taint-gated on arg 0; the common
|
|
2760
|
+
// `Content(constantString)` and the JSON/plain-text content types are
|
|
2761
|
+
// unaffected because a constant argument carries no taint.
|
|
2762
|
+
{ method: 'Content', type: 'xss', cwe: 'CWE-79', severity: 'high', arg_positions: [0], languages: ['csharp'] },
|
|
2730
2763
|
// `String.Format(fmt, …)` with an attacker-controlled FORMAT string — CWE-134.
|
|
2731
2764
|
// Taint-gated on arg 0 (the format), so ordinary `String.Format("...", user)` where
|
|
2732
2765
|
// only an argument is tainted never fires. .NET composite formatting can't corrupt
|
|
@@ -2752,6 +2785,10 @@ export const DEFAULT_SINKS = [
|
|
|
2752
2785
|
// cognium-dev#273/#275). `BsonDocument.Parse(userJson)` deserializes an
|
|
2753
2786
|
// attacker-controlled query document. Class-scoped (static receiver resolves).
|
|
2754
2787
|
{ method: 'Parse', class: 'BsonDocument', type: 'nosql_injection', cwe: 'CWE-943', severity: 'high', arg_positions: [0], languages: ['csharp'] },
|
|
2788
|
+
// `new BsonJavaScript(userCode)` wraps a server-side JS string — the payload
|
|
2789
|
+
// MongoDB's `$where` / `$function` operators execute. Unconditionally
|
|
2790
|
+
// dangerous when tainted, so no literal gating is needed (cognium-dev#275).
|
|
2791
|
+
{ method: 'BsonJavaScript', class: 'constructor', type: 'nosql_injection', cwe: 'CWE-943', severity: 'high', arg_positions: [0], languages: ['csharp'] },
|
|
2755
2792
|
// C# log injection — Microsoft.Extensions.Logging `ILogger` (CWE-117,
|
|
2756
2793
|
// cognium-ai#318). Only the message TEMPLATE (arg[0]) is the injectable
|
|
2757
2794
|
// position; the structured form `LogInformation("… {Id}", id)` keeps taint in
|
|
@@ -2763,6 +2800,16 @@ export const DEFAULT_SINKS = [
|
|
|
2763
2800
|
{ method: 'LogDebug', type: 'log_injection', cwe: 'CWE-117', severity: 'low', arg_positions: [0], languages: ['csharp'] },
|
|
2764
2801
|
{ method: 'LogCritical', type: 'log_injection', cwe: 'CWE-117', severity: 'low', arg_positions: [0], languages: ['csharp'] },
|
|
2765
2802
|
{ method: 'LogTrace', type: 'log_injection', cwe: 'CWE-117', severity: 'low', arg_positions: [0], languages: ['csharp'] },
|
|
2803
|
+
// C# ReDoS (CWE-1333, cognium-dev#275). The injectable position is the
|
|
2804
|
+
// PATTERN, not the input: a user-supplied regex can be crafted with
|
|
2805
|
+
// catastrophic backtracking. `Regex.IsMatch(input, pattern)` and friends take
|
|
2806
|
+
// the pattern at arg 1; the `new Regex(pattern)` ctor takes it at arg 0. A
|
|
2807
|
+
// tainted *input* with a constant pattern is not ReDoS and does not fire.
|
|
2808
|
+
{ method: 'IsMatch', class: 'Regex', type: 'redos', cwe: 'CWE-1333', severity: 'medium', arg_positions: [1], languages: ['csharp'] },
|
|
2809
|
+
{ method: 'Match', class: 'Regex', type: 'redos', cwe: 'CWE-1333', severity: 'medium', arg_positions: [1], languages: ['csharp'] },
|
|
2810
|
+
{ method: 'Matches', class: 'Regex', type: 'redos', cwe: 'CWE-1333', severity: 'medium', arg_positions: [1], languages: ['csharp'] },
|
|
2811
|
+
{ method: 'Replace', class: 'Regex', type: 'redos', cwe: 'CWE-1333', severity: 'medium', arg_positions: [1], languages: ['csharp'] },
|
|
2812
|
+
{ method: 'Regex', class: 'constructor', type: 'redos', cwe: 'CWE-1333', severity: 'medium', arg_positions: [0], languages: ['csharp'] },
|
|
2766
2813
|
// Generic `ILogger.Log(logLevel, message, …)` — class-scoped (`Log` alone is
|
|
2767
2814
|
// too generic); the message is arg[1].
|
|
2768
2815
|
{ method: 'Log', class: 'ILogger', type: 'log_injection', cwe: 'CWE-117', severity: 'low', arg_positions: [1], languages: ['csharp'] },
|
|
@@ -3011,6 +3058,15 @@ export const DEFAULT_SANITIZERS = [
|
|
|
3011
3058
|
// this table; the drift surfaced as a SecuriBench Micro FP on
|
|
3012
3059
|
// `sanitizers/Sanitizers3.java` (`URLEncoder.encode` + `sendRedirect`).
|
|
3013
3060
|
{ method: 'encodeForURL', removes: ['xss', 'ssrf', 'open_redirect'] },
|
|
3061
|
+
// ASP.NET Core local-redirect guards (cognium-dev#275). `Url.IsLocalUrl(x)`
|
|
3062
|
+
// returns false for any absolute/scheme-relative URL, so a `Redirect(x)` gated
|
|
3063
|
+
// on it cannot leave the site — without this credit the guarded form is a
|
|
3064
|
+
// false positive. `LocalRedirect(x)` is the same check applied by the
|
|
3065
|
+
// framework itself: it THROWS on a non-local URL, which is why it is
|
|
3066
|
+
// deliberately not registered as an open_redirect sink. Recording it here
|
|
3067
|
+
// states that intent in the model rather than leaving it as a silent omission.
|
|
3068
|
+
{ method: 'IsLocalUrl', removes: ['open_redirect'] },
|
|
3069
|
+
{ method: 'LocalRedirect', removes: ['open_redirect'] },
|
|
3014
3070
|
// URL encoding wrapper aliases (common patterns in benchmarks and real-world code)
|
|
3015
3071
|
{ method: 'encodeURL', removes: ['xss', 'ssrf', 'open_redirect'] },
|
|
3016
3072
|
{ method: 'urlEncode', removes: ['xss', 'ssrf', 'open_redirect'] },
|