circle-ir 3.181.0 → 3.185.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.
@@ -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,EA2jB1C,CAAC;AA+KF,eAAO,MAAM,aAAa,EAAE,WAAW,EA2wDtC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,gBAAgB,EAwThD,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,sBAAsB,EAAE,kBAAkB,EAiDtD,CAAC;AAEF;;GAEG;AACH,wBAAgB,gBAAgB,I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;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,EAAE,UAAU,EA8F5C,CAAC"}
@@ -522,6 +522,49 @@ export const DEFAULT_SOURCES = [
522
522
  // Server-side interceptor receives `Metadata headers`; `headers.get(KEY)`
523
523
  // returns caller-supplied header values.
524
524
  { method: 'get', class: 'Metadata', type: 'http_header', severity: 'high', return_tainted: true, languages: ['java'] },
525
+ // --- WebSocket transport channels (cognium-dev #213 second slice) ---
526
+ //
527
+ // Server-side WebSocket handlers receive attacker-authored frames on
528
+ // every call to a receive-shaped method. Untrusted the moment they
529
+ // return, regardless of any application-level auth on the socket.
530
+ //
531
+ // Python — FastAPI / Starlette (`from fastapi import WebSocket`):
532
+ // data = await websocket.receive_text()
533
+ // data = await websocket.receive_bytes()
534
+ // data = await websocket.receive_json() # parsed dict/list
535
+ // data = await websocket.receive() # {'type', 'text'|'bytes'}
536
+ { method: 'receive_text', class: 'WebSocket', type: 'network_input', severity: 'high', return_tainted: true, languages: ['python'] },
537
+ { method: 'receive_bytes', class: 'WebSocket', type: 'network_input', severity: 'high', return_tainted: true, languages: ['python'] },
538
+ { method: 'receive_json', class: 'WebSocket', type: 'http_body', severity: 'high', return_tainted: true, languages: ['python'] },
539
+ //
540
+ // `receive` intentionally class-scoped to WebSocket (Starlette pattern).
541
+ // Broadening to unqualified would collide with queue/signal `.receive()`.
542
+ { method: 'receive', class: 'WebSocket', type: 'network_input', severity: 'high', return_tainted: true, languages: ['python'] },
543
+ // Django Channels `AsyncJsonWebsocketConsumer` / `WebsocketConsumer`
544
+ // expose the same receive_* names on `self`; the class filter matches
545
+ // `WebSocket` only, so add unqualified fallbacks for the receive_json /
546
+ // receive_text convention (broad — no class filter possible without
547
+ // hardcoding Django's consumer names).
548
+ { method: 'receive_json', type: 'http_body', severity: 'high', return_tainted: true, languages: ['python'] },
549
+ { method: 'receive_text', type: 'network_input', severity: 'high', return_tainted: true, languages: ['python'] },
550
+ { method: 'receive_bytes', type: 'network_input', severity: 'high', return_tainted: true, languages: ['python'] },
551
+ // Go — gorilla/websocket (`github.com/gorilla/websocket`):
552
+ // messageType, message, err := conn.ReadMessage()
553
+ // _, r, err := conn.NextReader()
554
+ { method: 'ReadMessage', class: 'Conn', type: 'network_input', severity: 'high', return_tainted: true, languages: ['go'] },
555
+ { method: 'NextReader', class: 'Conn', type: 'network_input', severity: 'high', return_tainted: true, languages: ['go'] },
556
+ // nhooyr.io/websocket exposes a `Read` method on `*websocket.Conn`;
557
+ // signature is `func (c *Conn) Read(ctx) (MessageType, []byte, error)`.
558
+ { method: 'Read', class: 'Conn', type: 'network_input', severity: 'high', return_tainted: true, languages: ['go'] },
559
+ // Java — Jakarta / Java WebSocket API (`javax.websocket` / `jakarta.websocket`):
560
+ // session.getBasicRemote().sendText(input); // OUT (not a source)
561
+ // @OnMessage public void onMessage(String msg) — `msg` is a callback
562
+ // param, not a return; handled via param_tainted when annotation is set.
563
+ { annotation: 'OnMessage', type: 'network_input', severity: 'high', param_tainted: true, languages: ['java'] },
564
+ // Spring `@MessageMapping` STOMP-over-WebSocket handlers receive
565
+ // untrusted payloads on every dispatched frame.
566
+ { annotation: 'MessageMapping', type: 'http_body', severity: 'high', param_tainted: true, languages: ['java'] },
567
+ { annotation: 'SubscribeMapping', type: 'http_body', severity: 'high', param_tainted: true, languages: ['java'] },
525
568
  // --- Cache reads (second-order taint — Redis / Memcached / Django cache) ---
526
569
  // The cache round-trip is a canonical second-order sink: whatever was
527
570
  // written previously (potentially attacker-controlled) resurfaces on read.
@@ -2627,6 +2670,60 @@ export const DEFAULT_SANITIZERS = [
2627
2670
  // Python Type coercion
2628
2671
  { method: 'int', removes: ['sql_injection', 'command_injection', 'xss'] },
2629
2672
  { method: 'float', removes: ['sql_injection', 'command_injection'] },
2673
+ // Python URL encoding (cognium-dev #213 fifth slice).
2674
+ //
2675
+ // urllib.parse.quote(x) — RFC-3986 percent-encode; safe for URL path
2676
+ // urllib.parse.quote_plus(x) — same + space→+; safe for query string
2677
+ // urllib.parse.urlencode(d) — encode a dict of pairs
2678
+ //
2679
+ // Bounded to URL-context sinks. Class-scoped to the specific
2680
+ // `urllib.parse` receiver to avoid colliding with unrelated bare
2681
+ // `quote(...)` calls in other libraries.
2682
+ { method: 'quote', class: 'urllib.parse', removes: ['ssrf', 'open_redirect', 'xss', 'path_traversal'] },
2683
+ { method: 'quote_plus', class: 'urllib.parse', removes: ['ssrf', 'open_redirect', 'xss', 'path_traversal'] },
2684
+ { method: 'urlencode', class: 'urllib.parse', removes: ['ssrf', 'open_redirect', 'xss'] },
2685
+ // Bare aliases — `from urllib.parse import quote` then unqualified.
2686
+ { method: 'quote_plus', removes: ['ssrf', 'open_redirect', 'xss', 'path_traversal'] },
2687
+ { method: 'urlencode', removes: ['ssrf', 'open_redirect', 'xss'] },
2688
+ // `quote` bare is intentionally NOT registered — it collides with
2689
+ // shlex.quote (bare-imported) which is a command_injection sanitizer,
2690
+ // not a URL sanitizer. The class-scoped variant above catches the
2691
+ // qualified `urllib.parse.quote(...)` shape; unqualified callers who
2692
+ // want URL-context credit should use `quote_plus` (which does not
2693
+ // collide with any command_injection sanitizer).
2694
+ // Python XSS — additional common sanitizers.
2695
+ //
2696
+ // bleach.clean(...) — already covered above (line 2898)
2697
+ // bleach.linkify(...) — turns URLs into anchor tags; sanitizes as well
2698
+ // django.utils.html.escape / strip_tags — Django's XSS escape helpers
2699
+ // jinja2.escape — Jinja2's Markup escape (aliased from markupsafe)
2700
+ // flask.escape — Flask re-export of markupsafe.escape
2701
+ // saxutils.escape — stdlib xml.sax.saxutils.escape for XML docs
2702
+ { method: 'linkify', class: 'bleach', removes: ['xss'] },
2703
+ // Bare `linkify(...)` alias — `from bleach import linkify`.
2704
+ { method: 'linkify', removes: ['xss'] },
2705
+ { method: 'escape', class: 'django.utils.html', removes: ['xss'] },
2706
+ { method: 'strip_tags', class: 'django.utils.html', removes: ['xss'] },
2707
+ { method: 'escape', class: 'jinja2', removes: ['xss'] },
2708
+ { method: 'escape', class: 'flask', removes: ['xss'] },
2709
+ { method: 'escape', class: 'saxutils', removes: ['xss'] },
2710
+ { method: 'escape', class: 'xml.sax.saxutils', removes: ['xss'] },
2711
+ { method: 'quoteattr', class: 'saxutils', removes: ['xss'] },
2712
+ { method: 'quoteattr', class: 'xml.sax.saxutils', removes: ['xss'] },
2713
+ // Python ReDoS — `re.escape(user)` when building a regex from user input
2714
+ // strips regex metacharacters. Downstream `re.compile / re.match` cannot
2715
+ // interpret user-supplied alternations or quantifiers. Also covers the
2716
+ // `code_injection` categorization that `re.compile` currently emits
2717
+ // (a re.escape-wrapped pattern cannot execute anything, so both are safe).
2718
+ { method: 'escape', class: 're', removes: ['redos', 'code_injection'] },
2719
+ // Python SQLAlchemy — `text(...).bindparams(...)` binds params safely.
2720
+ // The `bindparams` call is the sanitizer; the parent `text` wraps the
2721
+ // template. Also add `expression.literal` for explicit SQL literals.
2722
+ { method: 'bindparams', removes: ['sql_injection'] },
2723
+ // psycopg2 sql-composition helpers
2724
+ { method: 'Identifier', class: 'sql', removes: ['sql_injection'] },
2725
+ { method: 'Literal', class: 'sql', removes: ['sql_injection'] },
2726
+ { method: 'Placeholder', class: 'sql', removes: ['sql_injection'] },
2630
2727
  // =========================================================================
2631
2728
  // Rust Sanitizers
2632
2729
  // =========================================================================