circle-ir 3.178.0 → 3.180.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 +30 -0
- package/dist/analysis/config-loader.js.map +1 -1
- package/dist/analysis/dependency-versions.d.ts +171 -0
- package/dist/analysis/dependency-versions.d.ts.map +1 -1
- package/dist/analysis/dependency-versions.js +348 -0
- package/dist/analysis/dependency-versions.js.map +1 -1
- package/dist/analysis/passes/deserialization-safety-gate-pass.d.ts +2 -0
- package/dist/analysis/passes/deserialization-safety-gate-pass.d.ts.map +1 -1
- package/dist/analysis/passes/deserialization-safety-gate-pass.js +56 -9
- package/dist/analysis/passes/deserialization-safety-gate-pass.js.map +1 -1
- package/dist/analysis/passes/python-receiver-taint-format-pass.d.ts +48 -0
- package/dist/analysis/passes/python-receiver-taint-format-pass.d.ts.map +1 -0
- package/dist/analysis/passes/python-receiver-taint-format-pass.js +91 -0
- package/dist/analysis/passes/python-receiver-taint-format-pass.js.map +1 -0
- package/dist/analysis/taint-matcher.d.ts.map +1 -1
- package/dist/analysis/taint-matcher.js +18 -0
- package/dist/analysis/taint-matcher.js.map +1 -1
- package/dist/analyzer.d.ts +46 -0
- package/dist/analyzer.d.ts.map +1 -1
- package/dist/analyzer.js +9 -0
- package/dist/analyzer.js.map +1 -1
- package/dist/browser/circle-ir.js +229 -5
- package/dist/core/circle-ir-core.cjs +35 -0
- package/dist/core/circle-ir-core.js +35 -0
- package/package.json +1 -1
|
@@ -44,6 +44,177 @@ export interface FastjsonPomResolution {
|
|
|
44
44
|
* define).
|
|
45
45
|
*/
|
|
46
46
|
export declare function resolveFastjsonFromPom(pomXml: string): FastjsonPomResolution | null;
|
|
47
|
+
/**
|
|
48
|
+
* Extract the effective Fastjson version from a Gradle build script
|
|
49
|
+
* (`build.gradle` Groovy DSL or `build.gradle.kts` Kotlin DSL).
|
|
50
|
+
*
|
|
51
|
+
* cognium-dev #261 (Gradle-first slice extending #258's pom.xml gate).
|
|
52
|
+
*
|
|
53
|
+
* Recognises three declaration shapes:
|
|
54
|
+
*
|
|
55
|
+
* 1. Direct literal — the classic Groovy / Kotlin single-string form:
|
|
56
|
+
* implementation 'com.alibaba:fastjson:1.2.83_noneautotype'
|
|
57
|
+
* implementation "com.alibaba:fastjson:1.2.83_noneautotype"
|
|
58
|
+
* implementation("com.alibaba:fastjson:1.2.83_noneautotype")
|
|
59
|
+
* Also `api`, `compile`, `runtimeOnly`, `testImplementation`, … — the
|
|
60
|
+
* configuration keyword is not part of the regex; only the
|
|
61
|
+
* `group:artifact:version` triple is matched, so any dependency-
|
|
62
|
+
* configuration prefix works.
|
|
63
|
+
*
|
|
64
|
+
* 2. Groovy interpolation — `implementation "com.alibaba:fastjson:${fastjsonVersion}"`
|
|
65
|
+
* with the property defined via `ext { fastjsonVersion = '1.2.83_noneautotype' }`,
|
|
66
|
+
* `def fastjsonVersion = '1.2.83_noneautotype'`, or top-level `fastjsonVersion = '…'`.
|
|
67
|
+
*
|
|
68
|
+
* 3. Kotlin interpolation — `implementation("com.alibaba:fastjson:$fastjsonVersion")`
|
|
69
|
+
* with the property defined via `val fastjsonVersion = "1.2.83_noneautotype"`
|
|
70
|
+
* or `const val fastjsonVersion = "…"`.
|
|
71
|
+
*
|
|
72
|
+
* Returns `null` on miss (no direct declaration AND no resolvable
|
|
73
|
+
* property reference). The `DeserializationSafetyGatePass` then falls
|
|
74
|
+
* through to its default "do not drop" behaviour on the sink.
|
|
75
|
+
*
|
|
76
|
+
* NOT recognised in this MVP (deferred, follow-ups on #261):
|
|
77
|
+
* - `platform(...)` / `enforcedPlatform(...)` BOM version imports
|
|
78
|
+
* - Version-catalog `libs.versions.toml` references (`libs.fastjson`)
|
|
79
|
+
* - `constraints { }` block versions
|
|
80
|
+
* - `subprojects { }` / `allprojects { }` conditional declarations
|
|
81
|
+
*/
|
|
82
|
+
export declare function resolveFastjsonFromGradle(buildGradle: string): FastjsonPomResolution | null;
|
|
83
|
+
/**
|
|
84
|
+
* Extract the effective Fastjson version from a Gradle version-catalog
|
|
85
|
+
* (`gradle/libs.versions.toml`) combined with the `build.gradle` script
|
|
86
|
+
* that references it via a `libs.<alias>` accessor.
|
|
87
|
+
*
|
|
88
|
+
* cognium-dev #261 (Gradle catalog slice, extending the direct-Gradle
|
|
89
|
+
* shape landed in the first Gradle slice).
|
|
90
|
+
*
|
|
91
|
+
* Recognises the two common `[libraries]` entry shapes:
|
|
92
|
+
*
|
|
93
|
+
* fastjson = { module = "com.alibaba:fastjson", version.ref = "fastjson" }
|
|
94
|
+
* fastjson = { group = "com.alibaba", name = "fastjson", version.ref = "fastjson" }
|
|
95
|
+
*
|
|
96
|
+
* The version can be either a `version.ref` pointer into the
|
|
97
|
+
* `[versions]` section, or an inline `version = "…"` on the library
|
|
98
|
+
* entry itself. Both forms are handled.
|
|
99
|
+
*
|
|
100
|
+
* The build.gradle must reference the resolved alias via a
|
|
101
|
+
* `libs.<alias>` accessor (or `libs.<dashed>` — Gradle normalises
|
|
102
|
+
* dashes to dots for accessor names, but at the toml level the key
|
|
103
|
+
* uses the original form; we match the toml alias here). If the alias
|
|
104
|
+
* isn't referenced anywhere in the build.gradle, returns null — an
|
|
105
|
+
* unreferenced catalog entry is not an active dependency.
|
|
106
|
+
*
|
|
107
|
+
* Returns null when no fastjson library entry exists, when the version
|
|
108
|
+
* cannot be resolved, or when the alias is defined but unreferenced.
|
|
109
|
+
* The `DeserializationSafetyGatePass` then falls through to its
|
|
110
|
+
* default "do not drop" behaviour.
|
|
111
|
+
*/
|
|
112
|
+
export declare function resolveFastjsonFromGradleCatalog(buildGradle: string, libsVersionsToml: string): FastjsonPomResolution | null;
|
|
113
|
+
/**
|
|
114
|
+
* Result of extracting the effective PyYAML version. `safeByDefault` is
|
|
115
|
+
* true when the parsed version is ≥ 6.0; at that point pyyaml.load()
|
|
116
|
+
* without an explicit `Loader=` keyword argument raises TypeError
|
|
117
|
+
* instead of silently invoking the unsafe default Loader.
|
|
118
|
+
*
|
|
119
|
+
* See https://github.com/yaml/pyyaml/blob/master/CHANGES for the full
|
|
120
|
+
* 6.0 breakage story. The gate consumer must ALSO check the call site
|
|
121
|
+
* for an explicit `Loader=` keyword (fileHasUnsafePyYamlLoader below)
|
|
122
|
+
* — a caller under pyyaml ≥ 6.0 that explicitly passes
|
|
123
|
+
* `Loader=yaml.Loader` or `Loader=yaml.UnsafeLoader` is still
|
|
124
|
+
* dangerous regardless of the version pin.
|
|
125
|
+
*/
|
|
126
|
+
export interface PyYamlResolution {
|
|
127
|
+
version: string;
|
|
128
|
+
safeByDefault: boolean;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Extract the effective PyYAML version from a `requirements.txt` file.
|
|
132
|
+
* Recognises the standard PEP 508 shapes (`==`, `>=`, `~=`, `>`,
|
|
133
|
+
* exact pins with trailing modifiers). Package name matched
|
|
134
|
+
* case-insensitively (both `PyYAML` and `pyyaml` are common in the
|
|
135
|
+
* wild).
|
|
136
|
+
*
|
|
137
|
+
* Returns null when no pyyaml line is found or the version string
|
|
138
|
+
* cannot be parsed as `M.m[.p]`. Non-strict on trailing environment
|
|
139
|
+
* markers (` ; python_version >= '3.6'`), which are common on
|
|
140
|
+
* requirements.txt lines.
|
|
141
|
+
*/
|
|
142
|
+
export declare function resolvePyYamlFromRequirements(requirementsTxt: string): PyYamlResolution | null;
|
|
143
|
+
/**
|
|
144
|
+
* Extract the effective PyYAML version from a `pyproject.toml`.
|
|
145
|
+
* Recognises the common Poetry and PEP 621 shapes:
|
|
146
|
+
*
|
|
147
|
+
* Poetry — under `[tool.poetry.dependencies]`:
|
|
148
|
+
* PyYAML = "6.0"
|
|
149
|
+
* pyyaml = "^6.0.1"
|
|
150
|
+
* pyyaml = { version = "6.0", extras = ["..."] }
|
|
151
|
+
*
|
|
152
|
+
* PEP 621 — under `[project]` `dependencies` array:
|
|
153
|
+
* dependencies = [ "PyYAML>=6.0", ... ]
|
|
154
|
+
*
|
|
155
|
+
* As with the requirements.txt resolver, non-strict on markers /
|
|
156
|
+
* modifiers; regex-based rather than a full TOML parser to keep the
|
|
157
|
+
* runtime-dep list minimal (Pillar I minimal-dependencies principle).
|
|
158
|
+
*/
|
|
159
|
+
export declare function resolvePyYamlFromPyproject(pyprojectToml: string): PyYamlResolution | null;
|
|
160
|
+
/**
|
|
161
|
+
* True when `version` (as `M.m[.p]`) is ≥ 6.0. Handles bare `6`,
|
|
162
|
+
* `6.0`, `6.0.1`, `7`, `10.0`, etc. Returns false on malformed input
|
|
163
|
+
* (defensive — the gate defaults to *do not drop* on missing signal).
|
|
164
|
+
*/
|
|
165
|
+
export declare function isPyYamlVersionSafeByDefault(version: string): boolean;
|
|
166
|
+
/**
|
|
167
|
+
* Return true when the file contains an explicit unsafe `Loader=`
|
|
168
|
+
* keyword argument on a `yaml.load(...)` call at or shortly after
|
|
169
|
+
* `sinkLine`. Recognises the well-known unsafe loaders and their
|
|
170
|
+
* qualified forms:
|
|
171
|
+
*
|
|
172
|
+
* Loader=Loader Loader=yaml.Loader
|
|
173
|
+
* Loader=UnsafeLoader Loader=yaml.UnsafeLoader
|
|
174
|
+
* Loader=FullLoader Loader=yaml.FullLoader (technically safer
|
|
175
|
+
* than Loader; still
|
|
176
|
+
* permits arbitrary
|
|
177
|
+
* Python object types)
|
|
178
|
+
*
|
|
179
|
+
* SafeLoader / CSafeLoader / BaseLoader / CBaseLoader are all safe and
|
|
180
|
+
* are NOT matched here.
|
|
181
|
+
*
|
|
182
|
+
* Scans `sinkLine` through the next 9 lines to catch multi-line call
|
|
183
|
+
* shapes; if the closing `)` appears before the window ends the scan
|
|
184
|
+
* stops there. Regex-based (no AST inspection) to stay consistent with
|
|
185
|
+
* the sink-filter-pass conventions and avoid pulling parse state into
|
|
186
|
+
* the gate.
|
|
187
|
+
*/
|
|
188
|
+
export declare function fileHasUnsafePyYamlLoader(sourceLines: string[], sinkLine: number): boolean;
|
|
189
|
+
/**
|
|
190
|
+
* Generic result: the declared version string + the parsed feature list
|
|
191
|
+
* (for `[dependencies] pkg = { version = "…", features = ["safe"] }`
|
|
192
|
+
* shapes). Returns null when the dep is absent, or when the version is
|
|
193
|
+
* a `{ git = "…" }` / `{ path = "…" }` non-registry source (no version
|
|
194
|
+
* string to compare against). Feature-set matching is left to the
|
|
195
|
+
* caller; this helper only parses.
|
|
196
|
+
*/
|
|
197
|
+
export interface CargoDepResolution {
|
|
198
|
+
version: string;
|
|
199
|
+
features: string[];
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Extract the declared version + feature list for a named crate from a
|
|
203
|
+
* `Cargo.toml`. Recognises the standard `[dependencies]` (and
|
|
204
|
+
* `[dev-dependencies]` / `[build-dependencies]`) shapes:
|
|
205
|
+
*
|
|
206
|
+
* pkg = "1.2.3" — bare string
|
|
207
|
+
* pkg = { version = "1.2.3" } — table with version
|
|
208
|
+
* pkg = { version = "1.2.3", features = ["a", "b"] }
|
|
209
|
+
* pkg = { git = "…" } — git source (no version)
|
|
210
|
+
* pkg = { path = "…" } — path source (no version)
|
|
211
|
+
*
|
|
212
|
+
* Cross-table dependency declarations (`[dependencies.pkg]`) are not
|
|
213
|
+
* yet recognised; those are less common and can be added when needed.
|
|
214
|
+
* Regex-based rather than a full TOML parser to keep the runtime-dep
|
|
215
|
+
* list minimal (Pillar I).
|
|
216
|
+
*/
|
|
217
|
+
export declare function resolveDepFromCargoToml(cargoToml: string, crateName: string): CargoDepResolution | null;
|
|
47
218
|
/**
|
|
48
219
|
* Return true when the given source text contains an in-file call that
|
|
49
220
|
* re-enables Fastjson autotype. Even a `_noneautotype` build does not
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependency-versions.d.ts","sourceRoot":"","sources":["../../src/analysis/dependency-versions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,OAAO,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,qBAAqB,GAAG,IAAI,CA8BnF;AAED;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAKrE;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAUtE;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAOrE"}
|
|
1
|
+
{"version":3,"file":"dependency-versions.d.ts","sourceRoot":"","sources":["../../src/analysis/dependency-versions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,OAAO,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,qBAAqB,GAAG,IAAI,CA8BnF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,MAAM,GAAG,qBAAqB,GAAG,IAAI,CA4D3F;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,gCAAgC,CAC9C,WAAW,EAAE,MAAM,EACnB,gBAAgB,EAAE,MAAM,GACvB,qBAAqB,GAAG,IAAI,CAkE9B;AAMD;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,OAAO,CAAC;CACxB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,6BAA6B,CAC3C,eAAe,EAAE,MAAM,GACtB,gBAAgB,GAAG,IAAI,CAuBzB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,0BAA0B,CACxC,aAAa,EAAE,MAAM,GACpB,gBAAgB,GAAG,IAAI,CAiCzB;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAIrE;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,yBAAyB,CACvC,WAAW,EAAE,MAAM,EAAE,EACrB,QAAQ,EAAE,MAAM,GACf,OAAO,CAkBT;AAMD;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,kBAAkB,GAAG,IAAI,CAsC3B;AAED;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAKrE;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAUtE;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAOrE"}
|
|
@@ -65,6 +65,354 @@ export function resolveFastjsonFromPom(pomXml) {
|
|
|
65
65
|
}
|
|
66
66
|
return null;
|
|
67
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* Extract the effective Fastjson version from a Gradle build script
|
|
70
|
+
* (`build.gradle` Groovy DSL or `build.gradle.kts` Kotlin DSL).
|
|
71
|
+
*
|
|
72
|
+
* cognium-dev #261 (Gradle-first slice extending #258's pom.xml gate).
|
|
73
|
+
*
|
|
74
|
+
* Recognises three declaration shapes:
|
|
75
|
+
*
|
|
76
|
+
* 1. Direct literal — the classic Groovy / Kotlin single-string form:
|
|
77
|
+
* implementation 'com.alibaba:fastjson:1.2.83_noneautotype'
|
|
78
|
+
* implementation "com.alibaba:fastjson:1.2.83_noneautotype"
|
|
79
|
+
* implementation("com.alibaba:fastjson:1.2.83_noneautotype")
|
|
80
|
+
* Also `api`, `compile`, `runtimeOnly`, `testImplementation`, … — the
|
|
81
|
+
* configuration keyword is not part of the regex; only the
|
|
82
|
+
* `group:artifact:version` triple is matched, so any dependency-
|
|
83
|
+
* configuration prefix works.
|
|
84
|
+
*
|
|
85
|
+
* 2. Groovy interpolation — `implementation "com.alibaba:fastjson:${fastjsonVersion}"`
|
|
86
|
+
* with the property defined via `ext { fastjsonVersion = '1.2.83_noneautotype' }`,
|
|
87
|
+
* `def fastjsonVersion = '1.2.83_noneautotype'`, or top-level `fastjsonVersion = '…'`.
|
|
88
|
+
*
|
|
89
|
+
* 3. Kotlin interpolation — `implementation("com.alibaba:fastjson:$fastjsonVersion")`
|
|
90
|
+
* with the property defined via `val fastjsonVersion = "1.2.83_noneautotype"`
|
|
91
|
+
* or `const val fastjsonVersion = "…"`.
|
|
92
|
+
*
|
|
93
|
+
* Returns `null` on miss (no direct declaration AND no resolvable
|
|
94
|
+
* property reference). The `DeserializationSafetyGatePass` then falls
|
|
95
|
+
* through to its default "do not drop" behaviour on the sink.
|
|
96
|
+
*
|
|
97
|
+
* NOT recognised in this MVP (deferred, follow-ups on #261):
|
|
98
|
+
* - `platform(...)` / `enforcedPlatform(...)` BOM version imports
|
|
99
|
+
* - Version-catalog `libs.versions.toml` references (`libs.fastjson`)
|
|
100
|
+
* - `constraints { }` block versions
|
|
101
|
+
* - `subprojects { }` / `allprojects { }` conditional declarations
|
|
102
|
+
*/
|
|
103
|
+
export function resolveFastjsonFromGradle(buildGradle) {
|
|
104
|
+
if (!buildGradle)
|
|
105
|
+
return null;
|
|
106
|
+
// Shape 1 — direct literal declaration. Accepts single-quoted,
|
|
107
|
+
// double-quoted, or paren-wrapped ("Kotlin") forms. The version is
|
|
108
|
+
// any non-quote / non-`$` / non-`)` / non-whitespace run.
|
|
109
|
+
const directRe = /['"(]\s*com\.alibaba:fastjson:([^'"$\s)]+)\s*['")]/;
|
|
110
|
+
const direct = buildGradle.match(directRe);
|
|
111
|
+
if (direct) {
|
|
112
|
+
const version = direct[1];
|
|
113
|
+
return { version, noneAutotype: /_noneautotype/i.test(version) };
|
|
114
|
+
}
|
|
115
|
+
// Shape 4 — `constraints { }` block with a `version { strictly/
|
|
116
|
+
// require/prefer 'X' }` sub-block. cognium-dev #261 (extended forms).
|
|
117
|
+
//
|
|
118
|
+
// constraints {
|
|
119
|
+
// implementation('com.alibaba:fastjson') {
|
|
120
|
+
// version {
|
|
121
|
+
// strictly '1.2.83_noneautotype'
|
|
122
|
+
// }
|
|
123
|
+
// }
|
|
124
|
+
// }
|
|
125
|
+
//
|
|
126
|
+
// Non-greedy `[\s\S]*?` across the outer + inner braces so we don't
|
|
127
|
+
// fuse sibling constraint entries. Accepts strictly / require /
|
|
128
|
+
// prefer — all three specify a concrete version.
|
|
129
|
+
const constraintsBlockRe = /['"(]\s*com\.alibaba:fastjson\s*['")]\s*\)?\s*\{[\s\S]*?\bversion\s*\{[\s\S]*?\b(?:strictly|require|prefer)\s+['"]([^'"\s]+)['"]/;
|
|
130
|
+
const constraintsBlock = buildGradle.match(constraintsBlockRe);
|
|
131
|
+
if (constraintsBlock) {
|
|
132
|
+
const version = constraintsBlock[1];
|
|
133
|
+
return { version, noneAutotype: /_noneautotype/i.test(version) };
|
|
134
|
+
}
|
|
135
|
+
// Shapes 2 + 3 — property reference. Capture the property name (either
|
|
136
|
+
// `${name}` Groovy form or `$name` bare form; Kotlin uses the same
|
|
137
|
+
// string-template syntax as Groovy for this case).
|
|
138
|
+
const propRefRe = /['"(]\s*com\.alibaba:fastjson:\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?\s*['")]/;
|
|
139
|
+
const propRef = buildGradle.match(propRefRe);
|
|
140
|
+
if (!propRef)
|
|
141
|
+
return null;
|
|
142
|
+
const propName = propRef[1];
|
|
143
|
+
// Property definition — accept:
|
|
144
|
+
// `fastjsonVersion = 'X'` (Groovy top-level or ext)
|
|
145
|
+
// `fastjsonVersion = "X"` (Groovy interpolated)
|
|
146
|
+
// `def fastjsonVersion = 'X'` (Groovy local)
|
|
147
|
+
// `val fastjsonVersion = "X"` (Kotlin)
|
|
148
|
+
// `const val fastjsonVersion = "X"` (Kotlin)
|
|
149
|
+
// `fastjsonVersion: 'X'` (Groovy map-syntax, rare)
|
|
150
|
+
// Any leading whitespace / newlines / `=` / `:` before the quote.
|
|
151
|
+
const defRe = new RegExp(`\\b${propName}\\s*[=:]\\s*['"]([^'"\\s]+)['"]`);
|
|
152
|
+
const def = buildGradle.match(defRe);
|
|
153
|
+
if (!def)
|
|
154
|
+
return null;
|
|
155
|
+
const version = def[1];
|
|
156
|
+
return { version, noneAutotype: /_noneautotype/i.test(version) };
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Extract the effective Fastjson version from a Gradle version-catalog
|
|
160
|
+
* (`gradle/libs.versions.toml`) combined with the `build.gradle` script
|
|
161
|
+
* that references it via a `libs.<alias>` accessor.
|
|
162
|
+
*
|
|
163
|
+
* cognium-dev #261 (Gradle catalog slice, extending the direct-Gradle
|
|
164
|
+
* shape landed in the first Gradle slice).
|
|
165
|
+
*
|
|
166
|
+
* Recognises the two common `[libraries]` entry shapes:
|
|
167
|
+
*
|
|
168
|
+
* fastjson = { module = "com.alibaba:fastjson", version.ref = "fastjson" }
|
|
169
|
+
* fastjson = { group = "com.alibaba", name = "fastjson", version.ref = "fastjson" }
|
|
170
|
+
*
|
|
171
|
+
* The version can be either a `version.ref` pointer into the
|
|
172
|
+
* `[versions]` section, or an inline `version = "…"` on the library
|
|
173
|
+
* entry itself. Both forms are handled.
|
|
174
|
+
*
|
|
175
|
+
* The build.gradle must reference the resolved alias via a
|
|
176
|
+
* `libs.<alias>` accessor (or `libs.<dashed>` — Gradle normalises
|
|
177
|
+
* dashes to dots for accessor names, but at the toml level the key
|
|
178
|
+
* uses the original form; we match the toml alias here). If the alias
|
|
179
|
+
* isn't referenced anywhere in the build.gradle, returns null — an
|
|
180
|
+
* unreferenced catalog entry is not an active dependency.
|
|
181
|
+
*
|
|
182
|
+
* Returns null when no fastjson library entry exists, when the version
|
|
183
|
+
* cannot be resolved, or when the alias is defined but unreferenced.
|
|
184
|
+
* The `DeserializationSafetyGatePass` then falls through to its
|
|
185
|
+
* default "do not drop" behaviour.
|
|
186
|
+
*/
|
|
187
|
+
export function resolveFastjsonFromGradleCatalog(buildGradle, libsVersionsToml) {
|
|
188
|
+
if (!buildGradle || !libsVersionsToml)
|
|
189
|
+
return null;
|
|
190
|
+
// 1. Locate the [libraries] block. Non-greedy to next `[section]` or EOF.
|
|
191
|
+
const librariesMatch = libsVersionsToml.match(/\[libraries\]([\s\S]*?)(?=\n\[|$)/);
|
|
192
|
+
if (!librariesMatch)
|
|
193
|
+
return null;
|
|
194
|
+
const librariesBlock = librariesMatch[1];
|
|
195
|
+
// 2. Find the alias whose entry maps to com.alibaba:fastjson. Try
|
|
196
|
+
// both `module = "com.alibaba:fastjson"` and split
|
|
197
|
+
// `group = "com.alibaba"` + `name = "fastjson"` forms.
|
|
198
|
+
const moduleForm = librariesBlock.match(/^\s*([\w.-]+)\s*=\s*\{[^}]*\bmodule\s*=\s*"com\.alibaba:fastjson"[^}]*\}/m);
|
|
199
|
+
const groupNameForm = librariesBlock.match(/^\s*([\w.-]+)\s*=\s*\{[^}]*\bgroup\s*=\s*"com\.alibaba"[^}]*\bname\s*=\s*"fastjson"[^}]*\}/m);
|
|
200
|
+
const entry = moduleForm ?? groupNameForm;
|
|
201
|
+
if (!entry)
|
|
202
|
+
return null;
|
|
203
|
+
const alias = entry[1];
|
|
204
|
+
const entryBody = entry[0];
|
|
205
|
+
// 3. The build script must actually consume this alias — an unused
|
|
206
|
+
// catalog entry is not an active dep. The Gradle accessor form is
|
|
207
|
+
// `libs.<alias>` (or `libs.<pathified>` for dot-separated aliases;
|
|
208
|
+
// for the MVP we match the alias verbatim).
|
|
209
|
+
const aliasEsc = alias.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
210
|
+
const aliasRefRe = new RegExp(`\\blibs\\s*\\.\\s*${aliasEsc}\\b`);
|
|
211
|
+
if (!aliasRefRe.test(buildGradle))
|
|
212
|
+
return null;
|
|
213
|
+
// 4. Extract version. Inline `version = "..."` on the library entry
|
|
214
|
+
// beats `version.ref` if both are present (matches Gradle's own
|
|
215
|
+
// resolution).
|
|
216
|
+
const inlineVersionM = entryBody.match(/\bversion\s*=\s*"([^"$][^"]*)"/);
|
|
217
|
+
if (inlineVersionM) {
|
|
218
|
+
const version = inlineVersionM[1];
|
|
219
|
+
return { version, noneAutotype: /_noneautotype/i.test(version) };
|
|
220
|
+
}
|
|
221
|
+
const versionRefM = entryBody.match(/\bversion\.ref\s*=\s*"([^"]+)"/);
|
|
222
|
+
if (!versionRefM)
|
|
223
|
+
return null;
|
|
224
|
+
const versionAlias = versionRefM[1];
|
|
225
|
+
// 5. Look up the version-alias in the [versions] block.
|
|
226
|
+
const versionsMatch = libsVersionsToml.match(/\[versions\]([\s\S]*?)(?=\n\[|$)/);
|
|
227
|
+
if (!versionsMatch)
|
|
228
|
+
return null;
|
|
229
|
+
const versionsBlock = versionsMatch[1];
|
|
230
|
+
const versionAliasEsc = versionAlias.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
231
|
+
const versionLineRe = new RegExp(`^\\s*${versionAliasEsc}\\s*=\\s*"([^"]+)"`, 'm');
|
|
232
|
+
const versionLine = versionsBlock.match(versionLineRe);
|
|
233
|
+
if (!versionLine)
|
|
234
|
+
return null;
|
|
235
|
+
const version = versionLine[1];
|
|
236
|
+
return { version, noneAutotype: /_noneautotype/i.test(version) };
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Extract the effective PyYAML version from a `requirements.txt` file.
|
|
240
|
+
* Recognises the standard PEP 508 shapes (`==`, `>=`, `~=`, `>`,
|
|
241
|
+
* exact pins with trailing modifiers). Package name matched
|
|
242
|
+
* case-insensitively (both `PyYAML` and `pyyaml` are common in the
|
|
243
|
+
* wild).
|
|
244
|
+
*
|
|
245
|
+
* Returns null when no pyyaml line is found or the version string
|
|
246
|
+
* cannot be parsed as `M.m[.p]`. Non-strict on trailing environment
|
|
247
|
+
* markers (` ; python_version >= '3.6'`), which are common on
|
|
248
|
+
* requirements.txt lines.
|
|
249
|
+
*/
|
|
250
|
+
export function resolvePyYamlFromRequirements(requirementsTxt) {
|
|
251
|
+
if (!requirementsTxt)
|
|
252
|
+
return null;
|
|
253
|
+
// Iterate line-by-line so a fatal parse error on one line doesn't
|
|
254
|
+
// sink the whole file. Comment lines and `-r other.txt` includes are
|
|
255
|
+
// ignored (we don't recurse into included files here — the caller
|
|
256
|
+
// controls what manifest string is passed).
|
|
257
|
+
for (const rawLine of requirementsTxt.split(/\r?\n/)) {
|
|
258
|
+
const line = rawLine.replace(/#.*$/, '').trim();
|
|
259
|
+
if (!line)
|
|
260
|
+
continue;
|
|
261
|
+
if (line.startsWith('-'))
|
|
262
|
+
continue;
|
|
263
|
+
// Match: `PyYAML==6.0`, `pyyaml>=6.0.1`, `PyYAML ~= 6.0`,
|
|
264
|
+
// `pyyaml>6`, `PyYAML==6.0 ; python_version>='3.6'`
|
|
265
|
+
const m = line.match(/^(pyyaml)\s*(==|>=|~=|>|===)\s*(\d+(?:\.\d+)*)/i);
|
|
266
|
+
if (!m)
|
|
267
|
+
continue;
|
|
268
|
+
const version = m[3];
|
|
269
|
+
return { version, safeByDefault: isPyYamlVersionSafeByDefault(version) };
|
|
270
|
+
}
|
|
271
|
+
return null;
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Extract the effective PyYAML version from a `pyproject.toml`.
|
|
275
|
+
* Recognises the common Poetry and PEP 621 shapes:
|
|
276
|
+
*
|
|
277
|
+
* Poetry — under `[tool.poetry.dependencies]`:
|
|
278
|
+
* PyYAML = "6.0"
|
|
279
|
+
* pyyaml = "^6.0.1"
|
|
280
|
+
* pyyaml = { version = "6.0", extras = ["..."] }
|
|
281
|
+
*
|
|
282
|
+
* PEP 621 — under `[project]` `dependencies` array:
|
|
283
|
+
* dependencies = [ "PyYAML>=6.0", ... ]
|
|
284
|
+
*
|
|
285
|
+
* As with the requirements.txt resolver, non-strict on markers /
|
|
286
|
+
* modifiers; regex-based rather than a full TOML parser to keep the
|
|
287
|
+
* runtime-dep list minimal (Pillar I minimal-dependencies principle).
|
|
288
|
+
*/
|
|
289
|
+
export function resolvePyYamlFromPyproject(pyprojectToml) {
|
|
290
|
+
if (!pyprojectToml)
|
|
291
|
+
return null;
|
|
292
|
+
// Poetry key = string form.
|
|
293
|
+
// PyYAML = "6.0" PyYAML = "^6.0" pyyaml = "~=6.0"
|
|
294
|
+
const poetryLine = pyprojectToml.match(/^\s*(pyyaml)\s*=\s*"([\^~=<>]*)(\d+(?:\.\d+)*)"/im);
|
|
295
|
+
if (poetryLine) {
|
|
296
|
+
const version = poetryLine[3];
|
|
297
|
+
return { version, safeByDefault: isPyYamlVersionSafeByDefault(version) };
|
|
298
|
+
}
|
|
299
|
+
// Poetry table form: `pyyaml = { version = "6.0", … }`
|
|
300
|
+
const poetryTable = pyprojectToml.match(/^\s*(pyyaml)\s*=\s*\{[^}]*\bversion\s*=\s*"([\^~=<>]*)(\d+(?:\.\d+)*)"/im);
|
|
301
|
+
if (poetryTable) {
|
|
302
|
+
const version = poetryTable[3];
|
|
303
|
+
return { version, safeByDefault: isPyYamlVersionSafeByDefault(version) };
|
|
304
|
+
}
|
|
305
|
+
// PEP 621 array element: within a `dependencies = [ ... ]` block, a
|
|
306
|
+
// string literal like `"PyYAML>=6.0"` or `"pyyaml==6.0.1"`.
|
|
307
|
+
const pep621 = pyprojectToml.match(/"(pyyaml)\s*(==|>=|~=|>|===)\s*(\d+(?:\.\d+)*)/i);
|
|
308
|
+
if (pep621) {
|
|
309
|
+
const version = pep621[3];
|
|
310
|
+
return { version, safeByDefault: isPyYamlVersionSafeByDefault(version) };
|
|
311
|
+
}
|
|
312
|
+
return null;
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* True when `version` (as `M.m[.p]`) is ≥ 6.0. Handles bare `6`,
|
|
316
|
+
* `6.0`, `6.0.1`, `7`, `10.0`, etc. Returns false on malformed input
|
|
317
|
+
* (defensive — the gate defaults to *do not drop* on missing signal).
|
|
318
|
+
*/
|
|
319
|
+
export function isPyYamlVersionSafeByDefault(version) {
|
|
320
|
+
const parts = version.split('.').map((s) => Number.parseInt(s, 10));
|
|
321
|
+
if (parts.length === 0 || !Number.isFinite(parts[0]))
|
|
322
|
+
return false;
|
|
323
|
+
return parts[0] >= 6;
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Return true when the file contains an explicit unsafe `Loader=`
|
|
327
|
+
* keyword argument on a `yaml.load(...)` call at or shortly after
|
|
328
|
+
* `sinkLine`. Recognises the well-known unsafe loaders and their
|
|
329
|
+
* qualified forms:
|
|
330
|
+
*
|
|
331
|
+
* Loader=Loader Loader=yaml.Loader
|
|
332
|
+
* Loader=UnsafeLoader Loader=yaml.UnsafeLoader
|
|
333
|
+
* Loader=FullLoader Loader=yaml.FullLoader (technically safer
|
|
334
|
+
* than Loader; still
|
|
335
|
+
* permits arbitrary
|
|
336
|
+
* Python object types)
|
|
337
|
+
*
|
|
338
|
+
* SafeLoader / CSafeLoader / BaseLoader / CBaseLoader are all safe and
|
|
339
|
+
* are NOT matched here.
|
|
340
|
+
*
|
|
341
|
+
* Scans `sinkLine` through the next 9 lines to catch multi-line call
|
|
342
|
+
* shapes; if the closing `)` appears before the window ends the scan
|
|
343
|
+
* stops there. Regex-based (no AST inspection) to stay consistent with
|
|
344
|
+
* the sink-filter-pass conventions and avoid pulling parse state into
|
|
345
|
+
* the gate.
|
|
346
|
+
*/
|
|
347
|
+
export function fileHasUnsafePyYamlLoader(sourceLines, sinkLine) {
|
|
348
|
+
const start = Math.max(0, sinkLine - 1);
|
|
349
|
+
const end = Math.min(sourceLines.length, start + 10);
|
|
350
|
+
const unsafeRe = /\bLoader\s*=\s*(?:yaml\s*\.\s*)?(?:Loader|UnsafeLoader|FullLoader)\b/;
|
|
351
|
+
for (let i = start; i < end; i++) {
|
|
352
|
+
const ln = sourceLines[i] ?? '';
|
|
353
|
+
if (unsafeRe.test(ln))
|
|
354
|
+
return true;
|
|
355
|
+
// Stop once the call closes — the `)` at the top-level. Fine
|
|
356
|
+
// approximation: any bare `)` at the START of a stripped line, or
|
|
357
|
+
// trailing `)` at end of a stripped line, signals close.
|
|
358
|
+
const stripped = ln.trim();
|
|
359
|
+
if (i > start && (stripped === ')' || stripped.endsWith(')'))) {
|
|
360
|
+
// Also test the current line before we stop, in case Loader= is
|
|
361
|
+
// on the same line as the closing paren.
|
|
362
|
+
return false;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
return false;
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* Extract the declared version + feature list for a named crate from a
|
|
369
|
+
* `Cargo.toml`. Recognises the standard `[dependencies]` (and
|
|
370
|
+
* `[dev-dependencies]` / `[build-dependencies]`) shapes:
|
|
371
|
+
*
|
|
372
|
+
* pkg = "1.2.3" — bare string
|
|
373
|
+
* pkg = { version = "1.2.3" } — table with version
|
|
374
|
+
* pkg = { version = "1.2.3", features = ["a", "b"] }
|
|
375
|
+
* pkg = { git = "…" } — git source (no version)
|
|
376
|
+
* pkg = { path = "…" } — path source (no version)
|
|
377
|
+
*
|
|
378
|
+
* Cross-table dependency declarations (`[dependencies.pkg]`) are not
|
|
379
|
+
* yet recognised; those are less common and can be added when needed.
|
|
380
|
+
* Regex-based rather than a full TOML parser to keep the runtime-dep
|
|
381
|
+
* list minimal (Pillar I).
|
|
382
|
+
*/
|
|
383
|
+
export function resolveDepFromCargoToml(cargoToml, crateName) {
|
|
384
|
+
if (!cargoToml || !crateName)
|
|
385
|
+
return null;
|
|
386
|
+
const nameEsc = crateName.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
387
|
+
// Shape 1: bare string — `pkg = "1.2.3"`.
|
|
388
|
+
const bareRe = new RegExp(`^\\s*${nameEsc}\\s*=\\s*"([\\d.]+[^"\\s]*)"`, 'm');
|
|
389
|
+
const bare = cargoToml.match(bareRe);
|
|
390
|
+
if (bare) {
|
|
391
|
+
return { version: bare[1], features: [] };
|
|
392
|
+
}
|
|
393
|
+
// Shape 2: inline table — `pkg = { version = "1.2.3", features = [...] }`.
|
|
394
|
+
// Match the table body then extract version + optional features.
|
|
395
|
+
const tableRe = new RegExp(`^\\s*${nameEsc}\\s*=\\s*\\{([^}]*)\\}`, 'm');
|
|
396
|
+
const table = cargoToml.match(tableRe);
|
|
397
|
+
if (!table)
|
|
398
|
+
return null;
|
|
399
|
+
const body = table[1];
|
|
400
|
+
const versionM = body.match(/\bversion\s*=\s*"([\d.]+[^"\s]*)"/);
|
|
401
|
+
if (!versionM)
|
|
402
|
+
return null;
|
|
403
|
+
const version = versionM[1];
|
|
404
|
+
const featuresM = body.match(/\bfeatures\s*=\s*\[([^\]]*)\]/);
|
|
405
|
+
const features = [];
|
|
406
|
+
if (featuresM) {
|
|
407
|
+
const featureStr = featuresM[1];
|
|
408
|
+
const re = /"([^"]+)"/g;
|
|
409
|
+
let m;
|
|
410
|
+
while ((m = re.exec(featureStr)) !== null) {
|
|
411
|
+
features.push(m[1]);
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
return { version, features };
|
|
415
|
+
}
|
|
68
416
|
/**
|
|
69
417
|
* Return true when the given source text contains an in-file call that
|
|
70
418
|
* re-enables Fastjson autotype. Even a `_noneautotype` build does not
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependency-versions.js","sourceRoot":"","sources":["../../src/analysis/dependency-versions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;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IAAI,CAAC,MAAM,CAAC,CAAC;AAC3D,CAAC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,8BAA8B,CAAC,MAAc;IAC3D,IAAI,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IAC1B,IAAI,4BAA4B,CAAC,IAAI,CAAC,MAAM,CAAC;QAAE,OAAO,IAAI,CAAC;IAC3D,IAAI,8BAA8B,CAAC,IAAI,CAAC,MAAM,CAAC;QAAE,OAAO,IAAI,CAAC;IAC7D,6EAA6E;IAC7E,oEAAoE;IACpE,6DAA6D;IAC7D,2DAA2D;IAC3D,IAAI,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC;QAAE,OAAO,IAAI,CAAC;IAChD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,6BAA6B,CAAC,MAAc;IAC1D,IAAI,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IAC1B,IAAI,8BAA8B,CAAC,IAAI,CAAC,MAAM,CAAC;QAAE,OAAO,IAAI,CAAC;IAC7D,gFAAgF;IAChF,4DAA4D;IAC5D,IAAI,6BAA6B,CAAC,IAAI,CAAC,MAAM,CAAC;QAAE,OAAO,IAAI,CAAC;IAC5D,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -47,6 +47,8 @@ export interface DeserializationSafetyGateResult {
|
|
|
47
47
|
droppedJackson: number;
|
|
48
48
|
/** Sinks dropped by Gate C (SnakeYAML SafeConstructor). */
|
|
49
49
|
droppedSnakeYaml: number;
|
|
50
|
+
/** Sinks dropped by Gate D (Python PyYAML ≥ 6.0 default-safe). */
|
|
51
|
+
droppedPyYaml: number;
|
|
50
52
|
}
|
|
51
53
|
export declare class DeserializationSafetyGatePass implements AnalysisPass<DeserializationSafetyGateResult> {
|
|
52
54
|
private readonly dependencyContext?;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deserialization-safety-gate-pass.d.ts","sourceRoot":"","sources":["../../../src/analysis/passes/deserialization-safety-gate-pass.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAG9E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"deserialization-safety-gate-pass.d.ts","sourceRoot":"","sources":["../../../src/analysis/passes/deserialization-safety-gate-pass.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAG9E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAa3D,MAAM,WAAW,+BAA+B;IAC9C,uDAAuD;IACvD,eAAe,EAAE,MAAM,CAAC;IACxB,kEAAkE;IAClE,cAAc,EAAE,MAAM,CAAC;IACvB,2DAA2D;IAC3D,gBAAgB,EAAE,MAAM,CAAC;IACzB,kEAAkE;IAClE,aAAa,EAAE,MAAM,CAAC;CACvB;AAeD,qBAAa,6BACX,YAAW,YAAY,CAAC,+BAA+B,CAAC;IAK5C,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAC;IAH/C,QAAQ,CAAC,IAAI,iCAAiC;IAC9C,QAAQ,CAAC,QAAQ,EAAG,UAAU,CAAU;gBAEX,iBAAiB,CAAC,EAAE,iBAAiB,YAAA;IAElE,GAAG,CAAC,GAAG,EAAE,WAAW,GAAG,+BAA+B;CAqIvD"}
|