circle-ir 3.186.0 → 3.188.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 +104 -0
- package/dist/analysis/config-loader.js.map +1 -1
- package/dist/browser/circle-ir.js +104 -0
- package/dist/core/circle-ir-core.cjs +104 -0
- package/dist/core/circle-ir-core.js +104 -0
- 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.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
406
406
|
{ annotation: 'Cookie', type: 'http_cookie', severity: 'high', param_tainted: true },
|
|
407
407
|
{ annotation: 'Form', type: 'http_param', severity: 'high', param_tainted: true },
|
|
408
408
|
{ annotation: 'File', type: 'file_input', severity: 'high', param_tainted: true },
|
|
409
|
+
// NestJS controller param decorators (cognium-dev #213 eighth slice).
|
|
410
|
+
//
|
|
411
|
+
// NestJS shares @Body/@Query/@Headers/@Body decorator names with FastAPI
|
|
412
|
+
// and Spring (covered above) but adds a few unique ones:
|
|
413
|
+
// @Param('id') id: string — route path parameter
|
|
414
|
+
// @Req() / @Request() req: Request — the whole request object
|
|
415
|
+
// @Session() session: Session — session data
|
|
416
|
+
// @Ip() ip: string — client IP
|
|
417
|
+
// @HostParam('subdomain') sub: string — subdomain of `host` config
|
|
418
|
+
// @UploadedFile() file: any — multer-uploaded file
|
|
419
|
+
// @UploadedFiles() files: any[] — multer multi-file
|
|
420
|
+
// @Next() — not a source (Express next-fn)
|
|
421
|
+
// Registered without a `languages:` filter so they also credit the shared
|
|
422
|
+
// decorator names in TypeScript (nestjs is TS-first) and any JS project
|
|
423
|
+
// adopting the convention.
|
|
424
|
+
{ annotation: 'Param', type: 'http_path', severity: 'high', param_tainted: true },
|
|
425
|
+
{ annotation: 'Req', type: 'http_body', severity: 'high', param_tainted: true },
|
|
426
|
+
{ annotation: 'Request', type: 'http_body', severity: 'high', param_tainted: true },
|
|
427
|
+
{ annotation: 'Session', type: 'http_cookie', severity: 'high', param_tainted: true },
|
|
428
|
+
{ annotation: 'Ip', type: 'network_input', severity: 'high', param_tainted: true },
|
|
429
|
+
{ annotation: 'HostParam', type: 'http_path', severity: 'high', param_tainted: true },
|
|
430
|
+
{ annotation: 'UploadedFile', type: 'file_input', severity: 'high', param_tainted: true },
|
|
431
|
+
{ annotation: 'UploadedFiles', type: 'file_input', severity: 'high', param_tainted: true },
|
|
409
432
|
// FastAPI Request object
|
|
410
433
|
{ method: 'json', class: 'Request', type: 'http_body', severity: 'high', return_tainted: true },
|
|
411
434
|
{ method: 'form', class: 'Request', type: 'http_param', severity: 'high', return_tainted: true },
|
|
@@ -2478,10 +2501,49 @@ export const DEFAULT_SINKS = [
|
|
|
2478
2501
|
export const DEFAULT_SANITIZERS = [
|
|
2479
2502
|
// SQL Injection - proper parameter binding sanitizes input
|
|
2480
2503
|
// Note: prepareStatement alone is NOT a sanitizer - it's a sink when used with concatenation
|
|
2504
|
+
//
|
|
2505
|
+
// Full PreparedStatement setter coverage (cognium-dev #213 seventh slice).
|
|
2506
|
+
// Every JDBC PreparedStatement.setXxx binds a parameter placeholder via
|
|
2507
|
+
// the driver wire protocol — the SQL text is fixed, only the value slot
|
|
2508
|
+
// varies. Prior coverage was setString/setInt/setLong only; extending
|
|
2509
|
+
// to the full JDBC 4.x setter surface so real Java apps using date/
|
|
2510
|
+
// decimal/object/binary bindings credit as sanitized.
|
|
2481
2511
|
{ method: 'setString', class: 'PreparedStatement', removes: ['sql_injection'] },
|
|
2512
|
+
{ method: 'setNString', class: 'PreparedStatement', removes: ['sql_injection'] },
|
|
2482
2513
|
{ method: 'setInt', class: 'PreparedStatement', removes: ['sql_injection'] },
|
|
2483
2514
|
{ method: 'setLong', class: 'PreparedStatement', removes: ['sql_injection'] },
|
|
2515
|
+
{ method: 'setShort', class: 'PreparedStatement', removes: ['sql_injection'] },
|
|
2516
|
+
{ method: 'setByte', class: 'PreparedStatement', removes: ['sql_injection'] },
|
|
2517
|
+
{ method: 'setBoolean', class: 'PreparedStatement', removes: ['sql_injection'] },
|
|
2518
|
+
{ method: 'setDouble', class: 'PreparedStatement', removes: ['sql_injection'] },
|
|
2519
|
+
{ method: 'setFloat', class: 'PreparedStatement', removes: ['sql_injection'] },
|
|
2520
|
+
{ method: 'setBigDecimal', class: 'PreparedStatement', removes: ['sql_injection'] },
|
|
2521
|
+
{ method: 'setBytes', class: 'PreparedStatement', removes: ['sql_injection'] },
|
|
2522
|
+
{ method: 'setDate', class: 'PreparedStatement', removes: ['sql_injection'] },
|
|
2523
|
+
{ method: 'setTime', class: 'PreparedStatement', removes: ['sql_injection'] },
|
|
2524
|
+
{ method: 'setTimestamp', class: 'PreparedStatement', removes: ['sql_injection'] },
|
|
2525
|
+
{ method: 'setObject', class: 'PreparedStatement', removes: ['sql_injection'] },
|
|
2526
|
+
{ method: 'setNull', class: 'PreparedStatement', removes: ['sql_injection'] },
|
|
2527
|
+
{ method: 'setArray', class: 'PreparedStatement', removes: ['sql_injection'] },
|
|
2528
|
+
{ method: 'setBlob', class: 'PreparedStatement', removes: ['sql_injection'] },
|
|
2529
|
+
{ method: 'setClob', class: 'PreparedStatement', removes: ['sql_injection'] },
|
|
2530
|
+
{ method: 'setNClob', class: 'PreparedStatement', removes: ['sql_injection'] },
|
|
2531
|
+
{ method: 'setRef', class: 'PreparedStatement', removes: ['sql_injection'] },
|
|
2532
|
+
{ method: 'setRowId', class: 'PreparedStatement', removes: ['sql_injection'] },
|
|
2533
|
+
{ method: 'setSQLXML', class: 'PreparedStatement', removes: ['sql_injection'] },
|
|
2534
|
+
{ method: 'setURL', class: 'PreparedStatement', removes: ['sql_injection'] },
|
|
2535
|
+
{ method: 'setBinaryStream', class: 'PreparedStatement', removes: ['sql_injection'] },
|
|
2536
|
+
{ method: 'setCharacterStream', class: 'PreparedStatement', removes: ['sql_injection'] },
|
|
2537
|
+
{ method: 'setAsciiStream', class: 'PreparedStatement', removes: ['sql_injection'] },
|
|
2538
|
+
{ method: 'setNCharacterStream', class: 'PreparedStatement', removes: ['sql_injection'] },
|
|
2539
|
+
// JPA / Hibernate Query.setParameter — covered above; add TypedQuery
|
|
2540
|
+
// (same interface but distinct type name).
|
|
2484
2541
|
{ method: 'setParameter', class: 'Query', removes: ['sql_injection'] },
|
|
2542
|
+
{ method: 'setParameter', class: 'TypedQuery', removes: ['sql_injection'] },
|
|
2543
|
+
// Spring JdbcTemplate `NamedParameterJdbcTemplate.update / queryForObject`
|
|
2544
|
+
// parameterized shapes use SqlParameterSource.addValue — the addValue
|
|
2545
|
+
// call binds the parameter safely.
|
|
2546
|
+
{ method: 'addValue', class: 'MapSqlParameterSource', removes: ['sql_injection'] },
|
|
2485
2547
|
{ annotation: 'Param', removes: ['sql_injection'] },
|
|
2486
2548
|
// XSS
|
|
2487
2549
|
{ method: 'escapeHtml', removes: ['xss'] },
|
|
@@ -2500,6 +2562,48 @@ export const DEFAULT_SANITIZERS = [
|
|
|
2500
2562
|
{ method: 'render', class: 'Template', removes: ['xss'] }, // Rust askama auto-escapes
|
|
2501
2563
|
{ method: 'encodeForJavaScript', removes: ['xss'] },
|
|
2502
2564
|
{ method: 'encodeForCSS', removes: ['xss'] },
|
|
2565
|
+
// Additional Java XSS sanitizers (cognium-dev #213 seventh slice).
|
|
2566
|
+
//
|
|
2567
|
+
// Guava `HtmlEscapers.htmlEscaper().escape(x)` — the `.escape` call
|
|
2568
|
+
// on the returned Escaper is caught by the generic `escape` rule
|
|
2569
|
+
// above, but explicit registration makes intent clear.
|
|
2570
|
+
// Spring `HtmlUtils.htmlEscape(x)` — htmlEscape already covered
|
|
2571
|
+
// above (bare method name).
|
|
2572
|
+
// Apache Commons Text `StringEscapeUtils.escapeJson / escapeXml11 /
|
|
2573
|
+
// escapeEcmaScript / escapeCsv / escapeXsi`.
|
|
2574
|
+
// OWASP HTML Sanitizer `PolicyFactory.sanitize(html)`.
|
|
2575
|
+
{ method: 'escape', class: 'Escaper', removes: ['xss'] },
|
|
2576
|
+
{ method: 'escape', class: 'HtmlEscapers', removes: ['xss'] },
|
|
2577
|
+
{ method: 'escapeJson', class: 'StringEscapeUtils', removes: ['xss'] },
|
|
2578
|
+
{ method: 'escapeEcmaScript', class: 'StringEscapeUtils', removes: ['xss'] },
|
|
2579
|
+
{ method: 'escapeXml11', class: 'StringEscapeUtils', removes: ['xss'] },
|
|
2580
|
+
{ method: 'escapeXml10', class: 'StringEscapeUtils', removes: ['xss'] },
|
|
2581
|
+
{ method: 'escapeCsv', class: 'StringEscapeUtils', removes: ['xss'] },
|
|
2582
|
+
{ method: 'escapeXsi', class: 'StringEscapeUtils', removes: ['xss'] },
|
|
2583
|
+
{ method: 'escapeJava', class: 'StringEscapeUtils', removes: ['xss'] },
|
|
2584
|
+
// Bare escapeJson / escapeEcmaScript / escapeCsv aliases — common
|
|
2585
|
+
// when statically imported.
|
|
2586
|
+
{ method: 'escapeJson', removes: ['xss'] },
|
|
2587
|
+
{ method: 'escapeEcmaScript', removes: ['xss'] },
|
|
2588
|
+
{ method: 'escapeCsv', removes: ['xss'] },
|
|
2589
|
+
// OWASP HTML sanitizer (`com.googlecode.owasp-java-html-sanitizer`).
|
|
2590
|
+
{ method: 'sanitize', class: 'PolicyFactory', removes: ['xss'] },
|
|
2591
|
+
// Java Base64 / Hex / MessageDigest — encoded output is binary-safe
|
|
2592
|
+
// (cognium-dev #213 seventh slice). None of these carry attacker
|
|
2593
|
+
// shell/SQL/HTML metacharacters through the encoding — Base64 emits
|
|
2594
|
+
// [A-Za-z0-9+/=], Hex emits [0-9a-f], MessageDigest.digest returns
|
|
2595
|
+
// opaque bytes usually toHex/toBase64-encoded downstream.
|
|
2596
|
+
{ method: 'encodeToString', class: 'Encoder', removes: ['sql_injection', 'command_injection', 'xss', 'path_traversal', 'code_injection'] },
|
|
2597
|
+
{ method: 'encode', class: 'Encoder', removes: ['sql_injection', 'command_injection', 'xss', 'path_traversal', 'code_injection'] },
|
|
2598
|
+
{ method: 'encodeHexString', class: 'Hex', removes: ['sql_injection', 'command_injection', 'xss', 'path_traversal', 'code_injection'] },
|
|
2599
|
+
{ method: 'digest', class: 'MessageDigest', removes: ['sql_injection', 'command_injection', 'xss', 'path_traversal', 'code_injection'] },
|
|
2600
|
+
// Bare aliases for encoder chains — `Base64.getEncoder().encodeToString(x)`
|
|
2601
|
+
// has a call-expression receiver (`Base64.getEncoder()`) that the Java IR
|
|
2602
|
+
// rarely resolves to `Encoder`. Same story for `Hex.encodeHexString(x)`
|
|
2603
|
+
// when Hex is imported. These bare-method names are dominated by their
|
|
2604
|
+
// encoding use in practice; false-positive risk is low.
|
|
2605
|
+
{ method: 'encodeToString', removes: ['sql_injection', 'command_injection', 'xss', 'path_traversal', 'code_injection'] },
|
|
2606
|
+
{ method: 'encodeHexString', removes: ['sql_injection', 'command_injection', 'xss', 'path_traversal', 'code_injection'] },
|
|
2503
2607
|
// cognium-dev #249 3.162.0: `open_redirect` restored to the URL-encoder
|
|
2504
2608
|
// sanitizer cluster. Sprint 82 (#189) reclassified `sendRedirect` from
|
|
2505
2609
|
// `ssrf` → `open_redirect` (config-loader.ts:1296-1299) without updating
|