circle-ir 4.9.19 → 4.9.20
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 -7
- package/dist/analysis/config-loader.js.map +1 -1
- package/dist/browser/circle-ir.js +56 -7
- package/dist/core/circle-ir-core.cjs +56 -7
- package/dist/core/circle-ir-core.js +56 -7
- 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.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,EAwzB1C,CAAC;AA+KF,eAAO,MAAM,aAAa,EAAE,WAAW,EAymEtC,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"}
|
|
@@ -210,12 +210,56 @@ export const DEFAULT_SOURCES = [
|
|
|
210
210
|
{ method: 'getIn', class: 'Exchange', type: 'http_body', severity: 'high', return_tainted: true },
|
|
211
211
|
{ method: 'getHeader', class: 'Message', type: 'http_header', severity: 'high', return_tainted: true },
|
|
212
212
|
// File name sources (common in path traversal vulnerabilities)
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
213
|
+
//
|
|
214
|
+
// cognium-dev#387 — the CLASSLESS `getFileName` was removed with the path
|
|
215
|
+
// projections below. It had no class and no `languages` scope, so it matched
|
|
216
|
+
// every `.getFileName()` anywhere, and it kept `Paths.get("/etc/app.conf")
|
|
217
|
+
// .getFileName()` reporting path_traversal after the class-scoped
|
|
218
|
+
// `Path.getFileName` was dropped — i.e. it silently defeated that removal,
|
|
219
|
+
// the same way the classless `getPath` defeated the first revision of this
|
|
220
|
+
// change. Measured redundant for the sources that matter: with it removed,
|
|
221
|
+
// `Part.getFileName`, `BodyPart`/`MimeBodyPart.getFileName` and
|
|
222
|
+
// `MultipartFile.getOriginalFilename` all still bind their sources from
|
|
223
|
+
// their own class-scoped entries below.
|
|
224
|
+
// cognium-dev#387 — REMOVED as taint sources: `File.getName`,
|
|
225
|
+
// `File.getPath`, `File.getAbsolutePath`, `Path.toString`,
|
|
226
|
+
// `Path.getFileName`, and the classless `getPath` further down this file.
|
|
227
|
+
//
|
|
228
|
+
// All of these are pure path PROJECTIONS: they hand back some part of the
|
|
229
|
+
// path the object already holds. They cannot introduce taint that is not
|
|
230
|
+
// already present — if the File/Path was built from untrusted input,
|
|
231
|
+
// propagation carries it — but as blanket sources they turned every
|
|
232
|
+
// program-constructed path into a high-severity source, and the enclosing
|
|
233
|
+
// call is usually itself a sink, so source and sink land on the same line.
|
|
234
|
+
// Each of these was a measured false positive with NO untrusted input
|
|
235
|
+
// anywhere in the file:
|
|
236
|
+
//
|
|
237
|
+
// File f = new File("/etc/app.conf");
|
|
238
|
+
// new FileInputStream(f.getAbsolutePath()); // path_traversal
|
|
239
|
+
// new FileInputStream(f.getPath()); // path_traversal
|
|
240
|
+
// new FileInputStream("/d/" + f.getName()); // path_traversal
|
|
241
|
+
// Paths.get("/etc/app.conf").getFileName(); // path_traversal
|
|
242
|
+
//
|
|
243
|
+
// and conversely, with a genuinely tainted path the finding does NOT depend
|
|
244
|
+
// on the projection being a source: it comes from the http source and
|
|
245
|
+
// survives. Verified across six shapes — same-method, inline with no
|
|
246
|
+
// intermediate variable, `getPath`, `Paths.get(p).toString()`, a File passed
|
|
247
|
+
// cross-method as a parameter, and a field-held File read in another method.
|
|
248
|
+
//
|
|
249
|
+
// The genuinely untrusted name sources are separately class-scoped and
|
|
250
|
+
// unaffected: `ZipEntry`/`TarArchiveEntry.getName` (Zip/Tar Slip),
|
|
251
|
+
// `MultipartFile.getOriginalFilename`/`getName`, `Part`, `BodyPart`.
|
|
252
|
+
// Measured: those still bind their sources with these removed.
|
|
253
|
+
//
|
|
254
|
+
// NO `listFiles` COVERAGE IS LOST — an earlier revision of this change
|
|
255
|
+
// claimed there was. Measured directly, before vs after, for a File taken
|
|
256
|
+
// from `dir.listFiles()`: `getName` 0 flows -> 0 flows, `getAbsolutePath`
|
|
257
|
+
// 0 -> 0, `getPath` 1 -> 1. The first two never fired in that shape at all,
|
|
258
|
+
// because class resolution does not resolve a for-each variable to `File`.
|
|
259
|
+
// Modelling `listFiles` / `Files.list` / `Files.walk` as sources is still
|
|
260
|
+
// worth doing — the directory listing IS external data — but it is additive,
|
|
261
|
+
// needs its own FP measurement, and is not a regression from this change.
|
|
262
|
+
// Tracked on #387.
|
|
219
263
|
// Multipart file uploads
|
|
220
264
|
{ method: 'getOriginalFilename', class: 'MultipartFile', type: 'file_input', severity: 'high', return_tainted: true },
|
|
221
265
|
{ method: 'getName', class: 'MultipartFile', type: 'file_input', severity: 'high', return_tainted: true },
|
|
@@ -307,7 +351,12 @@ export const DEFAULT_SOURCES = [
|
|
|
307
351
|
// Jenkins/CI pipeline sources
|
|
308
352
|
{ method: 'getScriptPath', type: 'io_input', severity: 'critical', return_tainted: true },
|
|
309
353
|
{ method: 'getFilePathSuffix', type: 'io_input', severity: 'high', return_tainted: true },
|
|
310
|
-
|
|
354
|
+
// cognium-dev#387 — the classless `getPath` was REMOVED here too. The first
|
|
355
|
+
// revision of this change dropped only the class-scoped `File.getPath` and
|
|
356
|
+
// left this one, so `f.getPath()` kept emitting a `file_input` source and the
|
|
357
|
+
// self-flow false positive survived — the change did not do what it claimed.
|
|
358
|
+
// This entry is strictly broader than the one it shadowed: no class and no
|
|
359
|
+
// `languages` scope, so it matched every `.getPath()` in every language.
|
|
311
360
|
{ method: 'contentAsString', type: 'file_input', severity: 'critical', return_tainted: true },
|
|
312
361
|
{ method: 'readAsString', type: 'file_input', severity: 'critical', return_tainted: true },
|
|
313
362
|
{ method: 'content', type: 'file_input', severity: 'high', return_tainted: true },
|