circle-ir 4.12.0 → 4.13.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 (27) hide show
  1. package/README.md +9 -9
  2. package/dist/analysis/constant-propagation/propagator.d.ts +2 -0
  3. package/dist/analysis/constant-propagation/propagator.d.ts.map +1 -1
  4. package/dist/analysis/constant-propagation/propagator.js +41 -2
  5. package/dist/analysis/constant-propagation/propagator.js.map +1 -1
  6. package/dist/analysis/interprocedural.d.ts.map +1 -1
  7. package/dist/analysis/interprocedural.js +4 -0
  8. package/dist/analysis/interprocedural.js.map +1 -1
  9. package/dist/analysis/passes/csharp-sanitizer-credit.d.ts +147 -0
  10. package/dist/analysis/passes/csharp-sanitizer-credit.d.ts.map +1 -0
  11. package/dist/analysis/passes/csharp-sanitizer-credit.js +564 -0
  12. package/dist/analysis/passes/csharp-sanitizer-credit.js.map +1 -0
  13. package/dist/analysis/passes/interprocedural-pass.d.ts.map +1 -1
  14. package/dist/analysis/passes/interprocedural-pass.js +89 -0
  15. package/dist/analysis/passes/interprocedural-pass.js.map +1 -1
  16. package/dist/analysis/passes/sink-filter-pass.d.ts.map +1 -1
  17. package/dist/analysis/passes/sink-filter-pass.js +49 -52
  18. package/dist/analysis/passes/sink-filter-pass.js.map +1 -1
  19. package/dist/analysis/passes/taint-propagation-pass.d.ts.map +1 -1
  20. package/dist/analysis/passes/taint-propagation-pass.js +328 -51
  21. package/dist/analysis/passes/taint-propagation-pass.js.map +1 -1
  22. package/dist/browser/circle-ir.js +801 -83
  23. package/dist/core/circle-ir-core.cjs +41 -2
  24. package/dist/core/circle-ir-core.js +41 -2
  25. package/dist/core/extractors/dfg.js +17 -0
  26. package/dist/core/extractors/dfg.js.map +1 -1
  27. package/package.json +1 -1
