circle-ir 3.73.0 → 3.75.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/configs/sinks/golang.json +8 -8
- package/dist/analysis/config-loader.d.ts.map +1 -1
- package/dist/analysis/config-loader.js +27 -5
- package/dist/analysis/config-loader.js.map +1 -1
- package/dist/analysis/interprocedural.d.ts.map +1 -1
- package/dist/analysis/interprocedural.js +16 -0
- package/dist/analysis/interprocedural.js.map +1 -1
- package/dist/analysis/passes/interprocedural-pass.d.ts.map +1 -1
- package/dist/analysis/passes/interprocedural-pass.js +58 -1
- package/dist/analysis/passes/interprocedural-pass.js.map +1 -1
- package/dist/analysis/passes/language-sources-pass.d.ts.map +1 -1
- package/dist/analysis/passes/language-sources-pass.js +116 -0
- package/dist/analysis/passes/language-sources-pass.js.map +1 -1
- package/dist/analysis/passes/taint-propagation-pass.d.ts.map +1 -1
- package/dist/analysis/passes/taint-propagation-pass.js +54 -0
- package/dist/analysis/passes/taint-propagation-pass.js.map +1 -1
- package/dist/analysis/passes/weak-random-pass.d.ts.map +1 -1
- package/dist/analysis/passes/weak-random-pass.js +11 -0
- package/dist/analysis/passes/weak-random-pass.js.map +1 -1
- package/dist/analysis/taint-matcher.d.ts.map +1 -1
- package/dist/analysis/taint-matcher.js +83 -0
- package/dist/analysis/taint-matcher.js.map +1 -1
- package/dist/browser/circle-ir.js +242 -7
- package/dist/core/circle-ir-core.cjs +70 -5
- package/dist/core/circle-ir-core.js +70 -5
- package/package.json +1 -1
|
@@ -143,19 +143,19 @@
|
|
|
143
143
|
{
|
|
144
144
|
"method": "Clean",
|
|
145
145
|
"class": "filepath",
|
|
146
|
-
"removes": ["path_traversal"],
|
|
146
|
+
"removes": ["path_traversal", "external_taint_escape"],
|
|
147
147
|
"note": "filepath.Clean normalizes path, preventing traversal"
|
|
148
148
|
},
|
|
149
149
|
{
|
|
150
150
|
"method": "EscapeString",
|
|
151
151
|
"class": "html",
|
|
152
|
-
"removes": ["xss"],
|
|
153
|
-
"note": "html.EscapeString escapes HTML entities"
|
|
152
|
+
"removes": ["xss", "external_taint_escape", "log_injection", "open_redirect"],
|
|
153
|
+
"note": "html.EscapeString escapes HTML entities — safe for HTML output and structured logs"
|
|
154
154
|
},
|
|
155
155
|
{
|
|
156
156
|
"method": "HTMLEscapeString",
|
|
157
157
|
"class": "template",
|
|
158
|
-
"removes": ["xss"],
|
|
158
|
+
"removes": ["xss", "external_taint_escape", "log_injection", "open_redirect"],
|
|
159
159
|
"note": "template.HTMLEscapeString escapes HTML"
|
|
160
160
|
},
|
|
161
161
|
{
|
|
@@ -198,25 +198,25 @@
|
|
|
198
198
|
{
|
|
199
199
|
"method": "Base",
|
|
200
200
|
"class": "filepath",
|
|
201
|
-
"removes": ["path_traversal"],
|
|
201
|
+
"removes": ["path_traversal", "external_taint_escape"],
|
|
202
202
|
"note": "filepath.Base returns final element only — strips traversal segments"
|
|
203
203
|
},
|
|
204
204
|
{
|
|
205
205
|
"method": "EvalSymlinks",
|
|
206
206
|
"class": "filepath",
|
|
207
|
-
"removes": ["path_traversal"],
|
|
207
|
+
"removes": ["path_traversal", "external_taint_escape"],
|
|
208
208
|
"note": "filepath.EvalSymlinks resolves symlinks to absolute path"
|
|
209
209
|
},
|
|
210
210
|
{
|
|
211
211
|
"method": "Clean",
|
|
212
212
|
"class": "path",
|
|
213
|
-
"removes": ["path_traversal"],
|
|
213
|
+
"removes": ["path_traversal", "external_taint_escape"],
|
|
214
214
|
"note": "path.Clean (slash-only) normalizes ../ segments"
|
|
215
215
|
},
|
|
216
216
|
{
|
|
217
217
|
"method": "Base",
|
|
218
218
|
"class": "path",
|
|
219
|
-
"removes": ["path_traversal"],
|
|
219
|
+
"removes": ["path_traversal", "external_taint_escape"],
|
|
220
220
|
"note": "path.Base returns final slash-element only"
|
|
221
221
|
}
|
|
222
222
|
]
|
|
@@ -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,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;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,cAAc,EAAE,MAAM,EAAE,EACxB,YAAY,EAAE,MAAM,EAAE,GACrB,WAAW,CAQb;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,aAAa,EA2b1C,CAAC;AAEF,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,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;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,cAAc,EAAE,MAAM,EAAE,EACxB,YAAY,EAAE,MAAM,EAAE,GACrB,WAAW,CAQb;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,aAAa,EA2b1C,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,WAAW,EAg+CtC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,gBAAgB,EA4PhD,CAAC;AAEF;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,WAAW,CAM9C;AAMD;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,EAAE,UAAU,EA8F5C,CAAC"}
|
|
@@ -1810,6 +1810,18 @@ export const DEFAULT_SINKS = [
|
|
|
1810
1810
|
// value position so a tainted variable is detected.
|
|
1811
1811
|
{ method: 'Set', class: 'Header', type: 'crlf', cwe: 'CWE-113', severity: 'medium', arg_positions: [1], languages: ['go'] },
|
|
1812
1812
|
{ method: 'Add', class: 'Header', type: 'crlf', cwe: 'CWE-113', severity: 'medium', arg_positions: [1], languages: ['go'] },
|
|
1813
|
+
// Python: Flask/Werkzeug/FastAPI/Django response header sinks (CWE-113).
|
|
1814
|
+
// Subscript assignment (`resp.headers['X-A'] = name`) is NOT covered because
|
|
1815
|
+
// the IR does not emit subscript writes as calls — a known limitation, see
|
|
1816
|
+
// cognium-dev #111. The method-call forms below ARE captured (receiver
|
|
1817
|
+
// suffix-match on `.headers` via receiverMightBeClass).
|
|
1818
|
+
{ method: 'set', class: 'headers', type: 'crlf', cwe: 'CWE-113', severity: 'medium', arg_positions: [1], languages: ['python'] },
|
|
1819
|
+
{ method: 'add', class: 'headers', type: 'crlf', cwe: 'CWE-113', severity: 'medium', arg_positions: [1], languages: ['python'] },
|
|
1820
|
+
{ method: 'setdefault', class: 'headers', type: 'crlf', cwe: 'CWE-113', severity: 'medium', arg_positions: [1], languages: ['python'] },
|
|
1821
|
+
{ method: 'extend', class: 'headers', type: 'crlf', cwe: 'CWE-113', severity: 'medium', arg_positions: [0], languages: ['python'] },
|
|
1822
|
+
{ method: '__setitem__', class: 'headers', type: 'crlf', cwe: 'CWE-113', severity: 'medium', arg_positions: [1], languages: ['python'] },
|
|
1823
|
+
// Flask/Werkzeug response.set_cookie(name, value, ...) — value is CRLF-sensitive.
|
|
1824
|
+
{ method: 'set_cookie', type: 'crlf', cwe: 'CWE-113', severity: 'medium', arg_positions: [1], languages: ['python'] },
|
|
1813
1825
|
// Mass-assignment (CWE-915 / CWE-1321) — Sprint 6, #86; cognium-dev #68 Sprint 10.
|
|
1814
1826
|
// JS Object.assign(target, ...sources), `_.merge`, `_.extend`, `$.extend`,
|
|
1815
1827
|
// `Object.defineProperty` — when fed an attacker-controlled bag, they write
|
|
@@ -1890,11 +1902,21 @@ export const DEFAULT_SANITIZERS = [
|
|
|
1890
1902
|
// (defense-in-depth — mirrors Java getCanonicalPath in this table; the
|
|
1891
1903
|
// stricter Clean+HasPrefix guard recognition is tracked separately).
|
|
1892
1904
|
// EvalSymlinks is the Go equivalent of Java's Path.toRealPath.
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
{ method: '
|
|
1896
|
-
{ method: '
|
|
1897
|
-
{ method: '
|
|
1905
|
+
// Sprint 24 (#102 FP-27): broadened to cover external_taint_escape (CWE-668)
|
|
1906
|
+
// fallback so canonicalised paths don't trigger the synthetic sink.
|
|
1907
|
+
{ method: 'Base', class: 'filepath', removes: ['path_traversal', 'external_taint_escape'] },
|
|
1908
|
+
{ method: 'Base', class: 'path', removes: ['path_traversal', 'external_taint_escape'] },
|
|
1909
|
+
{ method: 'Clean', class: 'filepath', removes: ['path_traversal', 'external_taint_escape'] },
|
|
1910
|
+
{ method: 'Clean', class: 'path', removes: ['path_traversal', 'external_taint_escape'] },
|
|
1911
|
+
{ method: 'EvalSymlinks', class: 'filepath', removes: ['path_traversal', 'external_taint_escape'] },
|
|
1912
|
+
// Go html/template escape helpers (#102 FP-27) — registered explicitly because
|
|
1913
|
+
// configs/sinks/golang.json is not loaded at runtime.
|
|
1914
|
+
{ method: 'EscapeString', class: 'html', removes: ['xss', 'external_taint_escape', 'log_injection', 'open_redirect'] },
|
|
1915
|
+
{ method: 'HTMLEscapeString', class: 'template', removes: ['xss', 'external_taint_escape', 'log_injection', 'open_redirect'] },
|
|
1916
|
+
{ method: 'JSEscapeString', class: 'template', removes: ['xss', 'external_taint_escape', 'log_injection'] },
|
|
1917
|
+
{ method: 'URLQueryEscaper', class: 'template', removes: ['xss', 'external_taint_escape', 'open_redirect'] },
|
|
1918
|
+
{ method: 'QueryEscape', class: 'url', removes: ['xss', 'external_taint_escape', 'open_redirect'] },
|
|
1919
|
+
{ method: 'PathEscape', class: 'url', removes: ['xss', 'external_taint_escape', 'open_redirect'] },
|
|
1898
1920
|
// Log Injection sanitizers
|
|
1899
1921
|
{ method: 'replace', removes: ['log_injection'] }, // Used to remove newlines/control chars
|
|
1900
1922
|
// LDAP Injection
|