shippingszn 0.6.0 → 0.7.1
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/checks/dangerous.js +17 -1
- package/dist/index.js +6 -1
- package/dist/items.js +10 -0
- package/package.json +1 -1
package/dist/checks/dangerous.js
CHANGED
|
@@ -23,6 +23,13 @@ const DANGEROUS_PATTERNS = [
|
|
|
23
23
|
severity: "medium",
|
|
24
24
|
message: "Wildcard CORS (Access-Control-Allow-Origin: *). Lock this down to specific origins for any authenticated endpoint.",
|
|
25
25
|
},
|
|
26
|
+
{
|
|
27
|
+
id: "shell-exec-call",
|
|
28
|
+
regex: /(^|[^A-Za-z0-9_$.])(exec|execSync)\s*\(/,
|
|
29
|
+
itemId: "common-attacks",
|
|
30
|
+
severity: "high",
|
|
31
|
+
message: "Shell execution via exec/execSync — if any argument includes user input, this is a command-injection path. Prefer execFile with an argument array, or validate input strictly against an allowlist.",
|
|
32
|
+
},
|
|
26
33
|
];
|
|
27
34
|
export async function checkDangerousPatterns(ctx) {
|
|
28
35
|
const findings = [];
|
|
@@ -32,7 +39,16 @@ export async function checkDangerousPatterns(ctx) {
|
|
|
32
39
|
if (isScanExempt(file.relPath))
|
|
33
40
|
continue;
|
|
34
41
|
const ext = path.extname(file.relPath).toLowerCase();
|
|
35
|
-
if (![
|
|
42
|
+
if (![
|
|
43
|
+
".ts",
|
|
44
|
+
".tsx",
|
|
45
|
+
".js",
|
|
46
|
+
".jsx",
|
|
47
|
+
".mjs",
|
|
48
|
+
".cjs",
|
|
49
|
+
".json",
|
|
50
|
+
".html",
|
|
51
|
+
].includes(ext))
|
|
36
52
|
continue;
|
|
37
53
|
const content = await readFileSafe(file);
|
|
38
54
|
if (!content)
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import * as path from "node:path";
|
|
3
3
|
import * as process from "node:process";
|
|
4
|
+
import { createRequire } from "node:module";
|
|
4
5
|
import { ALL_CHECKS } from "./checks.js";
|
|
5
6
|
import { listFiles, getTrackedFiles } from "./scan.js";
|
|
6
7
|
import { CHECKLIST_ITEMS, permalinkFor } from "./items.js";
|
|
@@ -31,7 +32,11 @@ function applyTrackingAwareSeverity(findings, tracked) {
|
|
|
31
32
|
});
|
|
32
33
|
}
|
|
33
34
|
const DEFAULT_BASE_URL = "https://shippingszn.com";
|
|
34
|
-
const PKG_VERSION =
|
|
35
|
+
const PKG_VERSION = (() => {
|
|
36
|
+
const require = createRequire(import.meta.url);
|
|
37
|
+
const pkg = require("../package.json");
|
|
38
|
+
return pkg.version;
|
|
39
|
+
})();
|
|
35
40
|
function parseArgs(argv) {
|
|
36
41
|
const opts = {
|
|
37
42
|
cwd: process.cwd(),
|
package/dist/items.js
CHANGED
|
@@ -39,6 +39,16 @@ export const CHECKLIST_ITEMS = {
|
|
|
39
39
|
title: "Audit what your AI builder actually shipped",
|
|
40
40
|
priority: "critical",
|
|
41
41
|
},
|
|
42
|
+
aeo: {
|
|
43
|
+
id: "aeo",
|
|
44
|
+
title: "Make AI assistants able to recommend you",
|
|
45
|
+
priority: "lower",
|
|
46
|
+
},
|
|
47
|
+
"installable-app": {
|
|
48
|
+
id: "installable-app",
|
|
49
|
+
title: "Make your app installable on phones",
|
|
50
|
+
priority: "lower",
|
|
51
|
+
},
|
|
42
52
|
};
|
|
43
53
|
export function permalinkFor(itemId, baseUrl) {
|
|
44
54
|
const trimmed = baseUrl.replace(/\/+$/, "");
|
package/package.json
CHANGED