proskills-cli 0.2.0 → 0.2.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/scan.js +5 -1
- package/package.json +1 -1
package/dist/scan.js
CHANGED
|
@@ -65,7 +65,7 @@ const SECURITY = [
|
|
|
65
65
|
{ rule: "sec/obfuscation", severity: "warn", cost: 6, re: /[A-Za-z0-9+/]{120,}={0,2}/, message: "Long encoded blob; reviewers can't read what it does." },
|
|
66
66
|
{ rule: "sec/fake-prerequisite", severity: "critical", cost: 25, re: /\b(download|install|run)\b[^\n]{0,60}\bhttps?:\/\/[^\s)]+\.(dmg|pkg|exe|msi|zip|tar\.gz|sh|ps1|bin|AppImage)\b/i, message: "Tells the user or agent to fetch and run a binary, the pattern behind the ClawHavoc malware campaign." },
|
|
67
67
|
{ rule: "sec/remote-instructions", severity: "warn", cost: 10, re: /\b(fetch|download|curl|read|load|get)\b[^\n]{0,40}\bhttps?:\/\/[^\s)]+[^\n]{0,60}\b(follow|apply|execute|obey)\b[^\n]{0,20}\b(instructions|rules|steps|prompt)/i, message: "Pulls instructions from a URL at runtime, so the skill can change after it was reviewed." },
|
|
68
|
-
{ rule: "sec/persistence", severity: "warn", cost: 10, re: /\b(crontab|launchctl|systemctl\s+enable|schtasks|reg\s+add
|
|
68
|
+
{ rule: "sec/persistence", severity: "warn", cost: 10, re: /\b(crontab|launchctl|systemctl\s+enable|schtasks|reg\s+add|settings\.json.*hooks|Startup folder)\b|\.(bashrc|zshrc|bash_profile|profile)(?!\.?\w)/i, message: "Installs persistence or edits shell/agent config." },
|
|
69
69
|
{ rule: "sec/permissions", severity: "warn", cost: 8, re: /--dangerously-skip-permissions|bypassPermissions|allowed-tools:\s*["']?\*|chmod\s+(-R\s+)?777|\bsudo\b/i, message: "Escalates permissions." },
|
|
70
70
|
];
|
|
71
71
|
const HIDDEN = /[----\u{E0000}-\u{E007F}]/u;
|
|
@@ -152,6 +152,10 @@ export function scanSkill(input) {
|
|
|
152
152
|
const present = new Set(others.map((f) => rel(f.path)));
|
|
153
153
|
const refRe = /(?:\]\(|`)((?:\.\/)?(?:[\w.-]+\/)*[\w.-]+\.(?:md|py|sh|js|mjs|ts|json|ya?ml|txt|csv|html))(?:\)|`)/g;
|
|
154
154
|
const referenced = new Set();
|
|
155
|
+
// profile.md holds the user's answers: the skill creates it if missing, so it
|
|
156
|
+
// is never required, and any mention in SKILL.md (frontmatter too) counts.
|
|
157
|
+
if (/\bprofile\.md\b/.test(skill.content))
|
|
158
|
+
referenced.add("profile.md");
|
|
155
159
|
for (const m of body.matchAll(refRe)) {
|
|
156
160
|
const p = m[1].replace(/^\.\//, "");
|
|
157
161
|
if (p === "SKILL.md" || p === "profile.md" || /^(package|tsconfig)\.json$/.test(p))
|