cantarella-framework 1.0.0 → 1.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/CHANGELOG.md +8 -0
- package/modules/api-jwt-inspector/index.mjs +32 -0
- package/modules/api-jwt-inspector/module.json +14 -0
- package/modules/automation-workflow-plan/index.mjs +27 -0
- package/modules/automation-workflow-plan/module.json +14 -0
- package/modules/exploitation-exploit-reference/index.mjs +49 -0
- package/modules/exploitation-exploit-reference/module.json +21 -0
- package/modules/password-password-strength/index.mjs +28 -0
- package/modules/password-password-strength/module.json +14 -0
- package/modules/recon-rdap-lookup/index.mjs +31 -0
- package/modules/recon-rdap-lookup/module.json +14 -0
- package/modules/reporting-evidence-indexer/index.mjs +41 -0
- package/modules/reporting-evidence-indexer/module.json +14 -0
- package/modules/web-cookie-checker/index.mjs +40 -0
- package/modules/web-cookie-checker/module.json +14 -0
- package/modules/web-cors-checker/index.mjs +45 -0
- package/modules/web-cors-checker/module.json +14 -0
- package/package.json +1 -1
- package/packages/cli/dist/cli.js +1 -1
- package/packages/gui/dist/server.js +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.2.0
|
|
4
|
+
|
|
5
|
+
- New native modules: CORS checker, JWT inspector, password strength estimator, and RDAP domain lookup.
|
|
6
|
+
|
|
7
|
+
## 1.1.0
|
|
8
|
+
|
|
9
|
+
- New modules: evidence indexer, workflow plan validator, Exploit-DB reference search through searchsploit, and cookie security checker.
|
|
10
|
+
|
|
3
11
|
## 1.0.0
|
|
4
12
|
|
|
5
13
|
- First stable release: CLI and local GUI sharing one engine, 22 modules across the framework categories, module installation and templates, correlation, reports, and self-update through npm.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
let input = "";
|
|
2
|
+
process.stdin.setEncoding("utf8");
|
|
3
|
+
process.stdin.on("data", (chunk) => (input += chunk));
|
|
4
|
+
process.stdin.on("end", () => {
|
|
5
|
+
const request = JSON.parse(input || "{}");
|
|
6
|
+
const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
|
|
7
|
+
const parts = String(request.target ?? "").trim().split(".");
|
|
8
|
+
if (parts.length !== 3) {
|
|
9
|
+
emit({ type: "error", message: "Target must be a JWT with three dot-separated parts." });
|
|
10
|
+
process.exitCode = 1;
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
try {
|
|
14
|
+
const decode = (part) => JSON.parse(Buffer.from(part, "base64url").toString("utf8"));
|
|
15
|
+
const header = decode(parts[0]);
|
|
16
|
+
const payload = decode(parts[1]);
|
|
17
|
+
const expiresAt = payload.exp ? new Date(payload.exp * 1000).toISOString() : null;
|
|
18
|
+
const expired = payload.exp ? payload.exp * 1000 < Date.now() : null;
|
|
19
|
+
if (header.alg === "none") {
|
|
20
|
+
emit({ type: "finding", title: "JWT uses alg none", severity: "high", description: "The token header declares no signature algorithm." });
|
|
21
|
+
}
|
|
22
|
+
emit({
|
|
23
|
+
type: "result",
|
|
24
|
+
summary: `JWT alg ${header.alg ?? "unknown"}, expires ${expiresAt ?? "not set"}${expired ? " (expired)" : ""}.`,
|
|
25
|
+
data: { header, payload, expires_at: expiresAt, expired, signature_present: Boolean(parts[2]) },
|
|
26
|
+
});
|
|
27
|
+
emit({ type: "done", summary: "JWT inspection finished." });
|
|
28
|
+
} catch (error) {
|
|
29
|
+
emit({ type: "error", message: `JWT inspection failed: ${error.message}` });
|
|
30
|
+
process.exitCode = 1;
|
|
31
|
+
}
|
|
32
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": 1,
|
|
3
|
+
"id": "api/jwt-inspector",
|
|
4
|
+
"name": "JWT Inspector",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"category": "api",
|
|
7
|
+
"kind": "native",
|
|
8
|
+
"risk": "info",
|
|
9
|
+
"description": "Decodes a JWT header and payload and reports expiry without verifying the signature.",
|
|
10
|
+
"entry": "index.mjs",
|
|
11
|
+
"core_api": "^0.1.0",
|
|
12
|
+
"maintenance": "active",
|
|
13
|
+
"options": []
|
|
14
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
|
|
3
|
+
let input = "";
|
|
4
|
+
process.stdin.setEncoding("utf8");
|
|
5
|
+
process.stdin.on("data", (chunk) => (input += chunk));
|
|
6
|
+
process.stdin.on("end", async () => {
|
|
7
|
+
const request = JSON.parse(input || "{}");
|
|
8
|
+
const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
|
|
9
|
+
try {
|
|
10
|
+
const plan = JSON.parse(await readFile(request.target, "utf8"));
|
|
11
|
+
const steps = Array.isArray(plan) ? plan : plan.steps;
|
|
12
|
+
if (!Array.isArray(steps)) throw new Error("Workflow plan must be an array or an object with a steps array.");
|
|
13
|
+
const normalized = steps.map((step, index) => {
|
|
14
|
+
if (!step?.module) throw new Error(`Step ${index + 1} is missing a module.`);
|
|
15
|
+
return { step: index + 1, module: step.module, target: step.target ?? null, options: step.options ?? {} };
|
|
16
|
+
});
|
|
17
|
+
emit({
|
|
18
|
+
type: "result",
|
|
19
|
+
summary: `Workflow plan is valid with ${normalized.length} steps.`,
|
|
20
|
+
data: { name: plan.name ?? null, steps: normalized },
|
|
21
|
+
});
|
|
22
|
+
emit({ type: "done", summary: "Workflow plan validation finished." });
|
|
23
|
+
} catch (error) {
|
|
24
|
+
emit({ type: "error", message: `Workflow plan failed: ${error.message}` });
|
|
25
|
+
process.exitCode = 1;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": 1,
|
|
3
|
+
"id": "automation/workflow-plan",
|
|
4
|
+
"name": "Workflow Plan",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"category": "automation",
|
|
7
|
+
"kind": "native",
|
|
8
|
+
"risk": "info",
|
|
9
|
+
"description": "Validates and summarizes a JSON workflow plan of Cantarella modules.",
|
|
10
|
+
"entry": "index.mjs",
|
|
11
|
+
"core_api": "^0.1.0",
|
|
12
|
+
"maintenance": "active",
|
|
13
|
+
"options": []
|
|
14
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
|
|
3
|
+
let input = "";
|
|
4
|
+
process.stdin.setEncoding("utf8");
|
|
5
|
+
process.stdin.on("data", (chunk) => (input += chunk));
|
|
6
|
+
process.stdin.on("end", () => {
|
|
7
|
+
const request = JSON.parse(input || "{}");
|
|
8
|
+
const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
|
|
9
|
+
const query = String(request.target ?? "").trim();
|
|
10
|
+
if (!query) {
|
|
11
|
+
emit({ type: "error", message: "A search query is required." });
|
|
12
|
+
process.exitCode = 1;
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
const child = spawn("searchsploit", ["--json", query], { stdio: ["ignore", "pipe", "pipe"] });
|
|
16
|
+
let stdout = "";
|
|
17
|
+
let stderr = "";
|
|
18
|
+
child.stdout.on("data", (chunk) => (stdout += chunk));
|
|
19
|
+
child.stderr.on("data", (chunk) => (stderr += chunk));
|
|
20
|
+
child.on("error", (error) => {
|
|
21
|
+
emit({ type: "error", message: `Exploit reference search failed: ${error.message}` });
|
|
22
|
+
process.exitCode = 1;
|
|
23
|
+
});
|
|
24
|
+
child.on("close", (code) => {
|
|
25
|
+
if (code !== 0) {
|
|
26
|
+
emit({ type: "error", message: `Exploit reference search failed: ${stderr.trim() || `searchsploit exited with ${code}`}` });
|
|
27
|
+
process.exitCode = 1;
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
let results = [];
|
|
31
|
+
try {
|
|
32
|
+
const parsed = JSON.parse(stdout);
|
|
33
|
+
results = (parsed.RESULTS_EXPLOIT ?? []).slice(0, 50).map((item) => ({
|
|
34
|
+
title: item.Title,
|
|
35
|
+
path: item.Path,
|
|
36
|
+
type: item.Type,
|
|
37
|
+
platform: item.Platform,
|
|
38
|
+
}));
|
|
39
|
+
} catch {
|
|
40
|
+
results = stdout.split("\n").filter(Boolean).slice(0, 50).map((line) => ({ title: line.trim() }));
|
|
41
|
+
}
|
|
42
|
+
emit({
|
|
43
|
+
type: "result",
|
|
44
|
+
summary: `Found ${results.length} Exploit-DB references for ${query}.`,
|
|
45
|
+
data: { query, results },
|
|
46
|
+
});
|
|
47
|
+
emit({ type: "done", summary: "Exploit reference search finished." });
|
|
48
|
+
});
|
|
49
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": 1,
|
|
3
|
+
"id": "exploitation/exploit-reference",
|
|
4
|
+
"name": "Exploit Reference",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"category": "exploitation",
|
|
7
|
+
"kind": "wrapper",
|
|
8
|
+
"risk": "high",
|
|
9
|
+
"description": "Searches local Exploit-DB references through searchsploit.",
|
|
10
|
+
"entry": "index.mjs",
|
|
11
|
+
"core_api": "^0.1.0",
|
|
12
|
+
"maintenance": "active",
|
|
13
|
+
"options": [],
|
|
14
|
+
"external_tools": [
|
|
15
|
+
{
|
|
16
|
+
"name": "Exploit-DB",
|
|
17
|
+
"command": "searchsploit",
|
|
18
|
+
"install_hint": "Install exploitdb from your distribution packages."
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
let input = "";
|
|
2
|
+
process.stdin.setEncoding("utf8");
|
|
3
|
+
process.stdin.on("data", (chunk) => (input += chunk));
|
|
4
|
+
process.stdin.on("end", () => {
|
|
5
|
+
const request = JSON.parse(input || "{}");
|
|
6
|
+
const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
|
|
7
|
+
const password = String(request.target ?? "");
|
|
8
|
+
const classes = {
|
|
9
|
+
lowercase: /[a-z]/.test(password),
|
|
10
|
+
uppercase: /[A-Z]/.test(password),
|
|
11
|
+
digits: /\d/.test(password),
|
|
12
|
+
symbols: /[^A-Za-z0-9]/.test(password),
|
|
13
|
+
};
|
|
14
|
+
const variety = Object.values(classes).filter(Boolean).length;
|
|
15
|
+
let score = 0;
|
|
16
|
+
if (password.length >= 8) score += 1;
|
|
17
|
+
if (password.length >= 12) score += 1;
|
|
18
|
+
if (password.length >= 16) score += 1;
|
|
19
|
+
if (variety >= 3) score += 1;
|
|
20
|
+
if (variety === 4 && password.length >= 12) score += 1;
|
|
21
|
+
const labels = ["very weak", "weak", "fair", "good", "strong", "excellent"];
|
|
22
|
+
emit({
|
|
23
|
+
type: "result",
|
|
24
|
+
summary: `Password strength: ${labels[score]} (${score}/5), length ${password.length}.`,
|
|
25
|
+
data: { length: password.length, classes, score, label: labels[score] },
|
|
26
|
+
});
|
|
27
|
+
emit({ type: "done", summary: "Password strength check finished." });
|
|
28
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": 1,
|
|
3
|
+
"id": "password/password-strength",
|
|
4
|
+
"name": "Password Strength",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"category": "password",
|
|
7
|
+
"kind": "native",
|
|
8
|
+
"risk": "info",
|
|
9
|
+
"description": "Estimates password strength from length and character variety.",
|
|
10
|
+
"entry": "index.mjs",
|
|
11
|
+
"core_api": "^0.1.0",
|
|
12
|
+
"maintenance": "active",
|
|
13
|
+
"options": []
|
|
14
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
let input = "";
|
|
2
|
+
process.stdin.setEncoding("utf8");
|
|
3
|
+
process.stdin.on("data", (chunk) => (input += chunk));
|
|
4
|
+
process.stdin.on("end", async () => {
|
|
5
|
+
const request = JSON.parse(input || "{}");
|
|
6
|
+
const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
|
|
7
|
+
const domain = String(request.target ?? "").replace(/^https?:\/\//, "").split("/")[0].toLowerCase();
|
|
8
|
+
try {
|
|
9
|
+
const response = await fetch(`https://rdap.org/domain/${encodeURIComponent(domain)}`, {
|
|
10
|
+
signal: AbortSignal.timeout(10000),
|
|
11
|
+
});
|
|
12
|
+
if (!response.ok) throw new Error(`RDAP returned HTTP ${response.status}`);
|
|
13
|
+
const body = await response.json();
|
|
14
|
+
const events = Object.fromEntries((body.events ?? []).map((event) => [event.eventAction, event.eventDate]));
|
|
15
|
+
emit({
|
|
16
|
+
type: "result",
|
|
17
|
+
summary: `${domain}: registered ${events.registration ?? "unknown"}, expires ${events.expiration ?? "unknown"}.`,
|
|
18
|
+
data: {
|
|
19
|
+
domain,
|
|
20
|
+
handle: body.handle,
|
|
21
|
+
status: body.status,
|
|
22
|
+
nameservers: body.nameservers?.map((item) => item.ldhName),
|
|
23
|
+
events,
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
emit({ type: "done", summary: "RDAP lookup finished." });
|
|
27
|
+
} catch (error) {
|
|
28
|
+
emit({ type: "error", message: `RDAP lookup failed: ${error.message}` });
|
|
29
|
+
process.exitCode = 1;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": 1,
|
|
3
|
+
"id": "recon/rdap-lookup",
|
|
4
|
+
"name": "RDAP Lookup",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"category": "recon",
|
|
7
|
+
"kind": "native",
|
|
8
|
+
"risk": "low",
|
|
9
|
+
"description": "Looks up domain registration data through RDAP.",
|
|
10
|
+
"entry": "index.mjs",
|
|
11
|
+
"core_api": "^0.1.0",
|
|
12
|
+
"maintenance": "active",
|
|
13
|
+
"options": []
|
|
14
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { readdir, readFile, stat } from "node:fs/promises";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
|
|
5
|
+
let input = "";
|
|
6
|
+
process.stdin.setEncoding("utf8");
|
|
7
|
+
process.stdin.on("data", (chunk) => (input += chunk));
|
|
8
|
+
process.stdin.on("end", async () => {
|
|
9
|
+
const request = JSON.parse(input || "{}");
|
|
10
|
+
const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
|
|
11
|
+
const target = String(request.target ?? ".");
|
|
12
|
+
const files = [];
|
|
13
|
+
async function walk(entry) {
|
|
14
|
+
const info = await stat(entry);
|
|
15
|
+
if (info.isDirectory()) {
|
|
16
|
+
if (["node_modules", ".git", ".cantarella"].includes(path.basename(entry))) return;
|
|
17
|
+
for (const child of await readdir(entry)) await walk(path.join(entry, child));
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const data = await readFile(entry);
|
|
21
|
+
files.push({
|
|
22
|
+
file: entry,
|
|
23
|
+
size_bytes: info.size,
|
|
24
|
+
modified_at: info.mtime.toISOString(),
|
|
25
|
+
sha256: createHash("sha256").update(data).digest("hex"),
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
try {
|
|
29
|
+
await walk(target);
|
|
30
|
+
files.sort((a, b) => a.file.localeCompare(b.file));
|
|
31
|
+
emit({
|
|
32
|
+
type: "result",
|
|
33
|
+
summary: `Indexed ${files.length} evidence files under ${target}.`,
|
|
34
|
+
data: { target, files: files.slice(0, 500), total_files: files.length },
|
|
35
|
+
});
|
|
36
|
+
emit({ type: "done", summary: "Evidence indexing finished." });
|
|
37
|
+
} catch (error) {
|
|
38
|
+
emit({ type: "error", message: `Evidence indexing failed: ${error.message}` });
|
|
39
|
+
process.exitCode = 1;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": 1,
|
|
3
|
+
"id": "reporting/evidence-indexer",
|
|
4
|
+
"name": "Evidence Indexer",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"category": "reporting",
|
|
7
|
+
"kind": "native",
|
|
8
|
+
"risk": "info",
|
|
9
|
+
"description": "Indexes local evidence files with sizes and SHA-256 hashes.",
|
|
10
|
+
"entry": "index.mjs",
|
|
11
|
+
"core_api": "^0.1.0",
|
|
12
|
+
"maintenance": "active",
|
|
13
|
+
"options": []
|
|
14
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
let input = "";
|
|
2
|
+
process.stdin.setEncoding("utf8");
|
|
3
|
+
process.stdin.on("data", (chunk) => (input += chunk));
|
|
4
|
+
process.stdin.on("end", async () => {
|
|
5
|
+
const request = JSON.parse(input || "{}");
|
|
6
|
+
const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
|
|
7
|
+
const target = /^https?:\/\//.test(request.target) ? request.target : `https://${request.target}`;
|
|
8
|
+
try {
|
|
9
|
+
const response = await fetch(target, { redirect: "manual", signal: AbortSignal.timeout(8000) });
|
|
10
|
+
const raw = response.headers.getSetCookie ? response.headers.getSetCookie() : [response.headers.get("set-cookie")].filter(Boolean);
|
|
11
|
+
const cookies = raw.map((value) => {
|
|
12
|
+
const [pair, ...attributes] = value.split(";").map((part) => part.trim());
|
|
13
|
+
const flags = attributes.map((part) => part.split("=")[0].toLowerCase());
|
|
14
|
+
return {
|
|
15
|
+
name: pair.split("=")[0],
|
|
16
|
+
secure: flags.includes("secure"),
|
|
17
|
+
http_only: flags.includes("httponly"),
|
|
18
|
+
same_site: attributes.find((part) => part.toLowerCase().startsWith("samesite="))?.split("=")[1] ?? null,
|
|
19
|
+
};
|
|
20
|
+
});
|
|
21
|
+
const weak = cookies.filter((cookie) => !cookie.secure || !cookie.http_only || !cookie.same_site);
|
|
22
|
+
if (weak.length) {
|
|
23
|
+
emit({
|
|
24
|
+
type: "finding",
|
|
25
|
+
title: "Cookies missing security attributes",
|
|
26
|
+
severity: "low",
|
|
27
|
+
description: `${weak.length} cookies are missing Secure, HttpOnly, or SameSite attributes.`,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
emit({
|
|
31
|
+
type: "result",
|
|
32
|
+
summary: `${target} set ${cookies.length} cookies; ${weak.length} are missing security attributes.`,
|
|
33
|
+
data: { url: target, status: response.status, cookies },
|
|
34
|
+
});
|
|
35
|
+
emit({ type: "done", summary: "Cookie check finished." });
|
|
36
|
+
} catch (error) {
|
|
37
|
+
emit({ type: "error", message: `Cookie check failed: ${error.message}` });
|
|
38
|
+
process.exitCode = 1;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": 1,
|
|
3
|
+
"id": "web/cookie-checker",
|
|
4
|
+
"name": "Cookie Checker",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"category": "web",
|
|
7
|
+
"kind": "native",
|
|
8
|
+
"risk": "low",
|
|
9
|
+
"description": "Checks cookie security attributes on a web response.",
|
|
10
|
+
"entry": "index.mjs",
|
|
11
|
+
"core_api": "^0.1.0",
|
|
12
|
+
"maintenance": "active",
|
|
13
|
+
"options": []
|
|
14
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
let input = "";
|
|
2
|
+
process.stdin.setEncoding("utf8");
|
|
3
|
+
process.stdin.on("data", (chunk) => (input += chunk));
|
|
4
|
+
process.stdin.on("end", async () => {
|
|
5
|
+
const request = JSON.parse(input || "{}");
|
|
6
|
+
const emit = (event) => process.stdout.write(`${JSON.stringify(event)}\n`);
|
|
7
|
+
const target = /^https?:\/\//.test(request.target) ? request.target : `https://${request.target}`;
|
|
8
|
+
try {
|
|
9
|
+
const response = await fetch(target, {
|
|
10
|
+
method: "OPTIONS",
|
|
11
|
+
headers: {
|
|
12
|
+
Origin: "https://example.com",
|
|
13
|
+
"Access-Control-Request-Method": "GET",
|
|
14
|
+
},
|
|
15
|
+
redirect: "manual",
|
|
16
|
+
signal: AbortSignal.timeout(8000),
|
|
17
|
+
});
|
|
18
|
+
const allowOrigin = response.headers.get("access-control-allow-origin");
|
|
19
|
+
const allowCredentials = response.headers.get("access-control-allow-credentials");
|
|
20
|
+
if (allowOrigin === "*" && allowCredentials === "true") {
|
|
21
|
+
emit({
|
|
22
|
+
type: "finding",
|
|
23
|
+
title: "Wildcard CORS with credentials",
|
|
24
|
+
severity: "medium",
|
|
25
|
+
description: "The response allows any origin while also allowing credentials.",
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
emit({
|
|
29
|
+
type: "result",
|
|
30
|
+
summary: `${target} CORS allow-origin: ${allowOrigin ?? "not set"}.`,
|
|
31
|
+
data: {
|
|
32
|
+
url: target,
|
|
33
|
+
status: response.status,
|
|
34
|
+
allow_origin: allowOrigin,
|
|
35
|
+
allow_credentials: allowCredentials,
|
|
36
|
+
allow_methods: response.headers.get("access-control-allow-methods"),
|
|
37
|
+
allow_headers: response.headers.get("access-control-allow-headers"),
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
emit({ type: "done", summary: "CORS check finished." });
|
|
41
|
+
} catch (error) {
|
|
42
|
+
emit({ type: "error", message: `CORS check failed: ${error.message}` });
|
|
43
|
+
process.exitCode = 1;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": 1,
|
|
3
|
+
"id": "web/cors-checker",
|
|
4
|
+
"name": "CORS Checker",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"category": "web",
|
|
7
|
+
"kind": "native",
|
|
8
|
+
"risk": "low",
|
|
9
|
+
"description": "Checks CORS response headers for a web origin.",
|
|
10
|
+
"entry": "index.mjs",
|
|
11
|
+
"core_api": "^0.1.0",
|
|
12
|
+
"maintenance": "active",
|
|
13
|
+
"options": []
|
|
14
|
+
}
|
package/package.json
CHANGED
package/packages/cli/dist/cli.js
CHANGED
|
@@ -11,7 +11,7 @@ process.stdout.on("error", (error) => {
|
|
|
11
11
|
process.exit(0);
|
|
12
12
|
throw error;
|
|
13
13
|
});
|
|
14
|
-
const VERSION = "1.
|
|
14
|
+
const VERSION = "1.2.0";
|
|
15
15
|
const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../../..");
|
|
16
16
|
function banner() {
|
|
17
17
|
return (process.stdout.columns ?? 80) >= 72 ? BANNER : COMPACT_BANNER;
|
|
@@ -78,8 +78,8 @@ export function createGuiServer(root) {
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
sendJson(response, 200, {
|
|
81
|
-
version: "1.
|
|
82
|
-
update_message: (await checkForUpdate("1.
|
|
81
|
+
version: "1.2.0",
|
|
82
|
+
update_message: (await checkForUpdate("1.2.0")).message,
|
|
83
83
|
categories: CATEGORIES,
|
|
84
84
|
modules: modules.map(({ manifest }) => manifest),
|
|
85
85
|
external_tools: [...tools.values()],
|