insa-check-core 0.1.0 → 0.2.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/engine.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/meta.d.ts +1 -1
- package/dist/meta.js +1 -1
- package/dist/server/app.d.ts +30 -0
- package/dist/server/app.d.ts.map +1 -0
- package/dist/server/app.js +216 -0
- package/dist/server/app.js.map +1 -0
- package/package.json +1 -1
package/dist/engine.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AnnexItem, Check, CheckKind, CheckOutcome, CheckResult, Report, ScanContext } from "./types.js";
|
|
2
2
|
import { TOOL_NAME, TOOL_VERSION } from "./meta.js";
|
|
3
3
|
export { TOOL_NAME, TOOL_VERSION };
|
|
4
|
-
export declare const USER_AGENT = "insa-check/0.
|
|
4
|
+
export declare const USER_AGENT = "insa-check/0.2.0 (passive INSA Annex B audit; authorized testing only)";
|
|
5
5
|
export interface ScanOptions {
|
|
6
6
|
/**
|
|
7
7
|
* Caller asserts the operator owns or is authorized to test the target.
|
package/dist/index.d.ts
CHANGED
|
@@ -8,5 +8,6 @@ export { runCodeScan, CodeScanError, type CodeScanOptions } from "./code/scan.js
|
|
|
8
8
|
export { detectProject } from "./code/detect.js";
|
|
9
9
|
export type * from "./code/types.js";
|
|
10
10
|
export { isPrivateAddress, PrivateTargetError } from "./net/guard.js";
|
|
11
|
+
export { createApp, type AppOptions } from "./server/app.js";
|
|
11
12
|
export * from "./report/index.js";
|
|
12
13
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,OAAO,EAA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AE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7D,cAAc,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -7,5 +7,6 @@ export { CODE_CHECKS } from "./code/checks/index.js";
|
|
|
7
7
|
export { runCodeScan, CodeScanError } from "./code/scan.js";
|
|
8
8
|
export { detectProject } from "./code/detect.js";
|
|
9
9
|
export { isPrivateAddress, PrivateTargetError } from "./net/guard.js";
|
|
10
|
+
export { createApp } from "./server/app.js";
|
|
10
11
|
export * from "./report/index.js";
|
|
11
12
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EACL,OAAO,EACP,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,SAAS,EACT,YAAY,EACZ,UAAU,GAGX,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,aAAa,EAAwB,MAAM,gBAAgB,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACtE,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EACL,OAAO,EACP,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,SAAS,EACT,YAAY,EACZ,UAAU,GAGX,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,aAAa,EAAwB,MAAM,gBAAgB,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,SAAS,EAAmB,MAAM,iBAAiB,CAAC;AAC7D,cAAc,mBAAmB,CAAC"}
|
package/dist/meta.d.ts
CHANGED
package/dist/meta.js
CHANGED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { RequestListener } from "node:http";
|
|
2
|
+
import type { Report } from "../types.js";
|
|
3
|
+
export interface AppOptions {
|
|
4
|
+
/** Allow scanning loopback/private/reserved addresses. Off by default (SSRF protection). */
|
|
5
|
+
allowPrivateTargets: boolean;
|
|
6
|
+
/** Max scans running at once; further requests get 503. */
|
|
7
|
+
maxConcurrentScans: number;
|
|
8
|
+
/** Directory of the built web dashboard to serve at /, if any. */
|
|
9
|
+
staticDir?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Host header values this server answers to (e.g. ["127.0.0.1:8787", "localhost:8787"]).
|
|
12
|
+
* Set it for a local dashboard: it stops other websites from driving the local scanner
|
|
13
|
+
* through a DNS name that points at 127.0.0.1 (DNS rebinding).
|
|
14
|
+
*/
|
|
15
|
+
allowedHosts?: string[];
|
|
16
|
+
/** When set, POST /scan requires this key (Authorization: Bearer <key> or X-API-Key). */
|
|
17
|
+
apiKey?: string;
|
|
18
|
+
/** Max scans one client may start per window. Counted in memory only; nothing is written anywhere. */
|
|
19
|
+
rateLimit?: {
|
|
20
|
+
max: number;
|
|
21
|
+
windowMs: number;
|
|
22
|
+
};
|
|
23
|
+
/** Take the client address from X-Forwarded-For (only behind a reverse proxy you control). */
|
|
24
|
+
trustProxy?: boolean;
|
|
25
|
+
/** Injected for tests. */
|
|
26
|
+
scan?: (url: string) => Promise<Report>;
|
|
27
|
+
now?: () => number;
|
|
28
|
+
}
|
|
29
|
+
export declare function createApp(options: AppOptions): RequestListener;
|
|
30
|
+
//# sourceMappingURL=app.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/server/app.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAmB,eAAe,EAAkB,MAAM,WAAW,CAAC;AAIlF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,WAAW,UAAU;IACzB,4FAA4F;IAC5F,mBAAmB,EAAE,OAAO,CAAC;IAC7B,2DAA2D;IAC3D,kBAAkB,EAAE,MAAM,CAAC;IAC3B,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,yFAAyF;IACzF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sGAAsG;IACtG,SAAS,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9C,8FAA8F;IAC9F,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,0BAA0B;IAC1B,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACxC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACpB;AAyCD,wBAAgB,SAAS,CAAC,OAAO,EAAE,UAAU,GAAG,eAAe,CAqE9D"}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { createHash, timingSafeEqual } from "node:crypto";
|
|
2
|
+
import { lookup } from "node:dns/promises";
|
|
3
|
+
import { readFile } from "node:fs/promises";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { normalizeTarget, runScan, TargetError } from "../engine.js";
|
|
6
|
+
import { isPrivateAddress } from "../net/guard.js";
|
|
7
|
+
const MAX_BODY_BYTES = 4096;
|
|
8
|
+
const SECURITY_HEADERS = {
|
|
9
|
+
"x-content-type-options": "nosniff",
|
|
10
|
+
"x-frame-options": "DENY",
|
|
11
|
+
"referrer-policy": "no-referrer",
|
|
12
|
+
"cache-control": "no-store",
|
|
13
|
+
"content-security-policy": "default-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; frame-ancestors 'none'; base-uri 'none'; form-action 'self'",
|
|
14
|
+
};
|
|
15
|
+
const MIME = {
|
|
16
|
+
".html": "text/html; charset=utf-8",
|
|
17
|
+
".js": "text/javascript; charset=utf-8",
|
|
18
|
+
".css": "text/css; charset=utf-8",
|
|
19
|
+
".svg": "image/svg+xml",
|
|
20
|
+
".png": "image/png",
|
|
21
|
+
".ico": "image/x-icon",
|
|
22
|
+
".json": "application/json; charset=utf-8",
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Stateless HTTP app. It deliberately has no logging: target URLs and results
|
|
26
|
+
* are never written to disk, stdout, or any store. Do not add request logging here.
|
|
27
|
+
*/
|
|
28
|
+
/** Constant-time comparison, so response timing does not reveal how much of a key was right. */
|
|
29
|
+
function sameKey(given, expected) {
|
|
30
|
+
const a = createHash("sha256").update(given).digest();
|
|
31
|
+
const b = createHash("sha256").update(expected).digest();
|
|
32
|
+
return timingSafeEqual(a, b);
|
|
33
|
+
}
|
|
34
|
+
function presentedKey(req) {
|
|
35
|
+
const auth = req.headers.authorization;
|
|
36
|
+
if (auth && /^Bearer\s+/i.test(auth))
|
|
37
|
+
return auth.replace(/^Bearer\s+/i, "").trim();
|
|
38
|
+
const header = req.headers["x-api-key"];
|
|
39
|
+
return typeof header === "string" ? header.trim() : undefined;
|
|
40
|
+
}
|
|
41
|
+
export function createApp(options) {
|
|
42
|
+
let running = 0;
|
|
43
|
+
const now = options.now ?? Date.now;
|
|
44
|
+
// Scan start times per client address. Holds addresses and timestamps only, never targets or results.
|
|
45
|
+
const recent = new Map();
|
|
46
|
+
const clientOf = (req) => {
|
|
47
|
+
const forwarded = options.trustProxy ? String(req.headers["x-forwarded-for"] ?? "").split(",")[0]?.trim() : "";
|
|
48
|
+
return forwarded || req.socket.remoteAddress || "unknown";
|
|
49
|
+
};
|
|
50
|
+
/** Seconds until the client may scan again, or 0 if allowed (and counted). */
|
|
51
|
+
const throttle = (client) => {
|
|
52
|
+
const limit = options.rateLimit;
|
|
53
|
+
if (!limit)
|
|
54
|
+
return 0;
|
|
55
|
+
const t = now();
|
|
56
|
+
const times = (recent.get(client) ?? []).filter((x) => t - x < limit.windowMs);
|
|
57
|
+
if (times.length >= limit.max) {
|
|
58
|
+
recent.set(client, times);
|
|
59
|
+
return Math.max(1, Math.ceil((limit.windowMs - (t - times[0])) / 1000));
|
|
60
|
+
}
|
|
61
|
+
times.push(t);
|
|
62
|
+
recent.set(client, times);
|
|
63
|
+
// Keep the map from growing without bound.
|
|
64
|
+
if (recent.size > 10_000)
|
|
65
|
+
for (const [k, v] of recent)
|
|
66
|
+
if (v.every((x) => t - x >= limit.windowMs))
|
|
67
|
+
recent.delete(k);
|
|
68
|
+
return 0;
|
|
69
|
+
};
|
|
70
|
+
const scan = options.scan ??
|
|
71
|
+
((url) => runScan(url, { permissionConfirmed: true, blockPrivateNetworks: !options.allowPrivateTargets }));
|
|
72
|
+
return async (req, res) => {
|
|
73
|
+
try {
|
|
74
|
+
if (options.allowedHosts && !options.allowedHosts.includes((req.headers.host ?? "").toLowerCase())) {
|
|
75
|
+
return sendJson(res, 421, { error: "This server only answers requests addressed to it directly." });
|
|
76
|
+
}
|
|
77
|
+
const pathname = new URL(req.url ?? "/", "http://localhost").pathname;
|
|
78
|
+
if (pathname === "/scan") {
|
|
79
|
+
if (req.method !== "POST")
|
|
80
|
+
return sendJson(res, 405, { error: "Use POST." }, { allow: "POST" });
|
|
81
|
+
if (options.apiKey) {
|
|
82
|
+
const given = presentedKey(req);
|
|
83
|
+
if (!given || !sameKey(given, options.apiKey)) {
|
|
84
|
+
return sendJson(res, 401, { error: "A valid access key is required." }, { "www-authenticate": "Bearer" });
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
const wait = throttle(clientOf(req));
|
|
88
|
+
if (wait > 0) {
|
|
89
|
+
return sendJson(res, 429, { error: `Too many scans. Try again in ${wait} seconds.` }, { "retry-after": String(wait) });
|
|
90
|
+
}
|
|
91
|
+
if (running >= options.maxConcurrentScans) {
|
|
92
|
+
return sendJson(res, 503, { error: "Server busy, try again shortly." }, { "retry-after": "10" });
|
|
93
|
+
}
|
|
94
|
+
running++;
|
|
95
|
+
try {
|
|
96
|
+
return await handleScan(req, res, options, scan);
|
|
97
|
+
}
|
|
98
|
+
finally {
|
|
99
|
+
running--;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
if (pathname === "/healthz")
|
|
103
|
+
return sendJson(res, 200, { ok: true });
|
|
104
|
+
if (options.staticDir && (req.method === "GET" || req.method === "HEAD")) {
|
|
105
|
+
return await serveStatic(res, options.staticDir, pathname);
|
|
106
|
+
}
|
|
107
|
+
return sendJson(res, 404, { error: "Not found." });
|
|
108
|
+
}
|
|
109
|
+
catch {
|
|
110
|
+
// Intentionally not logged (could contain the target URL).
|
|
111
|
+
if (!res.headersSent)
|
|
112
|
+
sendJson(res, 500, { error: "Internal error." });
|
|
113
|
+
else
|
|
114
|
+
res.end();
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
async function handleScan(req, res, options, scan) {
|
|
119
|
+
if (!/^application\/json\b/i.test(req.headers["content-type"] ?? "")) {
|
|
120
|
+
return sendJson(res, 415, { error: "Content-Type must be application/json." });
|
|
121
|
+
}
|
|
122
|
+
let body;
|
|
123
|
+
try {
|
|
124
|
+
body = JSON.parse(await readBody(req));
|
|
125
|
+
}
|
|
126
|
+
catch (err) {
|
|
127
|
+
const tooLarge = err.message === "too large";
|
|
128
|
+
if (tooLarge)
|
|
129
|
+
return sendJson(res, 413, { error: "Body too large." }, { connection: "close" });
|
|
130
|
+
return sendJson(res, 400, { error: "Invalid JSON." });
|
|
131
|
+
}
|
|
132
|
+
const { url, permissionConfirmed } = (body ?? {});
|
|
133
|
+
if (typeof url !== "string" || url.length === 0 || url.length > 2048) {
|
|
134
|
+
return sendJson(res, 400, { error: "Field 'url' (string) is required." });
|
|
135
|
+
}
|
|
136
|
+
if (permissionConfirmed !== true) {
|
|
137
|
+
return sendJson(res, 403, {
|
|
138
|
+
error: "You must confirm you own the target or are authorized to test it (permissionConfirmed: true).",
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
let target;
|
|
142
|
+
try {
|
|
143
|
+
target = normalizeTarget(url);
|
|
144
|
+
}
|
|
145
|
+
catch (err) {
|
|
146
|
+
return sendJson(res, 400, { error: err instanceof TargetError ? err.message : "Invalid URL." });
|
|
147
|
+
}
|
|
148
|
+
if (!options.allowPrivateTargets) {
|
|
149
|
+
const host = target.hostname.replace(/^\[|\]$/g, "");
|
|
150
|
+
let addresses;
|
|
151
|
+
try {
|
|
152
|
+
addresses = await lookup(host, { all: true });
|
|
153
|
+
}
|
|
154
|
+
catch {
|
|
155
|
+
return sendJson(res, 400, { error: `Cannot resolve host ${host}.` });
|
|
156
|
+
}
|
|
157
|
+
if (addresses.some((a) => isPrivateAddress(a.address))) {
|
|
158
|
+
return sendJson(res, 400, {
|
|
159
|
+
error: "Target resolves to a private or reserved address; this server only scans public sites.",
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
const report = await scan(target.href);
|
|
164
|
+
return sendJson(res, 200, report);
|
|
165
|
+
}
|
|
166
|
+
function readBody(req) {
|
|
167
|
+
return new Promise((resolve, reject) => {
|
|
168
|
+
const chunks = [];
|
|
169
|
+
let size = 0;
|
|
170
|
+
req.on("data", (chunk) => {
|
|
171
|
+
size += chunk.length;
|
|
172
|
+
if (size > MAX_BODY_BYTES) {
|
|
173
|
+
// Stop buffering but drain the rest so the 413 response can still be delivered.
|
|
174
|
+
req.removeAllListeners("data");
|
|
175
|
+
req.resume();
|
|
176
|
+
reject(new Error("too large"));
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
chunks.push(chunk);
|
|
180
|
+
});
|
|
181
|
+
req.on("end", () => resolve(Buffer.concat(chunks).toString("utf8")));
|
|
182
|
+
req.on("error", reject);
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
async function serveStatic(res, root, pathname) {
|
|
186
|
+
const rootAbs = path.resolve(root);
|
|
187
|
+
let file = path.resolve(rootAbs, `.${decodeURIComponent(pathname)}`);
|
|
188
|
+
if (file !== rootAbs && !file.startsWith(rootAbs + path.sep))
|
|
189
|
+
return sendJson(res, 404, { error: "Not found." });
|
|
190
|
+
if (pathname.endsWith("/"))
|
|
191
|
+
file = path.join(file, "index.html");
|
|
192
|
+
let data;
|
|
193
|
+
try {
|
|
194
|
+
data = await readFile(file);
|
|
195
|
+
}
|
|
196
|
+
catch {
|
|
197
|
+
return sendJson(res, 404, { error: "Not found." });
|
|
198
|
+
}
|
|
199
|
+
res.writeHead(200, {
|
|
200
|
+
...SECURITY_HEADERS,
|
|
201
|
+
"content-type": MIME[path.extname(file)] ?? "application/octet-stream",
|
|
202
|
+
"content-length": data.length,
|
|
203
|
+
});
|
|
204
|
+
res.end(data);
|
|
205
|
+
}
|
|
206
|
+
function sendJson(res, status, payload, extra = {}) {
|
|
207
|
+
const body = JSON.stringify(payload);
|
|
208
|
+
res.writeHead(status, {
|
|
209
|
+
...SECURITY_HEADERS,
|
|
210
|
+
...extra,
|
|
211
|
+
"content-type": "application/json; charset=utf-8",
|
|
212
|
+
"content-length": Buffer.byteLength(body),
|
|
213
|
+
});
|
|
214
|
+
res.end(body);
|
|
215
|
+
}
|
|
216
|
+
//# sourceMappingURL=app.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.js","sourceRoot":"","sources":["../../src/server/app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AA2BnD,MAAM,cAAc,GAAG,IAAI,CAAC;AAE5B,MAAM,gBAAgB,GAAG;IACvB,wBAAwB,EAAE,SAAS;IACnC,iBAAiB,EAAE,MAAM;IACzB,iBAAiB,EAAE,aAAa;IAChC,eAAe,EAAE,UAAU;IAC3B,yBAAyB,EACvB,yIAAyI;CAC5I,CAAC;AAEF,MAAM,IAAI,GAA2B;IACnC,OAAO,EAAE,0BAA0B;IACnC,KAAK,EAAE,gCAAgC;IACvC,MAAM,EAAE,yBAAyB;IACjC,MAAM,EAAE,eAAe;IACvB,MAAM,EAAE,WAAW;IACnB,MAAM,EAAE,cAAc;IACtB,OAAO,EAAE,iCAAiC;CAC3C,CAAC;AAEF;;;GAGG;AACH,gGAAgG;AAChG,SAAS,OAAO,CAAC,KAAa,EAAE,QAAgB;IAC9C,MAAM,CAAC,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC;IACtD,MAAM,CAAC,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,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