@js-recon/js-recon 2.1.0-alpha.3 → 2.1.0-alpha.4
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/.claude-sync/watch.sh +2 -2
- package/.github/workflows/build-and-prettify.yaml +3 -0
- package/.github/workflows/promote-js-recon.yml +7 -1
- package/.idea/runConfigurations/claude_sync__sync.xml +17 -0
- package/.idea/runConfigurations/claude_sync__watch.xml +17 -0
- package/.idea/startup.xml +9 -0
- package/CHANGELOG.md +28 -0
- package/CONTRIBUTING.md +8 -0
- package/Dockerfile.w-rules +2 -1
- package/build/analyze/engine/taintwireEngine.js +97 -34
- package/build/analyze/engine/taintwireEngine.js.map +1 -1
- package/build/analyze/helpers/initRules.js +37 -28
- package/build/analyze/helpers/initRules.js.map +1 -1
- package/build/analyze/helpers/outputHelper.js.map +1 -1
- package/build/analyze/index.js +3 -1
- package/build/analyze/index.js.map +1 -1
- package/build/cliProgram.js +14 -8
- package/build/cliProgram.js.map +1 -1
- package/build/config/applicationConfig.js +6 -0
- package/build/config/applicationConfig.js.map +1 -1
- package/build/exploit/utility/rawRequest.js +1 -1
- package/build/exploit/utility/rawRequest.js.map +1 -1
- package/build/globalConfig.js +1 -1
- package/build/lazyLoad/generic/generic_getScriptTags.js +74 -14
- package/build/lazyLoad/generic/generic_getScriptTags.js.map +1 -1
- package/build/lazyLoad/index.js +11 -1
- package/build/lazyLoad/index.js.map +1 -1
- package/build/lazyLoad/methodFilter.js +2 -1
- package/build/lazyLoad/methodFilter.js.map +1 -1
- package/build/lazyLoad/next_js/NextJsCrawler.js +9 -19
- package/build/lazyLoad/next_js/NextJsCrawler.js.map +1 -1
- package/build/lazyLoad/next_js/next_rsf/index.js +143 -0
- package/build/lazyLoad/next_js/next_rsf/index.js.map +1 -0
- package/build/lazyLoad/next_js/{next_interceptRouteNextUrl.js → next_rsf/next_interceptRouteNextUrl.js} +4 -4
- package/build/lazyLoad/next_js/next_rsf/next_interceptRouteNextUrl.js.map +1 -0
- package/build/lazyLoad/next_js/next_rsf/next_rsfAncestorClaim.js +16 -0
- package/build/lazyLoad/next_js/next_rsf/next_rsfAncestorClaim.js.map +1 -0
- package/build/lazyLoad/next_js/next_rsf/next_rsfParamBruteforce.js +112 -0
- package/build/lazyLoad/next_js/next_rsf/next_rsfParamBruteforce.js.map +1 -0
- package/build/lazyLoad/next_js/next_rsf/rsfShared.js +149 -0
- package/build/lazyLoad/next_js/next_rsf/rsfShared.js.map +1 -0
- package/build/lazyLoad/techDetect/index.js +6 -2
- package/build/lazyLoad/techDetect/index.js.map +1 -1
- package/build/lazyLoad/techDetect/isGlobalBuildOnly.js +39 -0
- package/build/lazyLoad/techDetect/isGlobalBuildOnly.js.map +1 -0
- package/build/map/taintwire/apiCalls.js +70 -60
- package/build/map/taintwire/apiCalls.js.map +1 -1
- package/build/map/taintwire/next_js/index.js +80 -15
- package/build/map/taintwire/next_js/index.js.map +1 -1
- package/build/map/taintwire/valueResolver.js +304 -6
- package/build/map/taintwire/valueResolver.js.map +1 -1
- package/build/run/index.js +4 -16
- package/build/run/index.js.map +1 -1
- package/build/taintwire/index.js +146 -18
- package/build/taintwire/index.js.map +1 -1
- package/build/utility/globals.js +8 -0
- package/build/utility/globals.js.map +1 -1
- package/config.dist.yaml +1 -1
- package/npm-shrinkwrap.json +9 -9
- package/package.json +4 -3
- package/.vscode/tasks.json +0 -42
- package/build/lazyLoad/next_js/next_interceptRouteNextUrl.js.map +0 -1
- package/build/lazyLoad/next_js/next_routerStateForge.js +0 -405
- package/build/lazyLoad/next_js/next_routerStateForge.js.map +0 -1
package/.claude-sync/watch.sh
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
# Background watcher intended to be run as a
|
|
3
|
-
#
|
|
2
|
+
# Background watcher intended to be run as a WebStorm startup task (.idea/startup.xml).
|
|
3
|
+
# Polls for new real CLAUDE.md files every few seconds and
|
|
4
4
|
# captures them immediately via capture-scan.sh, so a file created interactively
|
|
5
5
|
# (e.g. by an editor or an agent session) gets redirected without waiting for the
|
|
6
6
|
# next branch switch or commit.
|
|
@@ -211,6 +211,9 @@ jobs:
|
|
|
211
211
|
fi
|
|
212
212
|
git clone --depth 1 --branch "$BRANCH" https://github.com/js-recon/js-recon-rules.git js-recon-rules
|
|
213
213
|
|
|
214
|
+
- name: Checkout taintwire-queries
|
|
215
|
+
run: git clone --depth 1 https://github.com/js-recon/taintwire-queries.git taintwire-queries
|
|
216
|
+
|
|
214
217
|
- name: Set up Node.js
|
|
215
218
|
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
|
216
219
|
with:
|
|
@@ -97,6 +97,12 @@ jobs:
|
|
|
97
97
|
# Dockerfile.w-rules builds from this context and would otherwise bake
|
|
98
98
|
# the writable GHCR credential into an image layer.
|
|
99
99
|
persist-credentials: false
|
|
100
|
+
- name: Checkout taintwire-queries
|
|
101
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
102
|
+
with:
|
|
103
|
+
repository: js-recon/taintwire-queries
|
|
104
|
+
path: taintwire-queries
|
|
105
|
+
persist-credentials: false
|
|
100
106
|
- uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
|
|
101
107
|
with:
|
|
102
108
|
registry: ghcr.io
|
|
@@ -124,7 +130,7 @@ jobs:
|
|
|
124
130
|
|
|
125
131
|
- name: Build and push the rules-bundled (-w-rules) variant
|
|
126
132
|
run: |
|
|
127
|
-
# layer js-recon-rules on top of the image just built/pushed above
|
|
133
|
+
# layer js-recon-rules and taintwire-queries on top of the image just built/pushed above
|
|
128
134
|
docker build -f Dockerfile.w-rules --build-arg BASE_IMAGE=ghcr.io/js-recon/js-recon:$VERSION -t ghcr.io/js-recon/js-recon:$VERSION-w-rules .
|
|
129
135
|
|
|
130
136
|
TAG="latest"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<component name="ProjectRunConfigurationManager">
|
|
2
|
+
<configuration default="false" name="claude-sync: sync CLAUDE.md files" type="ShConfigurationType">
|
|
3
|
+
<option name="SCRIPT_TEXT" value="" />
|
|
4
|
+
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
|
|
5
|
+
<option name="SCRIPT_PATH" value="$PROJECT_DIR$/.claude-sync/sync.sh" />
|
|
6
|
+
<option name="SCRIPT_OPTIONS" value="" />
|
|
7
|
+
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
|
|
8
|
+
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
|
9
|
+
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
|
|
10
|
+
<option name="INTERPRETER_PATH" value="/bin/bash" />
|
|
11
|
+
<option name="INTERPRETER_OPTIONS" value="" />
|
|
12
|
+
<option name="EXECUTE_IN_TERMINAL" value="false" />
|
|
13
|
+
<option name="EXECUTE_SCRIPT_FILE" value="true" />
|
|
14
|
+
<envs />
|
|
15
|
+
<method v="2" />
|
|
16
|
+
</configuration>
|
|
17
|
+
</component>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<component name="ProjectRunConfigurationManager">
|
|
2
|
+
<configuration default="false" name="claude-sync: watch for new CLAUDE.md files" type="ShConfigurationType">
|
|
3
|
+
<option name="SCRIPT_TEXT" value="" />
|
|
4
|
+
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
|
|
5
|
+
<option name="SCRIPT_PATH" value="$PROJECT_DIR$/.claude-sync/watch.sh" />
|
|
6
|
+
<option name="SCRIPT_OPTIONS" value="" />
|
|
7
|
+
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
|
|
8
|
+
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
|
9
|
+
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
|
|
10
|
+
<option name="INTERPRETER_PATH" value="/bin/bash" />
|
|
11
|
+
<option name="INTERPRETER_OPTIONS" value="" />
|
|
12
|
+
<option name="EXECUTE_IN_TERMINAL" value="false" />
|
|
13
|
+
<option name="EXECUTE_SCRIPT_FILE" value="true" />
|
|
14
|
+
<envs />
|
|
15
|
+
<method v="2" />
|
|
16
|
+
</configuration>
|
|
17
|
+
</component>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ProjectStartupSharedConfiguration">
|
|
4
|
+
<configurations>
|
|
5
|
+
<configuration id="ShConfigurationType.claude-sync: sync CLAUDE.md files" name="claude-sync: sync CLAUDE.md files" />
|
|
6
|
+
<configuration id="ShConfigurationType.claude-sync: watch for new CLAUDE.md files" name="claude-sync: watch for new CLAUDE.md files" />
|
|
7
|
+
</configurations>
|
|
8
|
+
</component>
|
|
9
|
+
</project>
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 2.1.0-alpha.4 - 2026-11-23
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- `taintwire analyze` uses the taintwire-queries pack when `-q` is not given. It is downloaded to `~/.js-recon/taintwire-queries` and checked against the latest GitHub release, like the rules pack (`--disable-rules-version-check` skips the check). The `-w-rules` Docker images ship it. (`taintwire`)
|
|
8
|
+
- `taintwire analyze` prints the conditions a value passes before it reaches the sink (from the pack's interceptors) under each finding, and keeps them in the output. It always writes `--output-json` (default `taintwire.json`, the `analyze.json` finding shape), and writes SARIF 2.1.0 with `--output-sarif <file>`, where the conditions are related locations, branch steps of the code flow and properties. `-o` is removed. (`taintwire`)
|
|
9
|
+
- `taintwire build` and `taintwire analyze` show progress bars. (`taintwire`)
|
|
10
|
+
- `--map-taintwire` loads every file into one linked graph (no prefilter), so calls are resolved across webpack, Turbopack and ES-module chunks and classic scripts. For Next.js it loads the chunk files and maps results back to modules. Its value resolver follows destructuring, object and array literals, and React hooks (`useState` with its setter and `slicedToArray`, `useRef`, `useMemo`, `useReducer`, `useContext`). (`map`, `run`)
|
|
11
|
+
- The generic lazyload saves the JavaScript in event-handler attributes (`on*`) as `<attr>-N.js` and in `javascript:` attribute URLs as `javascript-N.js`, next to the page's inline scripts, with a `File Source` header. Identical bodies on a page are saved once. (`lazyload`, `run`)
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- The refactor step of `run` is now opt-in with `--enable-refactor`, which replaces `--disable-refactor`. A `run.disableRefactor` key left in an existing config file is ignored. (`run`)
|
|
16
|
+
- The Next.js lazyload method `next_routerStateForge` is split into two methods, so each technique can be turned on or off on its own. `next_rsfAncestorClaim` claims the route's parent path segments as ordinary segments (the full parent chain, then only the first segment). `next_rsfParamBruteforce` claims the last parent segment as a dynamic route segment, guessing its parameter name from the wordlist and then from names found in responses already received (`--rsc-param-bruteforce-limit`). With both on, the requests are the same, in the same order, as before. `next_routerStateForge` is no longer a valid name for `--include-methods` or `--exclude-methods`. The research-output keys `next_routerStateForge`, `next_routerStateForge_metadataOnly` and `next_routerStateForge_legacyKeyAccepted` are replaced by `next_rsfAncestorClaim`, `next_rsfParamBruteforce` (each with a `_metadataOnly` variant) and `next_rsf_legacyKeyAccepted`. (`lazyload`, `run`)
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- `--analyze-taintwire` runs the rules on one linked graph of every chunk, with the prefilter applied per linked unit, so flows across classic scripts and chunks are found. (`analyze`, `run`)
|
|
21
|
+
- `--analyze-taintwire` skips known vendor library builds (by `File Source` name or banner) unless `--taintwire-include-vendor` is set. Unminified UMD React, ReactDOM or AngularJS builds on sites without a bundler made it run for over 15 minutes with no output. It now prints progress per graph and rule, and rewrites `analyze.json` after every rule so an interrupted run keeps its findings. (`analyze`, `run`)
|
|
22
|
+
- `--map-taintwire` only takes a config call whose method or type is an HTTP verb, rejects client-call URLs that contain whitespace or markup, only treats `{url}` objects with request keys as config calls, and caches resolver lookups (each point query on a whole-app graph cost 5-20 ms). (`map`, `run`)
|
|
23
|
+
- A site that loads React or Vue as a global script build with no bundler is now crawled with the generic lazyload. (`lazyload`, `run`)
|
|
24
|
+
- Pages that differ only by query string (`/post?id=1`, `/post?id=2`) share an output directory, and each one's inline and attribute scripts overwrote the previous page's. A taken file name is now skipped if the body is the same, and otherwise the next free number is used. (`lazyload`, `run`)
|
|
25
|
+
- taintwire is updated to 0.2.0-alpha.6. Classic scripts are linked through their shared global scope, ES-module chunks (Vite, Rollup, esbuild) through their imports and exports, a sink can list the conditions before it, and a sloppy-mode global assigned without a declaration (`x = v`, common in inline event handlers) now carries its value to later reads of `x`. (`analyze`, `map`, `run`, `taintwire`)
|
|
26
|
+
|
|
27
|
+
### Security
|
|
28
|
+
|
|
29
|
+
- `hono` is overridden to 4.13.19 (GHSA-4m76-xfj5-7975 and others), a dependency of `@modelcontextprotocol/sdk`. (`mcp`)
|
|
30
|
+
|
|
3
31
|
## 2.1.0-alpha.3 - 2026-11-09
|
|
4
32
|
|
|
5
33
|
### Added
|
package/CONTRIBUTING.md
CHANGED
|
@@ -30,3 +30,11 @@ before pushing.
|
|
|
30
30
|
Do not open a public issue for a security vulnerability — see [`SECURITY.md`](SECURITY.md) for the
|
|
31
31
|
reporting process and response SLAs. Bug reports and feature/tech-support requests use the GitHub
|
|
32
32
|
Issues templates linked from the [contributing page](https://js-recon.io/contributing).
|
|
33
|
+
|
|
34
|
+
## Research
|
|
35
|
+
|
|
36
|
+
JS Recon is backed by research on frameworks. While the raw research data is not released publicly, most of the relevant action items are implemented in the tool itself.
|
|
37
|
+
|
|
38
|
+
If you would like to hear more about JS Recon's research, please Shriyans at [<shriyanss@ss0x00.com>](mailto:shriyanss@ss0x00.com)
|
|
39
|
+
|
|
40
|
+
> I'm open to academic research activities :)
|
package/Dockerfile.w-rules
CHANGED
|
@@ -3,7 +3,8 @@ FROM ${BASE_IMAGE}
|
|
|
3
3
|
|
|
4
4
|
USER root
|
|
5
5
|
COPY js-recon-rules/ /home/pptruser/.js-recon/rules/
|
|
6
|
-
|
|
6
|
+
COPY taintwire-queries/ /home/pptruser/.js-recon/taintwire-queries/
|
|
7
|
+
RUN rm -rf /home/pptruser/.js-recon/rules/.github /home/pptruser/.js-recon/taintwire-queries/.github && \
|
|
7
8
|
if [ -d /home/pptruser/.js-recon/rules/skills ]; then \
|
|
8
9
|
mv /home/pptruser/.js-recon/rules/skills /home/pptruser/.js-recon/skills; \
|
|
9
10
|
fi && \
|
|
@@ -7,23 +7,62 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import {
|
|
10
|
+
import { withLinkedUnits } from "../../map/taintwire/apiCalls.js";
|
|
11
11
|
import { printMsg, MSG } from "../../utility/printMsg.js";
|
|
12
|
+
import { getTaintwireIncludeVendor } from "../../utility/globals.js";
|
|
12
13
|
// Characters of the sink expression kept in findingLocation.
|
|
13
14
|
const MAX_CODE = 300;
|
|
14
15
|
const SEVERITY_MSG = { info: MSG.Header, low: MSG.Warn, medium: MSG.Info, high: MSG.Err, critical: MSG.Err };
|
|
16
|
+
// shortcut: a fixed list of popular unbundled library builds; add a name/banner when another one shows up slow in a scan.
|
|
17
|
+
const VENDOR_FILE =
|
|
18
|
+
// eslint-disable-next-line security/detect-unsafe-regex -- anchored, bounded optional groups
|
|
19
|
+
/(?:^|\/)(?:react|react-dom|angular(?:[._-]\d+(?:[._-]\d+)*)?|jquery(?:-\d+(?:\.\d+)*)?|vue|lodash|moment)(?:\.(?:development|production|prod|global|runtime))*(?:\.min)?\.js$/i;
|
|
20
|
+
const VENDOR_BANNER = /@license React|AngularJS v\d|jQuery (?:JavaScript Library )?v\d|Vue\.js v\d|@license Lodash|\/\/! moment\.js/;
|
|
21
|
+
/**
|
|
22
|
+
* True for a chunk that is a known vendor library build (React/ReactDOM/AngularJS/jQuery/Vue/lodash/moment),
|
|
23
|
+
* by the file name on its `// File Source:` line or a banner in its first 2 KB. Such files are large, unminified
|
|
24
|
+
* on sites without a bundler, and hold no app code, so taintwire skips them unless --taintwire-include-vendor.
|
|
25
|
+
*/
|
|
26
|
+
export const isVendorChunk = (code) => {
|
|
27
|
+
var _a;
|
|
28
|
+
// TODO in addition to simple regex, have CS-MAST signatures for the vendor libraries
|
|
29
|
+
const head = code.slice(0, 2048);
|
|
30
|
+
const src = (_a = /^\/\/ File Source: (\S+)/.exec(head)) === null || _a === void 0 ? void 0 : _a[1];
|
|
31
|
+
let file = src !== null && src !== void 0 ? src : "";
|
|
32
|
+
try {
|
|
33
|
+
if (src)
|
|
34
|
+
file = new URL(src).pathname;
|
|
35
|
+
}
|
|
36
|
+
catch (_b) {
|
|
37
|
+
// not a URL: match the raw value
|
|
38
|
+
}
|
|
39
|
+
return VENDOR_FILE.test(file) || VENDOR_BANNER.test(head);
|
|
40
|
+
};
|
|
15
41
|
/**
|
|
16
42
|
* Print a runPgq finding and turn it into an EngineOutput: the rule's own message (its diagnostic), and the location
|
|
17
43
|
* plus up to 300 characters of the sink's code. The console line names the rule and the chunk.
|
|
18
44
|
*/
|
|
19
45
|
export const toEngineOutput = (graph, f, meta) => __awaiter(void 0, void 0, void 0, function* () {
|
|
46
|
+
var _a;
|
|
20
47
|
const at = (x) => `${x.file}:${x.line}:${x.col}`;
|
|
21
48
|
const message = `[+] "${meta.ruleName}" found in chunk ${f.file}`;
|
|
22
49
|
const code = (yield graph.code(f.id)).slice(0, MAX_CODE);
|
|
23
50
|
const via = f.source ? ` <- ${at(f.source)} (${f.hops} hops)` : "";
|
|
24
51
|
printMsg(SEVERITY_MSG[f.severity], message);
|
|
25
52
|
printMsg(MSG.Plain, `${at(f)}${via}\n${code}`);
|
|
26
|
-
|
|
53
|
+
const interceptors = [];
|
|
54
|
+
for (const i of (_a = f.interceptors) !== null && _a !== void 0 ? _a : []) {
|
|
55
|
+
const src = (yield graph.code(i.id)).replace(/\s+/g, " ").slice(0, MAX_CODE);
|
|
56
|
+
interceptors.push({ kind: i.kind, text: i.text, location: at(i), code: src });
|
|
57
|
+
}
|
|
58
|
+
if (interceptors.length) {
|
|
59
|
+
// guards (if/ternary/and-or/early-exit) carry the polarity; the checks below them describe their parts
|
|
60
|
+
const lines = interceptors.map((i) => i.kind === "check"
|
|
61
|
+
? ` ${i.location} ${i.text}: ${i.code}`
|
|
62
|
+
: ` ${i.location} ${i.kind}, ${i.text}: ${i.code}`);
|
|
63
|
+
printMsg(MSG.Info, `[i] Conditions before the sink:\n${lines.join("\n")}`);
|
|
64
|
+
}
|
|
65
|
+
return Object.assign(Object.assign(Object.assign({ ruleId: f.ruleId }, meta), { severity: f.severity, message: f.message, findingLocation: `// ${at(f)}${via}\n\n${code}` }), (interceptors.length ? { interceptors } : {}));
|
|
27
66
|
});
|
|
28
67
|
/**
|
|
29
68
|
* A YAML taintwire rule as a pgq rule. Steps run in order: each step's row ids are a Cypher parameter
|
|
@@ -64,46 +103,70 @@ export const toPgRule = (rule) => {
|
|
|
64
103
|
return: last && !broken ? [last] : [],
|
|
65
104
|
};
|
|
66
105
|
};
|
|
67
|
-
/**
|
|
68
|
-
|
|
106
|
+
/**
|
|
107
|
+
* Runs YAML taintwire `rules` on one graph through taintwire's pgq runner, one rule at a time so each prints its
|
|
108
|
+
* progress and `onRule` can save findings as they come (selectors aren't shared across YAML rules, so nothing is lost).
|
|
109
|
+
*/
|
|
110
|
+
export const runTaintwireRules = (graph, rules, onRule) => __awaiter(void 0, void 0, void 0, function* () {
|
|
69
111
|
const { runPgq } = yield import("@js-recon/taintwire");
|
|
70
|
-
const byId = new Map(rules.map((r) => [r.id, r]));
|
|
71
|
-
const { findings, errors } = yield runPgq(graph, rules.map(toPgRule));
|
|
72
|
-
for (const e of errors)
|
|
73
|
-
printMsg(MSG.Err, `[!] taintwire rule ${e.ruleId} failed: ${e.message}`);
|
|
74
112
|
const out = [];
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
113
|
+
const failedRules = [];
|
|
114
|
+
for (const [i, r] of rules.entries()) {
|
|
115
|
+
const start = Date.now();
|
|
116
|
+
const { findings, errors } = yield runPgq(graph, [toPgRule(r)]);
|
|
117
|
+
for (const e of errors)
|
|
118
|
+
printMsg(MSG.Err, `[!] taintwire rule ${e.ruleId} failed: ${e.message}`);
|
|
119
|
+
const run = { findings: [], failedRules: errors.map((e) => e.ruleId) };
|
|
120
|
+
for (const f of findings) {
|
|
121
|
+
run.findings.push(yield toEngineOutput(graph, f, {
|
|
122
|
+
ruleName: r.name,
|
|
123
|
+
ruleType: r.type,
|
|
124
|
+
ruleDescription: r.description,
|
|
125
|
+
ruleAuthor: r.author,
|
|
126
|
+
ruleTech: r.tech,
|
|
127
|
+
}));
|
|
128
|
+
}
|
|
129
|
+
printMsg(MSG.Plain, `[i] rule ${i + 1}/${rules.length} ${r.id}: ${run.findings.length} finding(s) in ${((Date.now() - start) / 1000).toFixed(1)}s`);
|
|
130
|
+
for (const f of run.findings)
|
|
131
|
+
out.push(f);
|
|
132
|
+
for (const id of run.failedRules)
|
|
133
|
+
failedRules.push(id);
|
|
134
|
+
onRule === null || onRule === void 0 ? void 0 : onRule(run);
|
|
84
135
|
}
|
|
85
|
-
return { findings: out, failedRules
|
|
136
|
+
return { findings: out, failedRules };
|
|
86
137
|
});
|
|
87
138
|
/**
|
|
88
|
-
* Loads the chunks of `mapped.json` into taintwire
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
139
|
+
* Loads the chunks of `mapped.json` into ONE linked taintwire graph (on disk) and runs the rules on it, so a flow
|
|
140
|
+
* can cross chunks: bundler module registries, ES imports, and the global scope classic scripts share. The prefilter
|
|
141
|
+
* applies to that linked unit: a rule runs if its prefilter matches any chunk (or it has none), and every chunk is
|
|
142
|
+
* loaded, since the sink can sit in a chunk with no source. Known vendor library chunks are skipped unless
|
|
143
|
+
* --taintwire-include-vendor. A rule that fails is listed in `failedRules`. `onProgress` gets the findings so far
|
|
144
|
+
* after each rule, so a caller can save partial results.
|
|
92
145
|
*/
|
|
93
|
-
const taintwireEngine = (rules, chunks) => __awaiter(void 0, void 0, void 0, function* () {
|
|
94
|
-
const
|
|
95
|
-
const
|
|
96
|
-
.filter((c) => c.code
|
|
97
|
-
.
|
|
98
|
-
|
|
146
|
+
const taintwireEngine = (rules, chunks, onProgress) => __awaiter(void 0, void 0, void 0, function* () {
|
|
147
|
+
const vendor = [];
|
|
148
|
+
const loaded = Object.values(chunks)
|
|
149
|
+
.filter((c) => c.code)
|
|
150
|
+
.filter((c) => getTaintwireIncludeVendor() || !isVendorChunk(c.code) || (vendor.push(c.id), false));
|
|
151
|
+
if (vendor.length > 0)
|
|
152
|
+
printMsg(MSG.Info, `[i] Skipped ${vendor.length} vendor chunk(s) for taintwire (${vendor.join(", ")}); pass --taintwire-include-vendor to scan them`);
|
|
153
|
+
const active = rules.filter((r) => !r.prefilter || loaded.some((c) => new RegExp(r.prefilter).test(c.code)));
|
|
154
|
+
printMsg(MSG.Header, `[i] Running ${active.length} of ${rules.length} taintwire rule(s) on one linked graph of ${loaded.length} of ${Object.keys(chunks).length} chunk(s)`);
|
|
99
155
|
const findings = [];
|
|
100
156
|
const failed = new Set();
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
157
|
+
if (active.length === 0)
|
|
158
|
+
return { findings, failedRules: [] };
|
|
159
|
+
const units = loaded.map((c) => ({ name: c.id, size: c.code.length, code: () => c.code }));
|
|
160
|
+
const start = Date.now();
|
|
161
|
+
yield withLinkedUnits(units, (graph) => __awaiter(void 0, void 0, void 0, function* () {
|
|
162
|
+
printMsg(MSG.Plain, `[i] loaded in ${((Date.now() - start) / 1000).toFixed(1)}s`);
|
|
163
|
+
yield runTaintwireRules(graph, active, (run) => {
|
|
164
|
+
for (const f of run.findings)
|
|
165
|
+
findings.push(f);
|
|
166
|
+
for (const id of run.failedRules)
|
|
167
|
+
failed.add(id);
|
|
168
|
+
onProgress === null || onProgress === void 0 ? void 0 : onProgress(findings);
|
|
169
|
+
});
|
|
107
170
|
}));
|
|
108
171
|
return { findings, failedRules: [...failed] };
|
|
109
172
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taintwireEngine.js","sourceRoot":"","sources":["../../../src/analyze/engine/taintwireEngine.ts"],"names":[],"mappings":";;;;;;;;;AAIA,OAAO,EAAa,
|
|
1
|
+
{"version":3,"file":"taintwireEngine.js","sourceRoot":"","sources":["../../../src/analyze/engine/taintwireEngine.ts"],"names":[],"mappings":";;;;;;;;;AAIA,OAAO,EAAa,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAErE,6DAA6D;AAC7D,MAAM,QAAQ,GAAG,GAAG,CAAC;AAErB,MAAM,YAAY,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,GAAG,EAAE,QAAQ,EAAE,GAAG,CAAC,GAAG,EAAW,CAAC;AAEtH,0HAA0H;AAC1H,MAAM,WAAW;AACb,6FAA6F;AAC7F,gLAAgL,CAAC;AACrL,MAAM,aAAa,GACf,8GAA8G,CAAC;AAEnH;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,IAAY,EAAW,EAAE;;IACnD,qFAAqF;IACrF,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;IACjC,MAAM,GAAG,GAAG,MAAA,0BAA0B,C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AgB,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IACxG,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACzB,MAAM,eAAe,CAAC,KAAK,EAAE,CAAO,KAAK,EAAE,EAAE;QACzC,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,mBAAmB,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACpF,MAAM,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE;YAC3C,KAAK,MAAM,CAAC,IAAI,GAAG,CAAC,QAAQ;gBAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAC/C,KAAK,MAAM,EAAE,IAAI,GAAG,CAAC,WAAW;gBAAE,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YACjD,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAG,QAAQ,CAAC,CAAC;QAC3B,CAAC,CAAC,CAAC;IACP,CAAC,CAAA,CAAC,CAAC;IACH,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC,GAAG,MAAM,CAAC,EAAE,CAAC;AAClD,CAAC,CAAA,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -12,8 +12,11 @@ import path from "path";
|
|
|
12
12
|
import * as tar from "tar";
|
|
13
13
|
import { withActiveProxyDispatcher } from "../../utility/makeReq.js";
|
|
14
14
|
import { printMsg, MSG } from "../../utility/printMsg.js";
|
|
15
|
-
const
|
|
16
|
-
const
|
|
15
|
+
const RULES = { repo: "js-recon-rules", dir: "rules", label: "Rules" };
|
|
16
|
+
const TAINTWIRE_QUERIES = { repo: "taintwire-queries", dir: "taintwire-queries", label: "taintwire queries" };
|
|
17
|
+
const latestReleaseApiUrl = (pack) => `https://api.github.com/repos/js-recon/${pack.repo}/releases/latest`;
|
|
18
|
+
const fetchLatestRulesRelease = (pack, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
19
|
+
const RULES_RELEASE_URL = latestReleaseApiUrl(pack);
|
|
17
20
|
const response = yield fetch(RULES_RELEASE_URL, options);
|
|
18
21
|
if (!response.ok) {
|
|
19
22
|
throw new Error(`Rules release lookup failed with HTTP ${response.status}`);
|
|
@@ -45,33 +48,36 @@ const fetchLatestRulesRelease = (options) => __awaiter(void 0, void 0, void 0, f
|
|
|
45
48
|
* @param homeDir - The user's home directory path
|
|
46
49
|
* @returns Promise that resolves when rules are downloaded and extracted
|
|
47
50
|
*/
|
|
48
|
-
const downloadRules = (homeDir) => __awaiter(void 0, void 0, void 0, function* () {
|
|
49
|
-
printMsg(MSG.Header,
|
|
51
|
+
const downloadRules = (homeDir, pack) => __awaiter(void 0, void 0, void 0, function* () {
|
|
52
|
+
printMsg(MSG.Header, `[i] ${pack.label} not found. Downloading from GitHub...`);
|
|
50
53
|
const buffer = yield withActiveProxyDispatcher((options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
51
|
-
const release = yield fetchLatestRulesRelease(options);
|
|
54
|
+
const release = yield fetchLatestRulesRelease(pack, options);
|
|
52
55
|
const downloadResponse = yield fetch(release.tarballUrl, options);
|
|
53
56
|
if (!downloadResponse.ok) {
|
|
54
|
-
throw new Error(`Failed to download
|
|
57
|
+
throw new Error(`Failed to download ${pack.label}: ${downloadResponse.statusText}`);
|
|
55
58
|
}
|
|
56
59
|
return Buffer.from(yield downloadResponse.arrayBuffer());
|
|
57
60
|
}));
|
|
58
|
-
const tarPath = path.join(homeDir,
|
|
61
|
+
const tarPath = path.join(homeDir, `/.js-recon/${pack.dir}.tar.gz`);
|
|
59
62
|
fs.writeFileSync(tarPath, buffer);
|
|
60
|
-
printMsg(MSG.Header,
|
|
63
|
+
printMsg(MSG.Header, `[i] Extracting ${pack.label}...`);
|
|
61
64
|
const extractPath = path.join(homeDir, "/.js-recon");
|
|
62
65
|
yield tar.x({ file: tarPath, cwd: extractPath });
|
|
63
66
|
// Find the extracted directory
|
|
64
67
|
const files = fs.readdirSync(extractPath);
|
|
65
|
-
const extractedDir = files.find((file) => fs.statSync(path.join(extractPath, file)).isDirectory() && file.startsWith(
|
|
68
|
+
const extractedDir = files.find((file) => fs.statSync(path.join(extractPath, file)).isDirectory() && file.startsWith(`js-recon-${pack.repo}-`));
|
|
66
69
|
if (extractedDir) {
|
|
67
|
-
fs.renameSync(path.join(extractPath, extractedDir), path.join(extractPath,
|
|
70
|
+
fs.renameSync(path.join(extractPath, extractedDir), path.join(extractPath, pack.dir));
|
|
68
71
|
}
|
|
69
72
|
else {
|
|
70
|
-
throw new Error(
|
|
73
|
+
throw new Error(`Could not find extracted ${pack.label} directory.`);
|
|
71
74
|
}
|
|
72
75
|
fs.unlinkSync(tarPath); // Clean up the downloaded tarball
|
|
73
|
-
|
|
74
|
-
|
|
76
|
+
fs.rmSync(path.join(extractPath, pack.dir, ".github"), { recursive: true, force: true });
|
|
77
|
+
if (pack !== RULES) {
|
|
78
|
+
printMsg(MSG.Run, `[✓] ${pack.label} initialized successfully.`);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
75
81
|
// If the release ships a skills/ directory, stage it at ~/.js-recon/skills/.
|
|
76
82
|
const rulesSkillsDir = path.join(homeDir, "/.js-recon/rules/skills");
|
|
77
83
|
const skillsDir = path.join(homeDir, "/.js-recon/skills");
|
|
@@ -109,45 +115,48 @@ export const shouldSkipRulesVersionCheck = (disableFlag, envValue, rulesDirExist
|
|
|
109
115
|
* @param disableVersionCheck - Skip the GitHub version check and use cached rules as-is
|
|
110
116
|
* @returns Promise that resolves when rules initialization is complete
|
|
111
117
|
*/
|
|
112
|
-
const
|
|
113
|
-
printMsg(MSG.Header,
|
|
118
|
+
const initPack = (pack, disableVersionCheck) => __awaiter(void 0, void 0, void 0, function* () {
|
|
119
|
+
printMsg(MSG.Header, `[i] Initializing ${pack.label}...`);
|
|
114
120
|
// get the user's home dir
|
|
115
121
|
const homeDir = process.env.HOME;
|
|
116
122
|
// check if the .js-recon directory exists
|
|
117
123
|
if (!fs.existsSync(path.join(homeDir, "/.js-recon"))) {
|
|
118
124
|
fs.mkdirSync(path.join(homeDir, "/.js-recon"));
|
|
119
125
|
}
|
|
120
|
-
const rulesDir = path.join(homeDir, "/.js-recon
|
|
126
|
+
const rulesDir = path.join(homeDir, "/.js-recon", pack.dir);
|
|
121
127
|
if (shouldSkipRulesVersionCheck(disableVersionCheck, process.env.JS_RECON_DISABLE_RULES_VERSION_CHECK, fs.existsSync(rulesDir))) {
|
|
122
|
-
printMsg(MSG.Header,
|
|
128
|
+
printMsg(MSG.Header, `[i] ${pack.label} version check disabled — using cached ${pack.label} as-is.`);
|
|
123
129
|
return;
|
|
124
130
|
}
|
|
125
131
|
// now, check if the rules directory exists
|
|
126
|
-
if (!fs.existsSync(path.join(homeDir, "/.js-recon
|
|
127
|
-
yield downloadRules(homeDir);
|
|
132
|
+
if (!fs.existsSync(path.join(homeDir, "/.js-recon", pack.dir))) {
|
|
133
|
+
yield downloadRules(homeDir, pack);
|
|
128
134
|
}
|
|
129
135
|
// now that this rule exists, check if the version.txt exists
|
|
130
|
-
const versionPath = path.join(homeDir, "/.js-recon
|
|
136
|
+
const versionPath = path.join(homeDir, "/.js-recon", pack.dir, "version.txt");
|
|
131
137
|
if (!fs.existsSync(versionPath)) {
|
|
132
|
-
printMsg(MSG.Warn,
|
|
138
|
+
printMsg(MSG.Warn, `[!] ${pack.label} directory is corrupted. Downloading again...`);
|
|
133
139
|
// remove the rules directory
|
|
134
|
-
fs.rmSync(path.join(homeDir, "/.js-recon
|
|
135
|
-
yield downloadRules(homeDir);
|
|
140
|
+
fs.rmSync(path.join(homeDir, "/.js-recon", pack.dir), { recursive: true });
|
|
141
|
+
yield downloadRules(homeDir, pack);
|
|
136
142
|
}
|
|
137
143
|
// also, if the version.txt exist, check if the version.txt is latest as per the latest release on github
|
|
138
144
|
const version = fs.readFileSync(versionPath, "utf8").trim();
|
|
139
145
|
try {
|
|
140
|
-
const release = yield withActiveProxyDispatcher(fetchLatestRulesRelease);
|
|
146
|
+
const release = yield withActiveProxyDispatcher((options) => fetchLatestRulesRelease(pack, options));
|
|
141
147
|
if (`v${version}` !== release.tagName) {
|
|
142
|
-
printMsg(MSG.Warn,
|
|
148
|
+
printMsg(MSG.Warn, `[!] ${pack.label} are not up to date. Downloading latest version...`);
|
|
143
149
|
// remove the rules directory
|
|
144
|
-
fs.rmSync(path.join(homeDir, "/.js-recon
|
|
145
|
-
yield downloadRules(homeDir);
|
|
150
|
+
fs.rmSync(path.join(homeDir, "/.js-recon", pack.dir), { recursive: true });
|
|
151
|
+
yield downloadRules(homeDir, pack);
|
|
146
152
|
}
|
|
147
153
|
}
|
|
148
154
|
catch (_a) {
|
|
149
|
-
printMsg(MSG.Err,
|
|
155
|
+
printMsg(MSG.Err, `[!] An error occurred when fetching ${pack.label} from GitHub`);
|
|
150
156
|
}
|
|
151
157
|
});
|
|
158
|
+
const initRules = (disableVersionCheck = false) => initPack(RULES, disableVersionCheck);
|
|
159
|
+
/** Like initRules, for the taintwire-queries pack at `~/.js-recon/taintwire-queries`. */
|
|
160
|
+
export const initTaintwireQueries = (disableVersionCheck = false) => initPack(TAINTWIRE_QUERIES, disableVersionCheck);
|
|
152
161
|
export default initRules;
|
|
153
162
|
//# sourceMappingURL=initRules.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initRules.js","sourceRoot":"","sources":["../../../src/analyze/helpers/initRules.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,O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,CAAC,CAAC;IACvF,CAAC;AACL,CAAC,CAAA,CAAC;AAEF,MAAM,SAAS,GAAG,CAAC,sBAA+B,KAAK,EAAiB,EAAE,CAAC,QAAQ,CAAC,KAAK,EAAE,mBAAmB,CAAC,CAAC;AAEhH,yFAAyF;AACzF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,sBAA+B,KAAK,EAAiB,EAAE,CACxF,QAAQ,CAAC,iBAAiB,EAAE,mBAAmB,CAAC,CAAC;AAErD,eAAe,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outputHelper.js","sourceRoot":"","sources":["../../../src/analyze/helpers/outputHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"outputHelper.js","sourceRoot":"","sources":["../../../src/analyze/helpers/outputHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,2BAA2B,CAAC;AAwB1D;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,UAAkB,EAAE,QAAwB,EAAE,EAAE;IACjF,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,iCAAiC,CAAC,CAAC;IACxD,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAChE,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,2CAA2C,CAAC,CAAC;AACnE,CAAC,CAAC"}
|
package/build/analyze/index.js
CHANGED
|
@@ -144,7 +144,9 @@ const analyze = (rulesPath_1, mappedJson_1, tech_1, list_1, openapi_1, validate_
|
|
|
144
144
|
if (getAnalyzeTaintwire()) {
|
|
145
145
|
// dynamic import: the native graph database loads only when taintwire rules run
|
|
146
146
|
const { default: taintwireEngine } = yield import("./engine/taintwireEngine.js");
|
|
147
|
-
|
|
147
|
+
// rewrite the output after each rule, so a run that is killed or times out keeps what it found
|
|
148
|
+
const others = [...ruleFindings];
|
|
149
|
+
const { findings, failedRules } = yield taintwireEngine(taintwireRules, mappedJsonData, (sofar) => fs.writeFileSync(outputFile, JSON.stringify(others.concat(sofar), null, 2)));
|
|
148
150
|
for (const finding of findings)
|
|
149
151
|
ruleFindings.push(finding);
|
|
150
152
|
failedTaintwireRules = failedRules;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/analyze/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,aAAa,MAAM,uBAAuB,CAAC;AAClD,OAAO,wBAAwB,MAAM,yCAAyC,CAAC;AAE/E,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAgB,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,MAAM,cAAc,GAAG;IACnB,IAAI,EAAE,SAAS;IACf,GAAG,EAAE,QAAQ;IACb,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,cAAc;IACtB,OAAO,EAAE,SAAS;CACrB,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,OAAO,GAAG,4FAWd,EAAE,mIAVA,SAAiB,EACjB,UAAkB,EAClB,IAAqD,EACrD,I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