circle-ir 4.9.17 → 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.
@@ -11071,12 +11071,56 @@ var DEFAULT_SOURCES = [
11071
11071
  { method: "getIn", class: "Exchange", type: "http_body", severity: "high", return_tainted: true },
11072
11072
  { method: "getHeader", class: "Message", type: "http_header", severity: "high", return_tainted: true },
11073
11073
  // File name sources (common in path traversal vulnerabilities)
11074
- { method: "getFileName", type: "file_input", severity: "high", return_tainted: true },
11075
- { method: "getName", class: "File", type: "file_input", severity: "high", return_tainted: true },
11076
- { method: "getPath", class: "File", type: "file_input", severity: "high", return_tainted: true },
11077
- { method: "getAbsolutePath", class: "File", type: "file_input", severity: "high", return_tainted: true },
11078
- { method: "toString", class: "Path", type: "file_input", severity: "medium", return_tainted: true },
11079
- { method: "getFileName", class: "Path", type: "file_input", severity: "high", return_tainted: true },
11074
+ //
11075
+ // cognium-dev#387 — the CLASSLESS `getFileName` was removed with the path
11076
+ // projections below. It had no class and no `languages` scope, so it matched
11077
+ // every `.getFileName()` anywhere, and it kept `Paths.get("/etc/app.conf")
11078
+ // .getFileName()` reporting path_traversal after the class-scoped
11079
+ // `Path.getFileName` was dropped — i.e. it silently defeated that removal,
11080
+ // the same way the classless `getPath` defeated the first revision of this
11081
+ // change. Measured redundant for the sources that matter: with it removed,
11082
+ // `Part.getFileName`, `BodyPart`/`MimeBodyPart.getFileName` and
11083
+ // `MultipartFile.getOriginalFilename` all still bind their sources from
11084
+ // their own class-scoped entries below.
11085
+ // cognium-dev#387 — REMOVED as taint sources: `File.getName`,
11086
+ // `File.getPath`, `File.getAbsolutePath`, `Path.toString`,
11087
+ // `Path.getFileName`, and the classless `getPath` further down this file.
11088
+ //
11089
+ // All of these are pure path PROJECTIONS: they hand back some part of the
11090
+ // path the object already holds. They cannot introduce taint that is not
11091
+ // already present — if the File/Path was built from untrusted input,
11092
+ // propagation carries it — but as blanket sources they turned every
11093
+ // program-constructed path into a high-severity source, and the enclosing
11094
+ // call is usually itself a sink, so source and sink land on the same line.
11095
+ // Each of these was a measured false positive with NO untrusted input
11096
+ // anywhere in the file:
11097
+ //
11098
+ // File f = new File("/etc/app.conf");
11099
+ // new FileInputStream(f.getAbsolutePath()); // path_traversal
11100
+ // new FileInputStream(f.getPath()); // path_traversal
11101
+ // new FileInputStream("/d/" + f.getName()); // path_traversal
11102
+ // Paths.get("/etc/app.conf").getFileName(); // path_traversal
11103
+ //
11104
+ // and conversely, with a genuinely tainted path the finding does NOT depend
11105
+ // on the projection being a source: it comes from the http source and
11106
+ // survives. Verified across six shapes — same-method, inline with no
11107
+ // intermediate variable, `getPath`, `Paths.get(p).toString()`, a File passed
11108
+ // cross-method as a parameter, and a field-held File read in another method.
11109
+ //
11110
+ // The genuinely untrusted name sources are separately class-scoped and
11111
+ // unaffected: `ZipEntry`/`TarArchiveEntry.getName` (Zip/Tar Slip),
11112
+ // `MultipartFile.getOriginalFilename`/`getName`, `Part`, `BodyPart`.
11113
+ // Measured: those still bind their sources with these removed.
11114
+ //
11115
+ // NO `listFiles` COVERAGE IS LOST — an earlier revision of this change
11116
+ // claimed there was. Measured directly, before vs after, for a File taken
11117
+ // from `dir.listFiles()`: `getName` 0 flows -> 0 flows, `getAbsolutePath`
11118
+ // 0 -> 0, `getPath` 1 -> 1. The first two never fired in that shape at all,
11119
+ // because class resolution does not resolve a for-each variable to `File`.
11120
+ // Modelling `listFiles` / `Files.list` / `Files.walk` as sources is still
11121
+ // worth doing — the directory listing IS external data — but it is additive,
11122
+ // needs its own FP measurement, and is not a regression from this change.
11123
+ // Tracked on #387.
11080
11124
  // Multipart file uploads
11081
11125
  { method: "getOriginalFilename", class: "MultipartFile", type: "file_input", severity: "high", return_tainted: true },
11082
11126
  { method: "getName", class: "MultipartFile", type: "file_input", severity: "high", return_tainted: true },
@@ -11168,7 +11212,12 @@ var DEFAULT_SOURCES = [
11168
11212
  // Jenkins/CI pipeline sources
11169
11213
  { method: "getScriptPath", type: "io_input", severity: "critical", return_tainted: true },
11170
11214
  { method: "getFilePathSuffix", type: "io_input", severity: "high", return_tainted: true },
11171
- { method: "getPath", type: "file_input", severity: "high", return_tainted: true },
11215
+ // cognium-dev#387 — the classless `getPath` was REMOVED here too. The first
11216
+ // revision of this change dropped only the class-scoped `File.getPath` and
11217
+ // left this one, so `f.getPath()` kept emitting a `file_input` source and the
11218
+ // self-flow false positive survived — the change did not do what it claimed.
11219
+ // This entry is strictly broader than the one it shadowed: no class and no
11220
+ // `languages` scope, so it matched every `.getPath()` in every language.
11172
11221
  { method: "contentAsString", type: "file_input", severity: "critical", return_tainted: true },
11173
11222
  { method: "readAsString", type: "file_input", severity: "critical", return_tainted: true },
11174
11223
  { method: "content", type: "file_input", severity: "high", return_tainted: true },
@@ -11005,12 +11005,56 @@ var DEFAULT_SOURCES = [
11005
11005
  { method: "getIn", class: "Exchange", type: "http_body", severity: "high", return_tainted: true },
11006
11006
  { method: "getHeader", class: "Message", type: "http_header", severity: "high", return_tainted: true },
11007
11007
  // File name sources (common in path traversal vulnerabilities)
11008
- { method: "getFileName", type: "file_input", severity: "high", return_tainted: true },
11009
- { method: "getName", class: "File", type: "file_input", severity: "high", return_tainted: true },
11010
- { method: "getPath", class: "File", type: "file_input", severity: "high", return_tainted: true },
11011
- { method: "getAbsolutePath", class: "File", type: "file_input", severity: "high", return_tainted: true },
11012
- { method: "toString", class: "Path", type: "file_input", severity: "medium", return_tainted: true },
11013
- { method: "getFileName", class: "Path", type: "file_input", severity: "high", return_tainted: true },
11008
+ //
11009
+ // cognium-dev#387 — the CLASSLESS `getFileName` was removed with the path
11010
+ // projections below. It had no class and no `languages` scope, so it matched
11011
+ // every `.getFileName()` anywhere, and it kept `Paths.get("/etc/app.conf")
11012
+ // .getFileName()` reporting path_traversal after the class-scoped
11013
+ // `Path.getFileName` was dropped — i.e. it silently defeated that removal,
11014
+ // the same way the classless `getPath` defeated the first revision of this
11015
+ // change. Measured redundant for the sources that matter: with it removed,
11016
+ // `Part.getFileName`, `BodyPart`/`MimeBodyPart.getFileName` and
11017
+ // `MultipartFile.getOriginalFilename` all still bind their sources from
11018
+ // their own class-scoped entries below.
11019
+ // cognium-dev#387 — REMOVED as taint sources: `File.getName`,
11020
+ // `File.getPath`, `File.getAbsolutePath`, `Path.toString`,
11021
+ // `Path.getFileName`, and the classless `getPath` further down this file.
11022
+ //
11023
+ // All of these are pure path PROJECTIONS: they hand back some part of the
11024
+ // path the object already holds. They cannot introduce taint that is not
11025
+ // already present — if the File/Path was built from untrusted input,
11026
+ // propagation carries it — but as blanket sources they turned every
11027
+ // program-constructed path into a high-severity source, and the enclosing
11028
+ // call is usually itself a sink, so source and sink land on the same line.
11029
+ // Each of these was a measured false positive with NO untrusted input
11030
+ // anywhere in the file:
11031
+ //
11032
+ // File f = new File("/etc/app.conf");
11033
+ // new FileInputStream(f.getAbsolutePath()); // path_traversal
11034
+ // new FileInputStream(f.getPath()); // path_traversal
11035
+ // new FileInputStream("/d/" + f.getName()); // path_traversal
11036
+ // Paths.get("/etc/app.conf").getFileName(); // path_traversal
11037
+ //
11038
+ // and conversely, with a genuinely tainted path the finding does NOT depend
11039
+ // on the projection being a source: it comes from the http source and
11040
+ // survives. Verified across six shapes — same-method, inline with no
11041
+ // intermediate variable, `getPath`, `Paths.get(p).toString()`, a File passed
11042
+ // cross-method as a parameter, and a field-held File read in another method.
11043
+ //
11044
+ // The genuinely untrusted name sources are separately class-scoped and
11045
+ // unaffected: `ZipEntry`/`TarArchiveEntry.getName` (Zip/Tar Slip),
11046
+ // `MultipartFile.getOriginalFilename`/`getName`, `Part`, `BodyPart`.
11047
+ // Measured: those still bind their sources with these removed.
11048
+ //
11049
+ // NO `listFiles` COVERAGE IS LOST — an earlier revision of this change
11050
+ // claimed there was. Measured directly, before vs after, for a File taken
11051
+ // from `dir.listFiles()`: `getName` 0 flows -> 0 flows, `getAbsolutePath`
11052
+ // 0 -> 0, `getPath` 1 -> 1. The first two never fired in that shape at all,
11053
+ // because class resolution does not resolve a for-each variable to `File`.
11054
+ // Modelling `listFiles` / `Files.list` / `Files.walk` as sources is still
11055
+ // worth doing — the directory listing IS external data — but it is additive,
11056
+ // needs its own FP measurement, and is not a regression from this change.
11057
+ // Tracked on #387.
11014
11058
  // Multipart file uploads
11015
11059
  { method: "getOriginalFilename", class: "MultipartFile", type: "file_input", severity: "high", return_tainted: true },
11016
11060
  { method: "getName", class: "MultipartFile", type: "file_input", severity: "high", return_tainted: true },
@@ -11102,7 +11146,12 @@ var DEFAULT_SOURCES = [
11102
11146
  // Jenkins/CI pipeline sources
11103
11147
  { method: "getScriptPath", type: "io_input", severity: "critical", return_tainted: true },
11104
11148
  { method: "getFilePathSuffix", type: "io_input", severity: "high", return_tainted: true },
11105
- { method: "getPath", type: "file_input", severity: "high", return_tainted: true },
11149
+ // cognium-dev#387 — the classless `getPath` was REMOVED here too. The first
11150
+ // revision of this change dropped only the class-scoped `File.getPath` and
11151
+ // left this one, so `f.getPath()` kept emitting a `file_input` source and the
11152
+ // self-flow false positive survived — the change did not do what it claimed.
11153
+ // This entry is strictly broader than the one it shadowed: no class and no
11154
+ // `languages` scope, so it matched every `.getPath()` in every language.
11106
11155
  { method: "contentAsString", type: "file_input", severity: "critical", return_tainted: true },
11107
11156
  { method: "readAsString", type: "file_input", severity: "critical", return_tainted: true },
11108
11157
  { method: "content", type: "file_input", severity: "high", return_tainted: true },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "circle-ir",
3
- "version": "4.9.17",
3
+ "version": "4.9.20",
4
4
  "description": "High-performance Static Application Security Testing (SAST) library for detecting security vulnerabilities through taint analysis",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",