@@ -0,0 +1,564 @@
1
+ /**
2
+ * C# sanitizer and guard credit (cognium-dev C#/.NET Phase-1, #518).
3
+ *
4
+ * C# rides the text-scan propagation, which knows nothing about sanitizers, so
5
+ * `SinkFilterPass` Stage 15k drops a sink when the value reaching it has been
6
+ * made safe. This module answers that question for one sink at a time, inside
7
+ * the method that contains it:
8
+ *
9
+ * - `sanitizedVarsAt` the value passed through a sanitizer for the sink's
10
+ * type, directly or through a same-file helper;
11
+ * - `guardedVarsAt` a check that dominates the sink proves the value
12
+ * inert (allowlist, numeric parse, host allowlist);
13
+ * - `fixedHostRequest` the request URL has a constant host.
14
+ *
15
+ * Everything is matched on source text and is deliberately narrow: when a
16
+ * shape is not recognised the sink stays, so a miss here is a false positive,
17
+ * never a silently dropped finding.
18
+ */
19
+ /**
20
+ * `Regex.Replace(x, "[^<allowlist>]", "")` — an allowlist character strip
21
+ * (cognium-dev#272, the LDAP-strip cluster).
22
+ *
23
+ * A **negated** class is the whole point: `[^a-zA-Z0-9]` deletes everything
24
+ * *not* in the set, so the surviving characters are exactly the set. That makes
25
+ * the result provably inert for the metacharacter-driven injection families
26
+ * below. A blacklist replace (`"[<>]"`) proves nothing — it enumerates what to
27
+ * remove and silently misses the rest — and must not match.
28
+ *
29
+ * Two conditions, both load-bearing:
30
+ *
31
+ * (a) the pattern is a string literal beginning `[^`. A computed pattern could
32
+ * be anything, including attacker-influenced.
33
+ * (b) the surviving set contains **no metacharacters**. `[^a-zA-Z0-9']` would
34
+ * keep the single quote alive, which breaks SQL and LDAP escaping outright
35
+ * — so the class body is restricted to alphanumerics, `\w`, `\d`, `\s`,
36
+ * underscore, hyphen and spaces. Anything else (quote, paren, backslash,
37
+ * dot, asterisk, semicolon) fails the match and the sink still fires.
38
+ *
39
+ * The replacement must be empty or a single safe character, so
40
+ * `Regex.Replace(x, "[^a-z]", "';DROP")` cannot qualify.
41
+ */
42
+ export const CSHARP_ALLOWLIST_STRIP_RE = /\bRegex\s*\.\s*Replace\s*\([^,]*,\s*@?"\[\^(?:[A-Za-z0-9_\- ]|\\w|\\d|\\s)+\]"\s*,\s*@?"[A-Za-z0-9_]?"\s*\)/;
43
+ /**
44
+ * `new string(x.Where(char.IsLetterOrDigit).ToArray())` — the LINQ spelling of
45
+ * the same allowlist strip: only letters and digits survive.
46
+ */
47
+ const CSHARP_ALLOWLIST_FILTER_RE = /\bnew\s+string\s*\(\s*[A-Za-z_]\w*\s*\.\s*Where\s*\(\s*char\s*\.\s*Is(?:LetterOrDigit|Digit|Letter)\s*\)\s*\.\s*ToArray\s*\(\s*\)\s*\)/;
48
+ // C# sanitizers and the sink types each neutralises. A tainted value that
49
+ // flows through one of these before reaching a sink of the matching type is
50
+ // safe. Method names are C#-distinctive (see config-loader C# sanitizers).
51
+ export const CSHARP_SANITIZER_RES = [
52
+ { re: /\b(?:HtmlEncode|JavaScriptStringEncode)\s*\(/, type: 'xss' },
53
+ // `HtmlEncoder.Default.Encode(x)` is the ASP.NET Core spelling (#520).
54
+ { re: /\bHtmlEncoder\s*\.\s*(?:Default\s*\.\s*)?Encode\s*\(/, type: 'xss' },
55
+ { re: /\bPath\s*\.\s*GetFileName\s*\(/, type: 'path_traversal' },
56
+ // XML-escapes `< > & " '`. A value escaped this way cannot close the quoted
57
+ // literal it is placed in, which is what XPath injection needs.
58
+ { re: /\bSecurityElement\s*\.\s*Escape\s*\(/, type: 'xpath_injection' },
59
+ // An allowlist strip leaves only inert characters, so it covers every family
60
+ // whose exploitation needs a metacharacter. Each has a fixture; see
61
+ // `issue-272-csharp-allowlist-strip.test.ts`.
62
+ { re: CSHARP_ALLOWLIST_STRIP_RE, type: 'ldap_injection' },
63
+ { re: CSHARP_ALLOWLIST_STRIP_RE, type: 'xpath_injection' },
64
+ { re: CSHARP_ALLOWLIST_STRIP_RE, type: 'command_injection' },
65
+ { re: CSHARP_ALLOWLIST_STRIP_RE, type: 'sql_injection' },
66
+ { re: CSHARP_ALLOWLIST_STRIP_RE, type: 'crlf' },
67
+ { re: CSHARP_ALLOWLIST_FILTER_RE, type: 'ldap_injection' },
68
+ { re: CSHARP_ALLOWLIST_FILTER_RE, type: 'xpath_injection' },
69
+ { re: CSHARP_ALLOWLIST_FILTER_RE, type: 'command_injection' },
70
+ { re: CSHARP_ALLOWLIST_FILTER_RE, type: 'sql_injection' },
71
+ { re: CSHARP_ALLOWLIST_FILTER_RE, type: 'crlf' },
72
+ ];
73
+ /**
74
+ * Sink types for which a value made only of letters, digits, `_` and `-` is
75
+ * inert: each needs a metacharacter (quote, paren, slash, angle bracket, CR/LF)
76
+ * to be exploited.
77
+ */
78
+ const INERT_WHEN_ALPHANUMERIC = new Set([
79
+ 'ldap_injection', 'xpath_injection', 'command_injection', 'sql_injection',
80
+ 'crlf', 'xss', 'path_traversal', 'code_injection',
81
+ ]);
82
+ const IDENT = '[A-Za-z_]\\w*';
83
+ const ASSIGN_RE = new RegExp(`^\\s*(?:var\\s+|[A-Za-z_][\\w.<>\\[\\]?]*\\s+)?(${IDENT})\\s*=(?!=)\\s*(.+?);?\\s*$`);
84
+ const ENDS_STATEMENT_RE = /[;{}]\s*(?:\/\/.*)?$/;
85
+ function escapeRegex(s) {
86
+ return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
87
+ }
88
+ function mentions(text, name) {
89
+ return new RegExp(`(?<![\\w])${escapeRegex(name)}(?![\\w])`).test(text);
90
+ }
91
+ /** Text inside the parentheses opening at `open`, or null when unbalanced. */
92
+ function insideParens(text, open) {
93
+ let depth = 0;
94
+ for (let i = open; i < text.length; i++) {
95
+ if (text[i] === '(')
96
+ depth++;
97
+ else if (text[i] === ')' && --depth === 0)
98
+ return text.slice(open + 1, i);
99
+ }
100
+ return null;
101
+ }
102
+ /** `if (COND) rest` at the start of `text`. */
103
+ function leadingIf(text) {
104
+ const m = /^\s*(?:\}\s*)?(?:else\s+)?if\s*\(/.exec(text);
105
+ if (!m)
106
+ return null;
107
+ const open = m[0].length - 1;
108
+ const cond = insideParens(text, open);
109
+ if (cond === null)
110
+ return null;
111
+ return { cond: cond.trim(), rest: text.slice(open + cond.length + 2).trim() };
112
+ }
113
+ const EXITS_RE = /^(?:\{\s*)?(?:return\b|throw\b|continue\b|break\b)/;
114
+ export class CSharpCredit {
115
+ methods;
116
+ lines;
117
+ helperCache = new Map();
118
+ guardHelperCache = new Map();
119
+ constructor(code, methods) {
120
+ this.methods = methods;
121
+ // CRLF files leave `\r` on every line, which `.` and `$` will not cross.
122
+ this.lines = code.split(/\r?\n/);
123
+ }
124
+ /** The innermost method containing `line`, or null. */
125
+ methodAt(line) {
126
+ let best = null;
127
+ for (const m of this.methods) {
128
+ if (line < m.start_line || line > m.end_line)
129
+ continue;
130
+ if (!best || m.end_line - m.start_line < best.end_line - best.start_line)
131
+ best = m;
132
+ }
133
+ return best;
134
+ }
135
+ /**
136
+ * Statements of lines `[from, to)`, 1-based, with a statement wrapped over
137
+ * several lines joined up to its `;`. `line` is where the statement starts.
138
+ */
139
+ statements(from, to) {
140
+ const out = [];
141
+ for (let i = Math.max(from, 1); i < to; i++) {
142
+ let text = (this.lines[i - 1] ?? '').trimEnd();
143
+ const first = i;
144
+ if (/^\s*(?:[\w.<>[\]?]+\s+)?[A-Za-z_]\w*\s*=(?!=)/.test(text) && !ENDS_STATEMENT_RE.test(text)) {
145
+ while (i < to - 1 && i < first + 12) {
146
+ i++;
147
+ text += ' ' + (this.lines[i - 1] ?? '').trim();
148
+ if (ENDS_STATEMENT_RE.test(this.lines[i - 1] ?? ''))
149
+ break;
150
+ }
151
+ }
152
+ out.push({ line: first, text });
153
+ }
154
+ return out;
155
+ }
156
+ /** Does `text` apply a built-in sanitizer for `type`? */
157
+ builtinSanitizes(type, text) {
158
+ for (const { re, type: t } of CSHARP_SANITIZER_RES) {
159
+ if (t === type && re.test(text))
160
+ return true;
161
+ }
162
+ if (type === 'ldap_injection') {
163
+ // RFC 4515 escaping, or stripping, of the filter metacharacters. Both
164
+ // parentheses must be handled: they are what lets input restructure a
165
+ // filter. `x.Replace("(", "\\28").Replace(")", "\\29")`.
166
+ if (/\.\s*Replace\s*\(\s*"\("\s*,/.test(text) && /\.\s*Replace\s*\(\s*"\)"\s*,/.test(text))
167
+ return true;
168
+ }
169
+ if (type === 'path_traversal') {
170
+ // `full.StartsWith(prefix) ? full : null` — the value is handed back
171
+ // only when it is under the prefix.
172
+ if (/\b([A-Za-z_]\w*)\s*\.\s*StartsWith\s*\([^)]*\)\s*\?\s*\1\s*:\s*null\b/.test(text))
173
+ return true;
174
+ }
175
+ return false;
176
+ }
177
+ /**
178
+ * Same-file methods that sanitize for `type`: every `return` hands back a
179
+ * sanitized expression. `static string Clean(string x) { return HtmlEncode(x); }`
180
+ * makes `Clean(input)` an xss sanitizer at its call sites.
181
+ */
182
+ helpers(type) {
183
+ const cached = this.helperCache.get(type);
184
+ if (cached)
185
+ return cached;
186
+ const set = new Set();
187
+ this.helperCache.set(type, set);
188
+ for (const m of this.methods) {
189
+ const returns = this.returnExprs(m);
190
+ if (returns.length === 0)
191
+ continue;
192
+ const ok = returns.every(r => {
193
+ if (this.builtinSanitizes(type, r.expr))
194
+ return true;
195
+ const v = /^([A-Za-z_]\w*)$/.exec(r.expr.trim());
196
+ return !!v && this.sanitizedVarsIn(type, m.start_line, r.line, false).has(v[1]);
197
+ });
198
+ if (ok)
199
+ set.add(m.name);
200
+ }
201
+ return set;
202
+ }
203
+ /** Every returned expression of a method: `return e;` and expression bodies. */
204
+ returnExprs(m) {
205
+ const out = [];
206
+ for (const st of this.statements(m.start_line, m.end_line + 1)) {
207
+ for (const r of st.text.matchAll(/\breturn\s+([^;]+);/g))
208
+ out.push({ line: st.line, expr: r[1] });
209
+ if (st.line === m.start_line) {
210
+ const body = /\)\s*=>\s*(.+?);\s*$/.exec(st.text);
211
+ if (body)
212
+ out.push({ line: st.line, expr: body[1] });
213
+ }
214
+ }
215
+ return out;
216
+ }
217
+ /** Does `text` apply a sanitizer for `type`, built in or a same-file helper? */
218
+ sanitizes(type, text) {
219
+ if (this.builtinSanitizes(type, text))
220
+ return true;
221
+ for (const name of this.helpers(type)) {
222
+ if (new RegExp(`(?<![\\w.])${escapeRegex(name)}\\s*\\(`).test(text))
223
+ return true;
224
+ }
225
+ return false;
226
+ }
227
+ sanitizedVarsIn(type, from, to, withHelpers) {
228
+ const sanitized = new Set();
229
+ for (const st of this.statements(from, to)) {
230
+ const m = ASSIGN_RE.exec(st.text);
231
+ if (!m)
232
+ continue;
233
+ const [, lhs, rhs] = m;
234
+ const credited = (withHelpers ? this.sanitizes(type, rhs) : this.builtinSanitizes(type, rhs)) ||
235
+ [...sanitized].some(v => mentions(rhs, v));
236
+ if (credited)
237
+ sanitized.add(lhs);
238
+ else
239
+ sanitized.delete(lhs);
240
+ }
241
+ return sanitized;
242
+ }
243
+ /**
244
+ * The variables sanitized for `type` at `sinkLine`, judged inside the method
245
+ * that contains the sink (cognium-dev#579). The body is read top to bottom up
246
+ * to the sink and the last assignment to a name decides: a sanitizer call or
247
+ * a derivation from a sanitized name credits it, anything else removes it.
248
+ * Class fields are the caller's concern: they can be sanitized in one method
249
+ * and read in another.
250
+ */
251
+ sanitizedVarsAt(type, sinkLine) {
252
+ return this.sanitizedVarsIn(type, this.methodAt(sinkLine)?.start_line ?? 1, sinkLine, true);
253
+ }
254
+ /**
255
+ * The text of the statement at `line` that a sink call can be in: for
256
+ * `if (COND) sink(x);` that is `sink(x);`, without the condition. A name
257
+ * that only appears in the condition is not something the sink receives.
258
+ */
259
+ sinkText(line) {
260
+ const text = this.lines[line - 1] ?? '';
261
+ const guarded = leadingIf(text);
262
+ return guarded && guarded.rest !== '' ? guarded.rest : text;
263
+ }
264
+ // -------------------------------------------------------------------------
265
+ // Guards
266
+ // -------------------------------------------------------------------------
267
+ /** Variables a condition proves to hold only letters, digits, `_` and `-`. */
268
+ allowlistVars(cond) {
269
+ const out = [];
270
+ const anchored = new RegExp(`\\bRegex\\s*\\.\\s*IsMatch\\s*\\(\\s*(${IDENT})\\s*,\\s*@?"\\^\\[(?:[A-Za-z0-9_\\- ]|\\\\w|\\\\d)+\\](?:[+*]|\\{\\d+(?:,\\d*)?\\})\\$"`, 'g');
271
+ for (const m of cond.matchAll(anchored))
272
+ out.push(m[1]);
273
+ const methodGroup = new RegExp(`(${IDENT})\\s*\\.\\s*All\\s*\\(\\s*char\\s*\\.\\s*Is(?:LetterOrDigit|Digit|Letter)\\s*\\)`, 'g');
274
+ for (const m of cond.matchAll(methodGroup))
275
+ out.push(m[1]);
276
+ const lambda = new RegExp(`(${IDENT})\\s*\\.\\s*All\\s*\\(\\s*(${IDENT})\\s*=>`, 'g');
277
+ for (const m of cond.matchAll(lambda)) {
278
+ const open = cond.indexOf('(', m.index + m[1].length);
279
+ const body = insideParens(cond, open)?.replace(new RegExp(`^\\s*${m[2]}\\s*=>`), '') ?? '';
280
+ const c = escapeRegex(m[2]);
281
+ const residue = body
282
+ .replace(new RegExp(`char\\s*\\.\\s*Is(?:LetterOrDigit|Digit|Letter)\\s*\\(\\s*${c}\\s*\\)`, 'g'), '')
283
+ .replace(new RegExp(`${c}\\s*==\\s*'[_\\-]'`, 'g'), '')
284
+ .replace(/\|\||\s/g, '');
285
+ if (residue === '')
286
+ out.push(m[1]);
287
+ }
288
+ return out;
289
+ }
290
+ /** Variables a condition proves to be numeric (`int.TryParse(x, out _)`). */
291
+ numericVars(cond, parsedFrom) {
292
+ const out = [];
293
+ const tryParse = new RegExp(`\\b(?:int|long|short|byte|uint|ulong|decimal|double|float|Int32|Int64|Guid)\\s*\\.\\s*TryParse\\s*\\(\\s*(${IDENT})\\s*,`, 'g');
294
+ for (const m of cond.matchAll(tryParse))
295
+ out.push(m[1]);
296
+ for (const [parsed, from] of parsedFrom) {
297
+ if (new RegExp(`(?<![\\w])${escapeRegex(parsed)}\\s*(?:!=\\s*null|\\.\\s*HasValue)\\b`).test(cond))
298
+ out.push(from);
299
+ }
300
+ return out;
301
+ }
302
+ /** Variables whose host a condition compares against a constant or an allowlist. */
303
+ hostVars(cond, hostOf) {
304
+ const out = [];
305
+ const compares = (expr) => {
306
+ const e = escapeRegex(expr).replace(/\\ /g, '\\s*');
307
+ return (new RegExp(`${e}\\s*==\\s*@?"[^"]+"`).test(cond) ||
308
+ new RegExp(`@?"[^"]+"\\s*==\\s*${e}`).test(cond) ||
309
+ new RegExp(`${e}\\s*\\.\\s*Equals\\s*\\(`).test(cond) ||
310
+ new RegExp(`\\.\\s*Contains\\s*\\(\\s*${e}\\s*[),]`).test(cond) ||
311
+ new RegExp(`\\bIndexOf\\s*\\([^()]*,\\s*${e}\\s*\\)\\s*>=\\s*0`).test(cond));
312
+ };
313
+ const direct = new RegExp(`new\\s+(?:System\\s*\\.\\s*)?Uri\\s*\\(\\s*(${IDENT})\\s*\\)\\s*\\.\\s*Host\\b`, 'g');
314
+ for (const m of cond.matchAll(direct)) {
315
+ if (compares(m[0]))
316
+ out.push(m[1]);
317
+ }
318
+ for (const [hostVar, from] of hostOf) {
319
+ if (mentions(cond, hostVar) && compares(hostVar))
320
+ out.push(from);
321
+ }
322
+ return out;
323
+ }
324
+ /**
325
+ * Same-file methods that are guards of `kind` on one of their parameters:
326
+ * `static bool IsAllowed(string c) { return Array.IndexOf(Allowed, new Uri(c).Host) >= 0; }`.
327
+ * Maps the method name to the position of the validated parameter.
328
+ */
329
+ guardHelpers(kind) {
330
+ const cached = this.guardHelperCache.get(kind);
331
+ if (cached)
332
+ return cached;
333
+ const map = new Map();
334
+ this.guardHelperCache.set(kind, map);
335
+ for (const m of this.methods) {
336
+ const signature = this.lines[m.start_line - 1] ?? '';
337
+ const open = signature.indexOf('(', signature.indexOf(m.name));
338
+ const params = open === -1 ? null : insideParens(signature, open);
339
+ if (!params)
340
+ continue;
341
+ const names = params.split(',').map(p => p.trim().split(/\s+/).pop() ?? '');
342
+ const returns = this.returnExprs(m);
343
+ if (returns.length !== 1)
344
+ continue;
345
+ const proven = this.provenBy(kind, returns[0].expr, new Map(), new Map(), false);
346
+ const pos = names.findIndex(n => proven.includes(n));
347
+ if (pos !== -1)
348
+ map.set(m.name, pos);
349
+ }
350
+ return map;
351
+ }
352
+ provenBy(kind, cond, parsedFrom, hostOf, withHelpers) {
353
+ const out = kind === 'allowlist' ? this.allowlistVars(cond)
354
+ : kind === 'numeric' ? this.numericVars(cond, parsedFrom)
355
+ : this.hostVars(cond, hostOf);
356
+ if (withHelpers) {
357
+ for (const [name, pos] of this.guardHelpers(kind)) {
358
+ for (const call of cond.matchAll(new RegExp(`(?<![\\w.])${escapeRegex(name)}\\s*\\(`, 'g'))) {
359
+ const args = insideParens(cond, call.index + call[0].length - 1)?.split(',') ?? [];
360
+ const arg = args[pos]?.trim();
361
+ if (arg && new RegExp(`^${IDENT}$`).test(arg))
362
+ out.push(arg);
363
+ }
364
+ }
365
+ }
366
+ return out;
367
+ }
368
+ /**
369
+ * The variables a check dominating `sinkLine` proves safe for `type`.
370
+ *
371
+ * Recognised checks:
372
+ * - allowlist: anchored `Regex.IsMatch(x, "^[A-Za-z0-9_]+$")`, `x.All(char.IsLetterOrDigit)`;
373
+ * - numeric: `int.TryParse(x, out _)`, or `p != null` where `p = int.Parse(x)`;
374
+ * - host (ssrf only): `new Uri(x).Host == "api.example.com"`, an allowlist
375
+ * `Contains` / `IndexOf` of that host.
376
+ * directly, through a `bool` or host variable, or through a same-file helper.
377
+ *
378
+ * A check dominates the sink when the sink is the body of the `if`, is
379
+ * inside its block, or follows an early exit on the negated check
380
+ * (`if (!ok) return;`).
381
+ */
382
+ guardedVarsAt(type, sinkLine) {
383
+ const kinds = [];
384
+ if (INERT_WHEN_ALPHANUMERIC.has(type))
385
+ kinds.push('allowlist', 'numeric');
386
+ if (type === 'ssrf')
387
+ kinds.push('host');
388
+ const proven = new Set();
389
+ if (kinds.length === 0)
390
+ return proven;
391
+ const scopeStart = this.methodAt(sinkLine)?.start_line ?? 1;
392
+ const before = this.statements(scopeStart, sinkLine);
393
+ const boolOf = new Map(); // b = <condition>
394
+ const parsedFrom = new Map(); // p = int.Parse(x)
395
+ const hostOf = new Map(); // h = new Uri(x).Host
396
+ const parseAnywhere = new RegExp(`(${IDENT})\\s*=\\s*(?:\\([^)]*\\)\\s*)?(?:int|long|short|byte|uint|ulong|decimal|double|float|Int32|Int64)\\s*\\.\\s*Parse\\s*\\(\\s*(${IDENT})\\s*[,)]`, 'g');
397
+ for (const st of before) {
398
+ // `try { p = int.Parse(x); }` keeps the assignment off the line start.
399
+ for (const p of st.text.matchAll(parseAnywhere))
400
+ parsedFrom.set(p[1], p[2]);
401
+ const m = ASSIGN_RE.exec(st.text);
402
+ if (!m)
403
+ continue;
404
+ const [, lhs, rhs] = m;
405
+ const parse = new RegExp(`^(?:\\([^)]*\\)\\s*)?(?:int|long|short|byte|uint|ulong|decimal|double|float|Int32|Int64)\\s*\\.\\s*Parse\\s*\\(\\s*(${IDENT})\\s*[,)]`).exec(rhs);
406
+ if (parse)
407
+ parsedFrom.set(lhs, parse[1]);
408
+ const host = new RegExp(`^new\\s+(?:System\\s*\\.\\s*)?Uri\\s*\\(\\s*(${IDENT})\\s*\\)\\s*\\.\\s*Host$`).exec(rhs.trim());
409
+ if (host)
410
+ hostOf.set(lhs, host[1]);
411
+ boolOf.set(lhs, rhs);
412
+ }
413
+ const credit = (cond) => {
414
+ // A bare variable stands for the condition it was assigned.
415
+ const resolved = new RegExp(`^${IDENT}$`).test(cond) ? boolOf.get(cond) ?? cond : cond;
416
+ for (const kind of kinds) {
417
+ for (const v of this.provenBy(kind, resolved, parsedFrom, hostOf, true))
418
+ proven.add(v);
419
+ }
420
+ };
421
+ // (i) the sink is the body of an `if` on its own line.
422
+ const own = leadingIf(this.lines[sinkLine - 1] ?? '');
423
+ if (own && !own.cond.startsWith('!'))
424
+ credit(own.cond);
425
+ // (ii) the sink is inside the block of an `if`.
426
+ let depth = 0;
427
+ for (let i = sinkLine - 1; i >= scopeStart; i--) {
428
+ const text = this.lines[i - 1] ?? '';
429
+ for (let c = text.length - 1; c >= 0; c--) {
430
+ if (text[c] === '}')
431
+ depth++;
432
+ else if (text[c] === '{') {
433
+ if (depth > 0) {
434
+ depth--;
435
+ continue;
436
+ }
437
+ let header = text.slice(0, c);
438
+ for (let h = i - 1; header.trim() === '' && h >= scopeStart; h--)
439
+ header = this.lines[h - 1] ?? '';
440
+ const enclosing = leadingIf(header);
441
+ if (enclosing && !enclosing.cond.startsWith('!'))
442
+ credit(enclosing.cond);
443
+ }
444
+ }
445
+ }
446
+ // (iii) an early exit on the negated check, earlier in the method.
447
+ for (let i = scopeStart; i < sinkLine; i++) {
448
+ const guard = leadingIf(this.lines[i - 1] ?? '');
449
+ if (!guard)
450
+ continue;
451
+ let rest = guard.rest;
452
+ for (let n = i + 1; rest === '' && n < sinkLine; n++)
453
+ rest = (this.lines[n - 1] ?? '').trim();
454
+ if (!EXITS_RE.test(rest))
455
+ continue;
456
+ if (guard.cond.startsWith('!')) {
457
+ // `!(a == b)` drops the wrapping parentheses with the `!`; `!F(x)` keeps its call.
458
+ const inner = guard.cond.slice(1).trim();
459
+ const wrapped = inner.startsWith('(') && insideParens(inner, 0)?.length === inner.length - 2;
460
+ credit(wrapped ? inner.slice(1, -1) : inner);
461
+ }
462
+ else if (/!=/.test(guard.cond) && !/[|&]/.test(guard.cond))
463
+ credit(guard.cond.replace('!=', '=='));
464
+ }
465
+ return proven;
466
+ }
467
+ /**
468
+ * `StringBuilder`s that hold only safe text at `sinkLine`: every write to
469
+ * the builder before the sink is made of string literals and `credited`
470
+ * names. One write with anything else and the builder is not credited, so
471
+ * `sb.Append(validated); sb.Append(raw);` stays tainted.
472
+ *
473
+ * This is how a guard on a value reaches a sink that receives the builder
474
+ * the value was appended to (`if (parsed != null) { sb.Append(data); Compile(sb.ToString()); }`).
475
+ */
476
+ safeBuilders(credited, sinkLine) {
477
+ const scopeStart = this.methodAt(sinkLine)?.start_line ?? 1;
478
+ const onlySafe = (expr) => {
479
+ const idents = expr
480
+ .replace(/\$?@?"(?:[^"\\]|\\.)*"/g, ' ')
481
+ .replace(/'(?:[^'\\]|\\.)'/g, ' ')
482
+ .replace(/\.\s*[A-Za-z_]\w*\s*\(\s*\)/g, ' ') // x.ToString()
483
+ .match(/[A-Za-z_]\w*/g) ?? [];
484
+ return idents.every(id => credited.has(id));
485
+ };
486
+ const state = new Map(); // builder -> still safe
487
+ const declRe = new RegExp(`\\b(?:StringBuilder|var)\\s+(${IDENT})\\s*=\\s*new\\s+(?:System\\s*\\.\\s*Text\\s*\\.\\s*)?StringBuilder\\s*\\(`);
488
+ const writeRe = new RegExp(`^\\s*(${IDENT})\\s*\\.\\s*(?:Append|AppendLine|AppendFormat|Insert)\\s*\\(`);
489
+ for (const st of this.statements(scopeStart, sinkLine)) {
490
+ const decl = declRe.exec(st.text);
491
+ if (decl) {
492
+ const args = insideParens(st.text, decl.index + decl[0].length - 1) ?? '';
493
+ state.set(decl[1], onlySafe(args));
494
+ continue;
495
+ }
496
+ const write = writeRe.exec(st.text);
497
+ if (write && state.has(write[1])) {
498
+ const args = insideParens(st.text, write[0].length - 1);
499
+ if (args === null || !onlySafe(args))
500
+ state.set(write[1], false);
501
+ }
502
+ }
503
+ return new Set([...state].filter(([, safe]) => safe).map(([name]) => name));
504
+ }
505
+ /**
506
+ * True when what leaves on `line` has been sanitized or validated for some
507
+ * sink type. Used for the untyped "tainted data reaches an external call"
508
+ * fallback, which has no sink type of its own to ask about.
509
+ */
510
+ creditedOnLine(line) {
511
+ const text = this.sinkText(line);
512
+ const types = new Set(CSHARP_SANITIZER_RES.map(r => r.type));
513
+ for (const t of INERT_WHEN_ALPHANUMERIC)
514
+ types.add(t);
515
+ types.add('ssrf');
516
+ for (const type of types) {
517
+ if (this.sanitizes(type, text))
518
+ return true;
519
+ const credited = new Set([...this.sanitizedVarsAt(type, line), ...this.guardedVarsAt(type, line)]);
520
+ for (const v of this.safeBuilders(credited, line))
521
+ credited.add(v);
522
+ for (const v of credited)
523
+ if (mentions(text, v))
524
+ return true;
525
+ }
526
+ return this.fixedHostRequest(line);
527
+ }
528
+ // -------------------------------------------------------------------------
529
+ // SSRF: constant host
530
+ // -------------------------------------------------------------------------
531
+ /**
532
+ * True when the request on `sinkLine` goes to a constant host: the URL
533
+ * argument starts with a string literal holding the whole authority, as in
534
+ * `GetAsync("https://api.internal.example.com/?x=" + v)`. Input can then only
535
+ * extend the path or query. The literal must be the first operand of the
536
+ * argument, and must end the authority (`/`, `?` or `#` after the host), or
537
+ * `"https://api.example.com" + x` would let `x = ".evil.org"` move the host.
538
+ */
539
+ fixedHostRequest(sinkLine) {
540
+ const fixedLiteral = '\\$?@?"https?:\\/\\/[A-Za-z0-9.\\-]+(?::\\d+)?[\\/?#][^"]*"';
541
+ const text = this.lines[sinkLine - 1] ?? '';
542
+ const argStart = `\\(\\s*(?:new\\s+(?:System\\s*\\.\\s*)?Uri\\s*\\(\\s*)?`;
543
+ if (new RegExp(argStart + fixedLiteral).test(text))
544
+ return true;
545
+ // The URL was built into a variable first.
546
+ const scopeStart = this.methodAt(sinkLine)?.start_line ?? 1;
547
+ const fixed = new Set();
548
+ for (const st of this.statements(scopeStart, sinkLine)) {
549
+ const m = ASSIGN_RE.exec(st.text);
550
+ if (!m)
551
+ continue;
552
+ if (new RegExp('^(?:new\\s+(?:System\\s*\\.\\s*)?Uri\\s*\\(\\s*)?' + fixedLiteral).test(m[2].trim()))
553
+ fixed.add(m[1]);
554
+ else
555
+ fixed.delete(m[1]);
556
+ }
557
+ for (const v of fixed) {
558
+ if (new RegExp(argStart + escapeRegex(v) + '\\s*[,)]').test(text))
559
+ return true;
560
+ }
561
+ return false;
562
+ }
563
+ }
564
+ //# sourceMappingURL=csharp-sanitizer-credit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"csharp-sanitizer-credit.js","sourceRoot":"","sources":["../../../src/analysis/passes/csharp-sanitizer-credit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,MAAM,yBAAyB,GACpC,6GAA6G,CAAC;AAEhH;;;GAGG;AACH,MAAM,0BAA0B,GAC9B,wIAAwI,CAAC;AAE3I,0EAA0E;AAC1E,4EAA4E;AAC5E,2EAA2E;AAC3E,MAAM,CAAC,MAAM,oBAA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