@lintsure/core 0.3.19 → 0.3.20
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/src/answers.d.ts +27 -0
- package/dist/src/answers.js +66 -0
- package/dist/src/assessment.js +1 -1
- package/dist/src/guidance.js +1 -1
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.js +31 -13
- package/dist/src/knowledge/cra.js +1 -1
- package/dist/src/knowledge/eu-ai-act.js +2 -1
- package/dist/src/knowledge/gdpr.js +2 -1
- package/dist/src/knowledge/index.js +2 -2
- package/dist/src/knowledge/more.d.ts +1 -0
- package/dist/src/knowledge/more.js +52 -8
- package/dist/src/knowledge/owasp-top10.js +2 -2
- package/dist/src/review.d.ts +7 -0
- package/dist/src/review.js +18 -0
- package/dist/src/rules/agentic.d.ts +2 -0
- package/dist/src/rules/agentic.js +25 -0
- package/dist/src/rules/index.js +2 -1
- package/dist/src/rules/more.d.ts +11 -0
- package/dist/src/rules/more.js +35 -0
- package/dist/src/types.d.ts +1 -1
- package/docs/README.md +1 -1
- package/docs/agents.md +1 -1
- package/docs/frameworks.md +31 -12
- package/docs/rules.md +55 -20
- package/package.json +1 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Profile } from "./knowledge/types.js";
|
|
2
|
+
/** One rule in plain words, with what to check before calling a finding real. An unknown id gets a line saying so. */
|
|
3
|
+
export declare function explainRule(ruleId: string): string;
|
|
4
|
+
export declare const QUESTIONS: {
|
|
5
|
+
readonly euUsers: "Do you have users or customers in the EU?";
|
|
6
|
+
readonly personalData: "Do you store or process data about people (names, emails, addresses, IP addresses)?";
|
|
7
|
+
readonly specialCategoryData: "Any sensitive data, such as health, biometrics, ethnicity, religion, politics, sexual orientation or union membership?";
|
|
8
|
+
readonly usesAI: "Does any feature use an AI model, including third-party ones like OpenAI or Gemini?";
|
|
9
|
+
readonly generativeAI: "Does the AI create text, images, audio or video that people see?";
|
|
10
|
+
readonly interactsWithPeople: "Do people talk or chat with the AI directly, for example a chatbot or voice assistant?";
|
|
11
|
+
readonly decisionArea: "Does the AI help decide something important about people? If so, which area (for example \"employment\" for screening job applicants, \"credit\" for loan scoring), otherwise \"none\".";
|
|
12
|
+
readonly b2bCustomers: "Do you sell to businesses, whose security teams may ask for SOC 2 or ISO 27001?";
|
|
13
|
+
readonly wantsCertification: "Do customers or partners ask for a security certificate or report, such as ISO 27001 or a SOC 2 report?";
|
|
14
|
+
readonly digitalProductEU: "Do you sell or supply software, an app or a connected device in the EU as a business?";
|
|
15
|
+
readonly mobileApp: "Do you have a mobile app (iOS, Android, React Native, Expo or Flutter)?";
|
|
16
|
+
readonly healthDataUS: "Do you handle health information for US patients, as a healthcare provider or for one (business associate)?";
|
|
17
|
+
readonly governmentCustomers: "Do you sell software to US government agencies or their suppliers?";
|
|
18
|
+
readonly euConsumers: "Do you sell to consumers in the EU, for example an online shop, banking, travel booking, e-books or a messaging service?";
|
|
19
|
+
readonly cardPayments: "Do you take card payments?";
|
|
20
|
+
readonly usMarket: "Do you sell in the United States?";
|
|
21
|
+
};
|
|
22
|
+
/** Which frameworks may apply, from yes/no answers. With no answers it returns the questions to ask. */
|
|
23
|
+
export declare function classifyAnswer(profile: Profile): string;
|
|
24
|
+
/** The checks a feature is likely to meet, from its description in plain words. */
|
|
25
|
+
export declare function planAnswer(feature: string): string;
|
|
26
|
+
/** One framework in plain words, or null when the id is not known. */
|
|
27
|
+
export declare function explainFramework(framework: string): string | null;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// The text answers behind the MCP tools and the CLI commands of the same name (explain, classify, plan), so an agent
|
|
2
|
+
// with only a terminal reads exactly what an agent with the MCP server reads.
|
|
3
|
+
import { APPROVAL_RULES } from "./guidance.js";
|
|
4
|
+
import { classify, getKnowledge } from "./knowledge/index.js";
|
|
5
|
+
import { checksFor } from "./plan.js";
|
|
6
|
+
import { rules } from "./rules/index.js";
|
|
7
|
+
import { crossStandardLinks, verifyText } from "./verify.js";
|
|
8
|
+
/** One rule in plain words, with what to check before calling a finding real. An unknown id gets a line saying so. */
|
|
9
|
+
export function explainRule(ruleId) {
|
|
10
|
+
const r = rules.find((x) => x.id === ruleId);
|
|
11
|
+
return r ? `${r.title}\nControls: ${r.controls.map((c) => `${c.framework} ${c.id}`).join(", ")}\nSuggested fix: ${r.fix}\nNote: ${r.note}${(r.seenIn ?? []).map((s) => `\nSeen in a real incident: ${s.title} (${s.url})`).join("")}${crossStandardLinks(r).length ? `\nThe same weakness in other standards: ${crossStandardLinks(r).join(" ")}` : ""}\n\n${verifyText(r.id)}\n\n${APPROVAL_RULES}` : `No rule named ${ruleId}. Rule ids look like "pii.logged"; see lintsure.com/rules.`;
|
|
12
|
+
}
|
|
13
|
+
// One list of questions: it describes the inputs and is what the agent asks when it has no answers yet.
|
|
14
|
+
export const QUESTIONS = {
|
|
15
|
+
euUsers: "Do you have users or customers in the EU?",
|
|
16
|
+
personalData: "Do you store or process data about people (names, emails, addresses, IP addresses)?",
|
|
17
|
+
specialCategoryData: "Any sensitive data, such as health, biometrics, ethnicity, religion, politics, sexual orientation or union membership?",
|
|
18
|
+
usesAI: "Does any feature use an AI model, including third-party ones like OpenAI or Gemini?",
|
|
19
|
+
generativeAI: "Does the AI create text, images, audio or video that people see?",
|
|
20
|
+
interactsWithPeople: "Do people talk or chat with the AI directly, for example a chatbot or voice assistant?",
|
|
21
|
+
decisionArea: "Does the AI help decide something important about people? If so, which area (for example \"employment\" for screening job applicants, \"credit\" for loan scoring), otherwise \"none\".",
|
|
22
|
+
b2bCustomers: "Do you sell to businesses, whose security teams may ask for SOC 2 or ISO 27001?",
|
|
23
|
+
wantsCertification: "Do customers or partners ask for a security certificate or report, such as ISO 27001 or a SOC 2 report?",
|
|
24
|
+
digitalProductEU: "Do you sell or supply software, an app or a connected device in the EU as a business?",
|
|
25
|
+
mobileApp: "Do you have a mobile app (iOS, Android, React Native, Expo or Flutter)?",
|
|
26
|
+
healthDataUS: "Do you handle health information for US patients, as a healthcare provider or for one (business associate)?",
|
|
27
|
+
governmentCustomers: "Do you sell software to US government agencies or their suppliers?",
|
|
28
|
+
euConsumers: "Do you sell to consumers in the EU, for example an online shop, banking, travel booking, e-books or a messaging service?",
|
|
29
|
+
cardPayments: "Do you take card payments?",
|
|
30
|
+
usMarket: "Do you sell in the United States?",
|
|
31
|
+
};
|
|
32
|
+
/** Which frameworks may apply, from yes/no answers. With no answers it returns the questions to ask. */
|
|
33
|
+
export function classifyAnswer(profile) {
|
|
34
|
+
// No answers yet: hand back the questions, so the agent asks the user instead of guessing.
|
|
35
|
+
if (!Object.values(profile).some((v) => v !== undefined))
|
|
36
|
+
return ([
|
|
37
|
+
"Ask the user these questions, then call classify again with their answers (leave out anything they don't know):",
|
|
38
|
+
...Object.entries(QUESTIONS).map(([k, q]) => `- ${k}: ${q}`),
|
|
39
|
+
].join("\n"));
|
|
40
|
+
const s = classify(profile);
|
|
41
|
+
return (s.length
|
|
42
|
+
? `These frameworks may apply, based on the answers given:\n${s.map((x) => `- ${x.name}: ${x.reason}`).join("\n")}\n\nThis is a suggestion, not a legal determination. Ask the user to confirm the list before running scan.`
|
|
43
|
+
: "None of the available frameworks clearly apply from these answers. That is not a conclusion that no rules apply; ask the user, or a compliance professional, to confirm.");
|
|
44
|
+
}
|
|
45
|
+
/** The checks a feature is likely to meet, from its description in plain words. */
|
|
46
|
+
export function planAnswer(feature) {
|
|
47
|
+
const found = checksFor(feature);
|
|
48
|
+
if (!found.length)
|
|
49
|
+
return ("No Lintsure check matches this description. Run the scan tool after writing the code.");
|
|
50
|
+
return ([`Checks this feature is likely to meet (${found.length}), best match first. Build it so these don't fire:`, "",
|
|
51
|
+
...found.map((r) => `- ${r.id}: ${r.title}. Avoid it: ${r.fix}`), "", "Run the scan tool when the code is written. These are hints from the description, not findings."].join("\n"));
|
|
52
|
+
}
|
|
53
|
+
/** One framework in plain words, or null when the id is not known. */
|
|
54
|
+
export function explainFramework(framework) {
|
|
55
|
+
const k = getKnowledge(framework);
|
|
56
|
+
if (!k)
|
|
57
|
+
return null;
|
|
58
|
+
const today = new Date().toISOString().slice(0, 10);
|
|
59
|
+
return ([
|
|
60
|
+
`# ${k.name}`, k.summary, "", `Applies to: ${k.whoItAppliesTo}`,
|
|
61
|
+
...(k.timeline ? ["", "Key dates:", ...k.timeline.map((m) => `- ${m.date} (${m.date <= today ? "already applies" : "upcoming"}): ${m.what}`)] : []),
|
|
62
|
+
"", "What it asks:", ...k.obligations.map((o) => `- ${o.ref} ${o.title} [${o.inCode === "yes" ? "checked in code" : o.inCode === "partly" ? "partly in code" : "outside code"}]: ${o.plain}`),
|
|
63
|
+
"", "Watch out:", ...k.watchOut.map((w) => `- ${w}`),
|
|
64
|
+
"", `Summary in our own words, checked on ${k.checkedOn}. Read the official text for anything you rely on.`,
|
|
65
|
+
].join("\n"));
|
|
66
|
+
}
|
package/dist/src/assessment.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { DISCLAIMER, NOT_A_VERDICT, nextSteps } from "./index.js";
|
|
5
5
|
import { knowledge } from "./knowledge/index.js";
|
|
6
6
|
const esc = (s) => s.replace(/[&<>"']/g, (c) => ({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" })[c]);
|
|
7
|
-
const NAME = { "eu-ai-act": "EU AI Act", gdpr: "GDPR", "owasp-top10": "OWASP Top 10:2025", cra: "EU Cyber Resilience Act", "owasp-api": "OWASP API Security Top 10 2023", "owasp-ast": "OWASP Agentic Skills Top 10", "owasp-llm": "OWASP Top 10 for LLM Applications 2025", "cwe-top25": "CWE Top 25 (2025)" };
|
|
7
|
+
const NAME = { "owasp-agentic": "OWASP Top 10 for Agentic Applications 2026", "eu-ai-act": "EU AI Act", gdpr: "GDPR", "owasp-top10": "OWASP Top 10:2025", cra: "EU Cyber Resilience Act", "owasp-api": "OWASP API Security Top 10 2023", "owasp-ast": "OWASP Agentic Skills Top 10", "owasp-llm": "OWASP Top 10 for LLM Applications 2025", "cwe-top25": "CWE Top 25 (2025)" };
|
|
8
8
|
// Frameworks from rule packs use the name in their own knowledge.
|
|
9
9
|
const fwName = (f) => NAME[f] ?? knowledge.find((k) => k.id === f)?.name ?? f;
|
|
10
10
|
const STATUS = { gap: "Gap", partial: "Partial", met: "Met", outside: "Outside code" };
|
package/dist/src/guidance.js
CHANGED
|
@@ -5,7 +5,7 @@ export const APPROVAL_RULES = `Before you do anything (edit, create or delete a
|
|
|
5
5
|
3. Where, exactly: the file and line, or the document and section.
|
|
6
6
|
4. The benefit to the user if they approve it.
|
|
7
7
|
Then ask the user to approve that one proposal and wait. Only a clear yes is approval. Silence, "maybe" or a question is not. Do only what was approved, then show what changed. One proposal at a time.`;
|
|
8
|
-
const NAMES = { "eu-ai-act": "EU AI Act", gdpr: "GDPR", "owasp-top10": "OWASP Top 10", cra: "Cyber Resilience Act", "owasp-api": "OWASP API Security Top 10", "owasp-ast": "OWASP Agentic Skills Top 10", "owasp-llm": "OWASP LLM Top 10", "cwe-top25": "CWE Top 25" };
|
|
8
|
+
const NAMES = { "owasp-agentic": "OWASP Top 10 for Agentic Applications", "eu-ai-act": "EU AI Act", gdpr: "GDPR", "owasp-top10": "OWASP Top 10", cra: "Cyber Resilience Act", "owasp-api": "OWASP API Security Top 10", "owasp-ast": "OWASP Agentic Skills Top 10", "owasp-llm": "OWASP LLM Top 10", "cwe-top25": "CWE Top 25" };
|
|
9
9
|
const refs = (cs) => cs.map((c) => `${NAMES[c.framework] ?? c.framework} ${c.id}`).join(", ");
|
|
10
10
|
/** Lays a finding out as a proposal a person can approve or decline. */
|
|
11
11
|
export function proposalFor(f) {
|
package/dist/src/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { rules } from "./rules/index.js";
|
|
|
2
2
|
import type { FrameworkId, Report, Severity } from "./types.js";
|
|
3
3
|
export * from "./review.js";
|
|
4
4
|
export * from "./verify.js";
|
|
5
|
+
export * from "./answers.js";
|
|
5
6
|
export { toSarif } from "./sarif.js";
|
|
6
7
|
import { type RecordOptions } from "./record.js";
|
|
7
8
|
export * from "./record.js";
|
|
@@ -14,7 +15,7 @@ export { toAssessmentHtml } from "./assessment.js";
|
|
|
14
15
|
export * from "./knowledge/index.js";
|
|
15
16
|
export { loadPacks, registerPack, type Pack } from "./packs.js";
|
|
16
17
|
export { checksFor } from "./plan.js";
|
|
17
|
-
export declare const RULES_VERSION = "0.3.
|
|
18
|
+
export declare const RULES_VERSION = "0.3.20";
|
|
18
19
|
/** Shown with every result, in every interface. Lintsure prepares; people decide. */
|
|
19
20
|
export declare const DISCLAIMER: string;
|
|
20
21
|
/** What a report must never be read as. Used in the report and by the MCP server. */
|
package/dist/src/index.js
CHANGED
|
@@ -6,9 +6,10 @@ import { basename, extname, join, relative, sep } from "node:path";
|
|
|
6
6
|
import { outsideFor } from "./knowledge/index.js";
|
|
7
7
|
import { MASKED, rules } from "./rules/index.js";
|
|
8
8
|
import { proposalFor } from "./guidance.js";
|
|
9
|
-
import { applyReview, fingerprint, isOpen } from "./review.js";
|
|
9
|
+
import { applyReview, fingerprint, isOpen, parseSkillRecord, SKILL_TREE, skillHash, SKILLS_RECORD } from "./review.js";
|
|
10
10
|
export * from "./review.js";
|
|
11
11
|
export * from "./verify.js";
|
|
12
|
+
export * from "./answers.js";
|
|
12
13
|
export { toSarif } from "./sarif.js";
|
|
13
14
|
import { buildRecord } from "./record.js";
|
|
14
15
|
export * from "./record.js";
|
|
@@ -23,7 +24,7 @@ export { loadPacks, registerPack } from "./packs.js";
|
|
|
23
24
|
export { checksFor } from "./plan.js";
|
|
24
25
|
import { configPacks, loadPacks, packFrameworks, packsLoaded } from "./packs.js";
|
|
25
26
|
import { buildGraph, declaredEntries, reachOf } from "./reach.js";
|
|
26
|
-
export const RULES_VERSION = "0.3.
|
|
27
|
+
export const RULES_VERSION = "0.3.20";
|
|
27
28
|
/** Shown with every result, in every interface. Lintsure prepares; people decide. */
|
|
28
29
|
export const DISCLAIMER = "Lintsure is a readiness tool, not an audit, a certification or legal advice. " +
|
|
29
30
|
"Its rules reflect our reading of the publicly available text of each framework, and they check code only. " +
|
|
@@ -53,7 +54,7 @@ export function nextSteps(r) {
|
|
|
53
54
|
"Ask a qualified compliance professional to review the results before you rely on them.",
|
|
54
55
|
].filter(Boolean);
|
|
55
56
|
}
|
|
56
|
-
export const ALL_FRAMEWORKS = ["gdpr", "eu-ai-act", "owasp-top10", "cra", "owasp-llm", "cwe-top25", "owasp-ast", "owasp-api"];
|
|
57
|
+
export const ALL_FRAMEWORKS = ["gdpr", "eu-ai-act", "owasp-top10", "cra", "owasp-llm", "cwe-top25", "owasp-ast", "owasp-api", "owasp-agentic"];
|
|
57
58
|
const KEYS = new Set(["frameworks", "ignore", "packs", "rules", "show"]);
|
|
58
59
|
const RULE_SETTINGS = new Set(["off", "low", "medium", "high"]);
|
|
59
60
|
export async function readConfig(root) {
|
|
@@ -245,7 +246,7 @@ export function inDevBranch(lines, i) {
|
|
|
245
246
|
if (at < 0 || at >= level)
|
|
246
247
|
continue;
|
|
247
248
|
level = at;
|
|
248
|
-
if (
|
|
249
|
+
if (/^(\}\s*)?else\s*[:{]?$/.test(lines[k].trim())) { // a plain else: its `if` is the nearest opener above at the same indent
|
|
249
250
|
const open = lines.slice(Math.max(0, k - 30), k).reverse().find((x) => indent(x) === at && opens.test(x));
|
|
250
251
|
if (open && /\b(is_?prod(uction)?|production)\b/i.test(open) && !negated(open))
|
|
251
252
|
return true;
|
|
@@ -275,21 +276,21 @@ export function importedNames(file, text, files, byEnding) {
|
|
|
275
276
|
else if (s && s !== ".")
|
|
276
277
|
out.push(s);
|
|
277
278
|
} return out.join("/"); };
|
|
278
|
-
const names = (list, sep) => list.split(",").map((x) => x.trim().replace(/^type
|
|
279
|
+
const names = (list, sep) => list.split(",").map((x) => x.replace(/\s+/g, " ").trim().replace(/^type /, "")).filter(Boolean).map((x) => { const [name, local] = x.split(sep).map((y) => y.trim()); return { name, local: local ?? name }; });
|
|
279
280
|
const out = [];
|
|
280
281
|
if (/\.py$/.test(file)) {
|
|
281
|
-
for (const m of text.matchAll(/^[ \t]*from[ \t]+(
|
|
282
|
-
const mod = m[
|
|
283
|
-
const base =
|
|
282
|
+
for (const m of text.matchAll(/^[ \t]*from[ \t]+(\.+[\w.]*|[\w.]+)[ \t]+import[ \t]+(?:\(([^)]*)\)|([^#\n]+))/gm)) {
|
|
283
|
+
const dots = /^\.*/.exec(m[1])[0], mod = m[1].slice(dots.length).split(".").filter(Boolean).join("/");
|
|
284
|
+
const base = dots ? norm(`${dir}/${"../".repeat(dots.length - 1)}${mod}`) : mod;
|
|
284
285
|
if (!base)
|
|
285
286
|
continue;
|
|
286
287
|
const ends = [`${base}.py`, `${base}/__init__.py`];
|
|
287
288
|
const find = byEnding ?? ((e) => { for (const f of files)
|
|
288
289
|
if (f === e || f.endsWith("/" + e))
|
|
289
290
|
return f; return undefined; });
|
|
290
|
-
const from =
|
|
291
|
+
const from = dots ? ends.find((e) => files.has(e)) : ends.map(find).find(Boolean);
|
|
291
292
|
if (from)
|
|
292
|
-
for (const n of names(m[
|
|
293
|
+
for (const n of names(m[2] ?? m[3], " as "))
|
|
293
294
|
out.push({ ...n, from });
|
|
294
295
|
}
|
|
295
296
|
return out;
|
|
@@ -305,7 +306,7 @@ export function importedNames(file, text, files, byEnding) {
|
|
|
305
306
|
for (const m of text.matchAll(/\bimport\s*(?:type\s*)?\{([^}]*)\}\s*from\s*["']([^"'\n]+)["']|\b(?:const|let|var)\s*\{([^}]*)\}\s*=\s*require\(\s*["']([^"'\n]+)["']\s*\)/g)) {
|
|
306
307
|
const from = resolve(m[2] ?? m[4]);
|
|
307
308
|
if (from)
|
|
308
|
-
for (const n of names(m[1] ?? m[3], m[1] != null ?
|
|
309
|
+
for (const n of names(m[1] ?? m[3], m[1] != null ? " as " : ":"))
|
|
309
310
|
out.push({ ...n, from });
|
|
310
311
|
}
|
|
311
312
|
return out;
|
|
@@ -685,6 +686,21 @@ export async function scan(root, frameworks = ALL_FRAMEWORKS, opts = {}) {
|
|
|
685
686
|
}
|
|
686
687
|
return t;
|
|
687
688
|
};
|
|
689
|
+
// Skill files against the reviewed record. A file missing from the record counts too: it was added after the review.
|
|
690
|
+
const skillRule = active.find((r) => r.id === "skill.changed-since-recorded"), skillRecord = skillRule ? parseSkillRecord(await textOf(join(root, SKILLS_RECORD))) : null;
|
|
691
|
+
if (skillRule && skillRecord)
|
|
692
|
+
for (const [k, file] of paths.entries()) {
|
|
693
|
+
if (!SKILL_TREE.test(file) || file.endsWith(".lintsure-backup"))
|
|
694
|
+
continue;
|
|
695
|
+
checkPoints++;
|
|
696
|
+
perRule[skillRule.id] = (perRule[skillRule.id] ?? 0) + 1;
|
|
697
|
+
const text = await textOf(all[k]);
|
|
698
|
+
if (text === null || skillRecord[file] === skillHash(text))
|
|
699
|
+
continue;
|
|
700
|
+
const controls = skillRule.controls.filter((c) => frameworks.includes(c.framework));
|
|
701
|
+
findings.push({ id: "", ruleId: skillRule.id, file, line: 1, status: skillRule.status, severity: skillRule.severity, title: skillRule.title, controls, fix: skillRule.fix, note: skillRule.note,
|
|
702
|
+
proposal: proposalFor({ file, line: 1, title: skillRule.title, fix: skillRule.fix, note: skillRule.note, controls }), fingerprint: fingerprint(skillRule.id, file, skillHash(text).slice(0, 12)), unseen: skillRule.unseen });
|
|
703
|
+
}
|
|
688
704
|
// Prefetch only files some reader needs: a rule that applies to it, a shared-file rule, or reachability.
|
|
689
705
|
const needed = all.filter((abs, k) => {
|
|
690
706
|
const ext = extOf(abs), name = basename(abs), file = paths[k];
|
|
@@ -1016,6 +1032,8 @@ function recordLines(r) {
|
|
|
1016
1032
|
// but routine, and they would bury findings in the code.
|
|
1017
1033
|
const HYGIENE_RULES = new Set(["ci.action-unpinned", "repo.no-sbom", "repo.no-security-policy", "repo.no-dependency-updates", "docker.runs-as-root", "docker.image-unpinned", "docker.copies-everything"]);
|
|
1018
1034
|
export const isHygiene = (f) => HYGIENE_RULES.has(f.ruleId);
|
|
1035
|
+
// A file name is written inside backticks: a backtick or a line break in it would end the code span and let the name add its own Markdown.
|
|
1036
|
+
const mdPath = (s) => s.replace(/[\x00-\x1f\x60]/g, "?");
|
|
1019
1037
|
export function toMarkdown(r) {
|
|
1020
1038
|
const hygiene = r.findings.filter(isHygiene);
|
|
1021
1039
|
const lines = [
|
|
@@ -1035,10 +1053,10 @@ export function toMarkdown(r) {
|
|
|
1035
1053
|
const rank = (f) => (isHygiene(f) ? 6 : 0) + (f.status === "gap" ? 0 : 3) + { high: 0, medium: 1, low: 2 }[f.severity] + (f.reach?.status === "unreachable" ? 0.5 : 0);
|
|
1036
1054
|
const sorted = [...r.findings].sort((a, b) => rank(a) - rank(b));
|
|
1037
1055
|
for (const f of sorted)
|
|
1038
|
-
lines.push(...(f === sorted[r.findings.length - hygiene.length] ? [`## Repo hygiene (${hygiene.length})`, "", "Housekeeping for the repo, not flaws in the code. Findings in the code come first.", ""] : []), `### ${f.id} · ${f.status === "gap" ? "Finding" : "Observation"} (${LABEL[f.status]}) · \`${f.file}:${f.line}\`${f.change === "new" ? " · New since baseline" : ""}`, `**${f.title}** · Risk level: ${f.severity}`, "", ...(f.accepted ? [acceptedLine(f.accepted), ""] : []), ...(f.confirmed ? [`Confirmed as real by ${f.confirmed.by}${f.confirmed.date ? ` on ${f.confirmed.date}` : ""}, after reading the code.${f.confirmed.note ? ` ${f.confirmed.note}` : ""}`, ""] : []), `- Rules: ${ctl(f.controls)}`, `- Auditor note: ${f.note}`, ...(f.unseen ? [`- What Lintsure couldn't see: ${f.unseen}`] : []), ...(rules.find((x) => x.id === f.ruleId)?.seenIn ?? []).map((s) => `- Seen in a real incident: ${s.title} (${s.url})`), ...(f.reach ? [`- Reached from: ${f.reach.status === "entry" ? "this file is an entry point (route, handler or function)" : f.reach.status === "reachable" ? f.reach.via.join(" → ") : f.reach.status === "unknown" ? "unknown (an import Lintsure couldn't resolve may lead here)" : "not reached from any entry point Lintsure recognises (it may be loaded some other way, or be unused)"}`] : []), "", `**${PROPOSAL_HEADING}**`, "", `- Where: \`${f.proposal.where}\``, `- What: ${f.proposal.what}`, `- Why: ${f.proposal.why}`, `- Benefit: ${f.proposal.benefit}`, "", ...(f.patch ? [`Exact change (still needs your approval), line ${f.patch.line}:`, "", "```diff",
|
|
1056
|
+
lines.push(...(f === sorted[r.findings.length - hygiene.length] ? [`## Repo hygiene (${hygiene.length})`, "", "Housekeeping for the repo, not flaws in the code. Findings in the code come first.", ""] : []), `### ${f.id} · ${f.status === "gap" ? "Finding" : "Observation"} (${LABEL[f.status]}) · \`${mdPath(f.file)}:${f.line}\`${f.change === "new" ? " · New since baseline" : ""}`, `**${f.title}** · Risk level: ${f.severity}`, "", ...(f.accepted ? [acceptedLine(f.accepted), ""] : []), ...(f.confirmed ? [`Confirmed as real by ${f.confirmed.by}${f.confirmed.date ? ` on ${f.confirmed.date}` : ""}, after reading the code.${f.confirmed.note ? ` ${f.confirmed.note}` : ""}`, ""] : []), `- Rules: ${ctl(f.controls)}`, `- Auditor note: ${f.note}`, ...(f.unseen ? [`- What Lintsure couldn't see: ${f.unseen}`] : []), ...(rules.find((x) => x.id === f.ruleId)?.seenIn ?? []).map((s) => `- Seen in a real incident: ${s.title} (${s.url})`), ...(f.reach ? [`- Reached from: ${f.reach.status === "entry" ? "this file is an entry point (route, handler or function)" : f.reach.status === "reachable" ? f.reach.via.join(" → ") : f.reach.status === "unknown" ? "unknown (an import Lintsure couldn't resolve may lead here)" : "not reached from any entry point Lintsure recognises (it may be loaded some other way, or be unused)"}`] : []), "", `**${PROPOSAL_HEADING}**`, "", `- Where: \`${f.proposal.where}\``, `- What: ${f.proposal.what}`, `- Why: ${f.proposal.why}`, `- Benefit: ${f.proposal.benefit}`, "", ...(f.patch ? [`Exact change (still needs your approval), line ${f.patch.line}:`, "", "```diff",
|
|
1039
1057
|
...(f.patch.old != null ? [`- ${f.patch.old}`] : []), ...f.patch.text.replace(/\n$/, "").split("\n").map((t) => `+ ${t}`), "```", ""] : []));
|
|
1040
1058
|
if (r.baseline?.fixed.length)
|
|
1041
|
-
lines.push(`## Fixed since baseline (${r.baseline.fixed.length})`, "", ...r.baseline.fixed.map((x) => `- ${x.ruleId} in \`${x.file}\``), "");
|
|
1059
|
+
lines.push(`## Fixed since baseline (${r.baseline.fixed.length})`, "", ...r.baseline.fixed.map((x) => `- ${x.ruleId} in \`${mdPath(x.file)}\``), "");
|
|
1042
1060
|
lines.push(`## Met (${r.met.length})`, "", ...r.met.map((m) => `- ${m.title} · ${ctl(m.controls)}`), "");
|
|
1043
1061
|
lines.push(`## Outside code (${r.outside.length})`, "", "Code can't prove these. They still need to be done before a full review.", "", ...r.outside.map((o) => `- ${o.framework.toUpperCase()} ${o.control} · ${o.title}: ${o.evidence}`), "");
|
|
1044
1062
|
if (r.notCovered?.length)
|
|
@@ -83,5 +83,5 @@ export const cra = {
|
|
|
83
83
|
"Harmonised standards for the Act were still being written in late 2026. Until they're published, there's no ready-made checklist that proves conformity.",
|
|
84
84
|
"A code check covers part of Annex I. It can't show the risk assessment, support period, reporting process or documentation.",
|
|
85
85
|
],
|
|
86
|
-
checkedOn: "2026-
|
|
86
|
+
checkedOn: "2026-12-06",
|
|
87
87
|
};
|
|
@@ -25,6 +25,7 @@ export const euAiAct = {
|
|
|
25
25
|
{ date: "2026-12-02", what: "New bans on AI that makes non-consensual intimate images or child abuse material. Deadline for older generative systems to mark their output as AI-made." },
|
|
26
26
|
{ date: "2027-12-02", what: "High-risk rules apply to uses listed in Annex III (credit, hiring, education and others). Moved later by the 2026 Digital Omnibus." },
|
|
27
27
|
{ date: "2028-08-02", what: "High-risk rules apply to AI that is a safety part of products covered by Annex I (machinery, medical devices and others)." },
|
|
28
|
+
{ date: "2030-08-02", what: "High-risk systems that public authorities already use must meet the rules by now." },
|
|
28
29
|
],
|
|
29
30
|
obligations: [
|
|
30
31
|
{ ref: "Art. 4", title: "AI literacy", inCode: "no",
|
|
@@ -79,5 +80,5 @@ export const euAiAct = {
|
|
|
79
80
|
"The 2026 Digital Omnibus moved high-risk dates later, but bans and openness duties still apply on their original or earlier dates.",
|
|
80
81
|
"Code can show signals of risk. Only a person can decide the legal tier.",
|
|
81
82
|
],
|
|
82
|
-
checkedOn: "2026-
|
|
83
|
+
checkedOn: "2026-12-06",
|
|
83
84
|
};
|
|
@@ -64,10 +64,11 @@ export const gdpr = {
|
|
|
64
64
|
evidence: "The transfer tool used for each non-EU vendor." },
|
|
65
65
|
],
|
|
66
66
|
watchOut: [
|
|
67
|
+
"A proposal to change parts of the GDPR (the Digital Omnibus) was still being negotiated in December 2026. Until a final text is adopted, the rules described here apply.",
|
|
67
68
|
"Pseudonymised data, like hashed emails, is still personal data. Only truly anonymous data is out of scope.",
|
|
68
69
|
"An AI model trained on personal data may itself hold personal data. Don't assume it's anonymous.",
|
|
69
70
|
"Analytics and session-replay tools often collect more than you think. Check what each SDK sends.",
|
|
70
71
|
"Legitimate interests is not a free pass. It needs a written balancing test.",
|
|
71
72
|
],
|
|
72
|
-
checkedOn: "2026-
|
|
73
|
+
checkedOn: "2026-12-06",
|
|
73
74
|
};
|
|
@@ -2,9 +2,9 @@ import { euAiAct } from "./eu-ai-act.js";
|
|
|
2
2
|
import { gdpr } from "./gdpr.js";
|
|
3
3
|
import { owaspTop10 } from "./owasp-top10.js";
|
|
4
4
|
import { cra } from "./cra.js";
|
|
5
|
-
import { cweTop25, owaspApi, owaspAst, owaspLlm } from "./more.js";
|
|
5
|
+
import { cweTop25, owaspAgentic, owaspApi, owaspAst, owaspLlm } from "./more.js";
|
|
6
6
|
export * from "./types.js";
|
|
7
|
-
export const knowledge = [euAiAct, gdpr, owaspTop10, cra, owaspLlm, cweTop25, owaspAst, owaspApi];
|
|
7
|
+
export const knowledge = [euAiAct, gdpr, owaspTop10, cra, owaspLlm, cweTop25, owaspAst, owaspApi, owaspAgentic];
|
|
8
8
|
export const getKnowledge = (id) => knowledge.find((k) => k.id === id);
|
|
9
9
|
/** Classifier: suggest frameworks with a reason. The user confirms; nothing is auto-applied. */
|
|
10
10
|
export function classify(p) {
|
|
@@ -42,7 +42,7 @@ export const owaspLlm = {
|
|
|
42
42
|
evidence: "How model output is validated before use." },
|
|
43
43
|
],
|
|
44
44
|
watchOut: ["Prompt injection has no complete fix today. Reduce what a fooled model can do, rather than relying on filters alone.", "Lintsure reads one line or file at a time, so prompts built across several files may be missed."],
|
|
45
|
-
checkedOn: "2026-
|
|
45
|
+
checkedOn: "2026-12-06",
|
|
46
46
|
};
|
|
47
47
|
export const cweTop25 = {
|
|
48
48
|
id: "cwe-top25", name: "CWE Top 25 (2025)", kind: "standard",
|
|
@@ -62,9 +62,9 @@ export const cweTop25 = {
|
|
|
62
62
|
{ ref: "CWE-787, 416, 125, 120, 476, 121, 122", title: "Memory safety", inCode: "no", plain: "Buffer and pointer errors in C and C++. Lintsure doesn't check these languages; use a memory-safe language or a dedicated tool.", evidence: "Results from a C/C++ analyser or fuzzing." },
|
|
63
63
|
],
|
|
64
64
|
watchOut: ["The list ranks weaknesses by data from published vulnerabilities; it changes a little each year.", "Seven of the 25 are memory-safety weaknesses that don't apply to JavaScript, TypeScript or Python code."],
|
|
65
|
-
checkedOn: "2026-
|
|
65
|
+
checkedOn: "2026-12-06",
|
|
66
66
|
};
|
|
67
|
-
// The list is an OWASP incubator project, version 1.0 (2026)
|
|
67
|
+
// The list is an OWASP incubator project, version 1.0 (2026). Ids and names only.
|
|
68
68
|
export const owaspAst = {
|
|
69
69
|
id: "owasp-ast", name: "OWASP Agentic Skills Top 10", kind: "standard",
|
|
70
70
|
summary: "Ten risks in the skills, instruction files and tool servers that AI coding agents load: malicious skills, a poisoned supply chain, too many permissions, misleading metadata, instructions fetched at run time, weak isolation, silent updates, weak scanning, no inventory and reuse across platforms. It's a young awareness list, still in public review, not a law or certification.",
|
|
@@ -74,7 +74,7 @@ export const owaspAst = {
|
|
|
74
74
|
return p.usesAI && (p.generativeAI || p.interactsWithPeople) ? "Agents load skills, instruction files and tool servers as instructions, so what is in them is part of your supply chain." : null;
|
|
75
75
|
},
|
|
76
76
|
obligations: [
|
|
77
|
-
{ ref: "AST01", title: "Malicious Skills", inCode: "partly", rules: ["agent.instructions-unsafe", "skill.writes-agent-memory"],
|
|
77
|
+
{ ref: "AST01", title: "Malicious Skills", inCode: "partly", rules: ["agent.instructions-unsafe", "skill.writes-agent-memory", "skill.changed-since-recorded"],
|
|
78
78
|
plain: "A skill can look useful and still tell the agent to hide a step, send secrets out or change its own instructions. Read a skill's text like code before an agent uses it.",
|
|
79
79
|
evidence: "Where each installed skill came from, and who read it before it was added." },
|
|
80
80
|
{ ref: "AST02", title: "Supply Chain Compromise", inCode: "partly", rules: ["agent.config-runs-remote-code", "mcp.config-unsafe-server"],
|
|
@@ -92,7 +92,7 @@ export const owaspAst = {
|
|
|
92
92
|
{ ref: "AST06", title: "Weak Isolation", inCode: "partly", rules: ["mcp.server-binds-all-interfaces"],
|
|
93
93
|
plain: "Skills and tool servers should run boxed in: local interfaces only, with sign-in, and limited to the files they declare.",
|
|
94
94
|
evidence: "How each tool server is started, where it listens and who can reach it." },
|
|
95
|
-
{ ref: "AST07", title: "Update Drift", inCode: "partly", rules: ["mcp.config-unsafe-server"],
|
|
95
|
+
{ ref: "AST07", title: "Update Drift", inCode: "partly", rules: ["mcp.config-unsafe-server", "mcp.config-legacy-sse"],
|
|
96
96
|
plain: "A skill or server that updates by itself can change after you approved it. Pin versions and look again on every update.",
|
|
97
97
|
evidence: "How updates to skills and servers are approved." },
|
|
98
98
|
{ ref: "AST08", title: "Poor Scanning", inCode: "no",
|
|
@@ -105,8 +105,8 @@ export const owaspAst = {
|
|
|
105
105
|
plain: "A skill moved from one agent to another can lose its limits on the way, because each agent enforces different things. Check it again on each one.",
|
|
106
106
|
evidence: "For a skill used on several agents, what each agent enforces." },
|
|
107
107
|
],
|
|
108
|
-
watchOut: ["The list is version 1.0 from an OWASP incubator project
|
|
109
|
-
checkedOn: "2026-
|
|
108
|
+
watchOut: ["The list is version 1.0 (2026) from an OWASP incubator project, so ids and names may still change.", "Lintsure reads a skill one line at a time. It can't judge whether a skill's description matches what it does, and it doesn't run the skill."],
|
|
109
|
+
checkedOn: "2026-12-06",
|
|
110
110
|
};
|
|
111
111
|
export const owaspApi = {
|
|
112
112
|
id: "owasp-api", name: "OWASP API Security Top 10 2023", kind: "standard",
|
|
@@ -148,5 +148,49 @@ export const owaspApi = {
|
|
|
148
148
|
evidence: "The third-party APIs you call, and how each response is validated." },
|
|
149
149
|
],
|
|
150
150
|
watchOut: ["Most API breaches are logic flaws: the code works as written and still lets the wrong person in. A pattern check sees only part of that.", "Lintsure reads one file at a time, with the project's middleware. A check that lives in a gateway or a shared wrapper may not be seen."],
|
|
151
|
-
checkedOn: "2026-
|
|
151
|
+
checkedOn: "2026-12-06",
|
|
152
|
+
};
|
|
153
|
+
// Published by the OWASP GenAI Security Project in December 2025 as the 2026 edition. Ids and names only.
|
|
154
|
+
export const owaspAgentic = {
|
|
155
|
+
id: "owasp-agentic", name: "OWASP Top 10 for Agentic Applications 2026", kind: "standard",
|
|
156
|
+
summary: "The ten most serious security risks in software where an AI agent plans and acts by itself: a hijacked goal, misused tools, abused sign-ins, a poisoned supply chain, code run by surprise, poisoned memory, open channels between agents, failures that spread, misplaced human trust and agents that go their own way. It's an awareness list, not a law.",
|
|
157
|
+
whoItAppliesTo: "Any team that builds or runs an AI agent that calls tools, runs code or works with other agents, including coding agents.",
|
|
158
|
+
applies(p) {
|
|
159
|
+
// The profile has no question about agents, so this follows the same signal as the LLM list.
|
|
160
|
+
return p.usesAI && (p.generativeAI || p.interactsWithPeople) ? "An AI feature that can call tools or act for a user is an agent, and this list names what goes wrong with those." : null;
|
|
161
|
+
},
|
|
162
|
+
obligations: [
|
|
163
|
+
{ ref: "ASI01", title: "Agent Goal Hijack", inCode: "partly", rules: ["mcp.tool-description-poisoned", "llm.retrieved-text-in-system-prompt", "llm.user-input-in-system-prompt", "llm.client-controls-system", "agent.instructions-unsafe", "skill.fetches-remote-instructions"],
|
|
164
|
+
plain: "Text an agent reads can change what it sets out to do: a web page, a document, a tool description or another agent's message. Keep outside text away from the instructions, and check the goal again before a risky step.",
|
|
165
|
+
evidence: "Tests that feed the agent hostile text, and what it did." },
|
|
166
|
+
{ ref: "ASI02", title: "Tool Misuse and Exploitation", inCode: "partly", rules: ["mcp.tool-runs-shell", "skill.unrestricted-shell", "agent.permissions-allow-all"],
|
|
167
|
+
plain: "An agent can use a tool it is allowed to use in a harmful way, such as deleting data or sending it out. Give each tool the narrowest job, and ask a person before anything that can't be undone.",
|
|
168
|
+
evidence: "The list of tools each agent can call, with the limits on each." },
|
|
169
|
+
{ ref: "ASI03", title: "Identity and Privilege Abuse", inCode: "partly", rules: ["mcp.tool-uses-secret", "mcp.config-token-over-http", "agent.permissions-allow-all"],
|
|
170
|
+
plain: "Agents act with keys and sign-ins that belong to people or services. A stolen or shared one lets an agent do far more than its task. Give each agent its own short-lived access, limited to the task.",
|
|
171
|
+
evidence: "Which credentials each agent holds, what they can reach and how they are replaced." },
|
|
172
|
+
{ ref: "ASI04", title: "Agentic Supply Chain Vulnerabilities", inCode: "partly", rules: ["mcp.config-unsafe-server", "mcp.config-legacy-sse", "agent.config-runs-remote-code", "skill.changed-since-recorded", "skill.fetches-remote-instructions"],
|
|
173
|
+
plain: "Tools, skills, prompts and other agents are loaded while the agent runs, often from someone else. Pin what you load to a version you have read, and notice when it changes.",
|
|
174
|
+
evidence: "An inventory of servers, skills and models with their versions and sources." },
|
|
175
|
+
{ ref: "ASI05", title: "Unexpected Code Execution (RCE)", inCode: "partly", rules: ["mcp.tool-runs-shell", "agent.config-runs-remote-code", "skill.unrestricted-shell"],
|
|
176
|
+
plain: "An agent that writes and runs code, or passes text to a shell, can be talked into running an attacker's code. Run generated code in a sandbox, and never pass model text straight to a shell.",
|
|
177
|
+
evidence: "Where generated code runs, and what it can reach from there." },
|
|
178
|
+
{ ref: "ASI06", title: "Memory & Context Poisoning", inCode: "partly", rules: ["skill.writes-agent-memory", "llm.retrieved-text-in-system-prompt"],
|
|
179
|
+
plain: "What an agent stores and reads back later shapes its next decisions. One poisoned note or document keeps steering it long after the attack. Control what gets written to memory and where retrieved text is placed.",
|
|
180
|
+
evidence: "What the agent can write to memory, and how entries are reviewed or expire." },
|
|
181
|
+
{ ref: "ASI07", title: "Insecure Inter-Agent Communication", inCode: "partly", rules: ["mcp.server-binds-all-interfaces", "mcp.config-token-over-http"],
|
|
182
|
+
plain: "Messages between agents and tool servers can be read, changed or faked when the channel is open or has no sign-in. Use encrypted connections with sign-in, and don't listen on every network interface.",
|
|
183
|
+
evidence: "How agents and servers prove who they are to each other." },
|
|
184
|
+
{ ref: "ASI08", title: "Cascading Failures", inCode: "partly", rules: ["llm.unbounded-agent-loop"],
|
|
185
|
+
plain: "One wrong step can spread through chained agents and tools faster than a person can notice. Put limits on steps, spend and repeated calls, and stop the chain when a check fails.",
|
|
186
|
+
evidence: "The limits set on agent runs, and what happens when one is reached." },
|
|
187
|
+
{ ref: "ASI09", title: "Human-Agent Trust Exploitation", inCode: "partly", rules: ["agent.approval-author-alone", "agent.approval-rule-files-open", "ai.hides-being-ai"],
|
|
188
|
+
plain: "People tend to approve what a confident agent proposes. An approval step only works when the person sees what will happen, and when someone other than the agent's own author can say no.",
|
|
189
|
+
evidence: "Which actions need a person's approval, and what that person is shown." },
|
|
190
|
+
{ ref: "ASI10", title: "Rogue Agents", inCode: "no",
|
|
191
|
+
plain: "An agent that has been taken over, or has drifted from its task, can keep acting inside its permissions while doing harm. This shows in behaviour over time, not in code.",
|
|
192
|
+
evidence: "Monitoring of agent actions, and how an agent is stopped and its access removed." },
|
|
193
|
+
],
|
|
194
|
+
watchOut: ["Lintsure has no checks written only for this list. It maps its checks on agent config files, skills, MCP servers and LLM calls to the entries they help with.", "Lintsure reads files. It doesn't watch an agent while it runs, so a hijacked goal, an agent that drifts and failures that spread between agents are mostly outside what code shows."],
|
|
195
|
+
checkedOn: "2026-12-06",
|
|
152
196
|
};
|
|
@@ -37,7 +37,7 @@ export const owaspTop10 = {
|
|
|
37
37
|
plain: "Whether any dependency version has a published vulnerability, and whether it's maintained. This needs vulnerability advisory data, which Lintsure doesn't download, so use a dependency scanner alongside it.",
|
|
38
38
|
evidence: "Dependency scanner results (for example npm audit, OSV-Scanner or Dependabot) and how alerts are handled." },
|
|
39
39
|
{ ref: "A04:2025", title: "Cryptographic Failures", inCode: "yes",
|
|
40
|
-
rules: ["crypto.weak-password-hash", "crypto.weak-random-token", "crypto.weak-cipher", "jwt.unverified", "transport.plain-http", "transport.tls-verify-off", "secret.in-source", "secret.public-env", "mobile.token-in-plain-storage", "mobile.cleartext-traffic", "jwt.weak-secret", "crypto.unsafe-compare"],
|
|
40
|
+
rules: ["mcp.config-token-over-http", "crypto.weak-password-hash", "crypto.weak-random-token", "crypto.weak-cipher", "jwt.unverified", "transport.plain-http", "transport.tls-verify-off", "secret.in-source", "secret.public-env", "mobile.token-in-plain-storage", "mobile.cleartext-traffic", "jwt.weak-secret", "crypto.unsafe-compare"],
|
|
41
41
|
plain: "Protect data with sound cryptography: HTTPS everywhere, certificate checks on, strong password hashing, modern ciphers, unpredictable tokens, signed tokens that are verified, and no keys in code.",
|
|
42
42
|
evidence: "Where data is encrypted in transit and at rest, and how keys are stored and rotated." },
|
|
43
43
|
{ ref: "A04:2025 (key management)", title: "Key management and encryption at rest", inCode: "no",
|
|
@@ -89,5 +89,5 @@ export const owaspTop10 = {
|
|
|
89
89
|
"Lintsure reads one line or one file at a time. Data passed through helpers in other files won't be followed, so some problems will be missed.",
|
|
90
90
|
"Saying an app is 'OWASP compliant' isn't meaningful. Describe what was checked and what wasn't.",
|
|
91
91
|
],
|
|
92
|
-
checkedOn: "2026-
|
|
92
|
+
checkedOn: "2026-12-06",
|
|
93
93
|
};
|
package/dist/src/review.d.ts
CHANGED
|
@@ -2,6 +2,13 @@ import type { Finding, Report } from "./types.js";
|
|
|
2
2
|
export declare const BASELINE_FILE = ".lintsure/baseline.json";
|
|
3
3
|
export declare const ACCEPTED_FILE = ".lintsure/accepted.yaml";
|
|
4
4
|
export declare const CONFIRMED_FILE = ".lintsure/confirmed.yaml";
|
|
5
|
+
export declare const SKILLS_RECORD = ".lintsure/skills.json";
|
|
6
|
+
/** Every file inside an agent's skills folder: the instructions and the helper scripts beside them. */
|
|
7
|
+
export declare const SKILL_TREE: RegExp;
|
|
8
|
+
/** Line endings are evened out first, so a checkout on Windows gives the same fingerprint. */
|
|
9
|
+
export declare const skillHash: (text: string) => string;
|
|
10
|
+
/** The record's path-to-fingerprint map, or null when the file is missing or not ours. */
|
|
11
|
+
export declare function parseSkillRecord(text: string | null): Record<string, string> | null;
|
|
5
12
|
/** A short one-way hash of the rule, file and the flagged line with spacing normalised. Moving the line keeps it; editing it changes it. */
|
|
6
13
|
export declare function fingerprint(ruleId: string, file: string, lineText: string): string;
|
|
7
14
|
export interface Baseline {
|
package/dist/src/review.js
CHANGED
|
@@ -4,11 +4,29 @@
|
|
|
4
4
|
import { createHash } from "node:crypto";
|
|
5
5
|
import { readFile } from "node:fs/promises";
|
|
6
6
|
import { join } from "node:path";
|
|
7
|
+
import { AGENT_DIRS } from "./rules/owasp.js";
|
|
7
8
|
export const BASELINE_FILE = ".lintsure/baseline.json";
|
|
8
9
|
export const ACCEPTED_FILE = ".lintsure/accepted.yaml";
|
|
9
10
|
// Findings a reviewer read against the code and found real. Same list form as accepted.yaml, so a verdict is not lost
|
|
10
11
|
// when the conversation that reached it ends.
|
|
11
12
|
export const CONFIRMED_FILE = ".lintsure/confirmed.yaml";
|
|
13
|
+
// Fingerprints of the project's skill files as a person last reviewed them, written by `lintsure skills --record`.
|
|
14
|
+
// A scan then reports any skill file that differs from it. No record, no check.
|
|
15
|
+
export const SKILLS_RECORD = ".lintsure/skills.json";
|
|
16
|
+
/** Every file inside an agent's skills folder: the instructions and the helper scripts beside them. */
|
|
17
|
+
export const SKILL_TREE = new RegExp(String.raw `(^|\/)${AGENT_DIRS}\/skills\/.+`, "i");
|
|
18
|
+
/** Line endings are evened out first, so a checkout on Windows gives the same fingerprint. */
|
|
19
|
+
export const skillHash = (text) => createHash("sha256").update(text.replace(/\r\n/g, "\n")).digest("hex");
|
|
20
|
+
/** The record's path-to-fingerprint map, or null when the file is missing or not ours. */
|
|
21
|
+
export function parseSkillRecord(text) {
|
|
22
|
+
try {
|
|
23
|
+
const f = JSON.parse(text ?? "").files;
|
|
24
|
+
return f && typeof f === "object" && !Array.isArray(f) ? f : null;
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
12
30
|
/** A short one-way hash of the rule, file and the flagged line with spacing normalised. Moving the line keeps it; editing it changes it. */
|
|
13
31
|
export function fingerprint(ruleId, file, lineText) {
|
|
14
32
|
return createHash("sha256").update(`${ruleId}\n${file}\n${lineText.trim().replace(/\s+/g, " ")}`).digest("hex").slice(0, 16);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const TITLES = { "01": "Agent Goal Hijack", "02": "Tool Misuse and Exploitation", "03": "Identity and Privilege Abuse", "04": "Agentic Supply Chain Vulnerabilities", "05": "Unexpected Code Execution (RCE)", "06": "Memory & Context Poisoning", "07": "Insecure Inter-Agent Communication", "08": "Cascading Failures", "09": "Human-Agent Trust Exploitation", "10": "Rogue Agents" };
|
|
2
|
+
const ASI = (n) => ({ framework: "owasp-agentic", id: `ASI${n}`, title: TITLES[n] });
|
|
3
|
+
export const agenticForExisting = {
|
|
4
|
+
"mcp.tool-description-poisoned": [ASI("01")],
|
|
5
|
+
"llm.retrieved-text-in-system-prompt": [ASI("01"), ASI("06")],
|
|
6
|
+
"llm.user-input-in-system-prompt": [ASI("01")],
|
|
7
|
+
"llm.client-controls-system": [ASI("01")],
|
|
8
|
+
"agent.instructions-unsafe": [ASI("01")],
|
|
9
|
+
"skill.fetches-remote-instructions": [ASI("01"), ASI("04")],
|
|
10
|
+
"mcp.tool-runs-shell": [ASI("02"), ASI("05")],
|
|
11
|
+
"skill.unrestricted-shell": [ASI("02"), ASI("05")],
|
|
12
|
+
"agent.permissions-allow-all": [ASI("02"), ASI("03")],
|
|
13
|
+
"mcp.tool-uses-secret": [ASI("03")],
|
|
14
|
+
"mcp.config-token-over-http": [ASI("03"), ASI("07")],
|
|
15
|
+
"mcp.config-unsafe-server": [ASI("04")],
|
|
16
|
+
"mcp.config-legacy-sse": [ASI("04")],
|
|
17
|
+
"agent.config-runs-remote-code": [ASI("04"), ASI("05")],
|
|
18
|
+
"skill.changed-since-recorded": [ASI("04")],
|
|
19
|
+
"skill.writes-agent-memory": [ASI("06")],
|
|
20
|
+
"mcp.server-binds-all-interfaces": [ASI("07")],
|
|
21
|
+
"llm.unbounded-agent-loop": [ASI("08")],
|
|
22
|
+
"agent.approval-author-alone": [ASI("09")],
|
|
23
|
+
"agent.approval-rule-files-open": [ASI("09")],
|
|
24
|
+
"ai.hides-being-ai": [ASI("09")],
|
|
25
|
+
};
|
package/dist/src/rules/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import { moreRules } from "./more.js";
|
|
|
4
4
|
import { craForExisting, craRules } from "./cra.js";
|
|
5
5
|
import { standardsForExisting, standardsRules } from "./standards.js";
|
|
6
6
|
import { apiForExisting, apiRules } from "./api.js";
|
|
7
|
+
import { agenticForExisting } from "./agentic.js";
|
|
7
8
|
const CODE = [".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs", ".py"];
|
|
8
9
|
// Beta: mapped by us from our own reading of the public texts.
|
|
9
10
|
const DRAFT = { mappedBy: "beta", reviewedAt: "pending" };
|
|
@@ -452,7 +453,7 @@ for (const r of rules)
|
|
|
452
453
|
// OWASP API Security Top 10: one rule of its own, then tags on the rules above.
|
|
453
454
|
rules.push(...apiRules);
|
|
454
455
|
for (const r of rules)
|
|
455
|
-
r.controls.push(...(apiForExisting[r.id] ?? []));
|
|
456
|
+
r.controls.push(...(apiForExisting[r.id] ?? []), ...(agenticForExisting[r.id] ?? []));
|
|
456
457
|
// Measured on 270 findings reviewed one by one from 139 public repositories (0.3.9). These rules were real in fewer than
|
|
457
458
|
// half of their sampled findings, so they are held back unless --all (show: all) is set, and the report says how many.
|
|
458
459
|
// A rule moves back to high confidence when a fresh labelled sample shows it is real in most findings.
|
package/dist/src/rules/more.d.ts
CHANGED
|
@@ -13,6 +13,17 @@ export declare function mcpConfigUnsafe(lines: string[]): Array<{
|
|
|
13
13
|
line: number;
|
|
14
14
|
status: "gap" | "partial";
|
|
15
15
|
}>;
|
|
16
|
+
/** MCP config: a token sent to a server over plain HTTP. Reports the line that holds the token. Pure.
|
|
17
|
+
* shortcut: takes the server list to be at the top of the file; nested one level deeper, all servers count as one entry. */
|
|
18
|
+
export declare function mcpTokenOverHttp(lines: string[]): Array<{
|
|
19
|
+
line: number;
|
|
20
|
+
status: "gap";
|
|
21
|
+
}>;
|
|
22
|
+
/** MCP config: a server reached over the old HTTP+SSE transport. Pure. */
|
|
23
|
+
export declare const mcpLegacySse: (lines: string[]) => Array<{
|
|
24
|
+
line: number;
|
|
25
|
+
status: "partial";
|
|
26
|
+
}>;
|
|
16
27
|
/** Key sizes and work factors below what current guidance accepts. Pure. */
|
|
17
28
|
export declare function weakCryptoParameter(l: string): boolean | "partial";
|
|
18
29
|
/** Android release build that can be debugged: the manifest flag, or `debuggable true` inside the release block of build.gradle. Pure. */
|
package/dist/src/rules/more.js
CHANGED
|
@@ -84,6 +84,23 @@ export function mcpConfigUnsafe(lines) {
|
|
|
84
84
|
});
|
|
85
85
|
return out;
|
|
86
86
|
}
|
|
87
|
+
const MCP_SERVERS = /"(mcpServers|servers|context_servers)"\s*:/;
|
|
88
|
+
const MCP_PLAIN_HTTP = /"(url|serverUrl|endpoint)"\s*:\s*"http:\/\/(?!localhost|127\.0\.0\.1|\[::1\]|0\.0\.0\.0|host\.docker\.internal)/;
|
|
89
|
+
/** MCP config: a token sent to a server over plain HTTP. Reports the line that holds the token. Pure.
|
|
90
|
+
* shortcut: takes the server list to be at the top of the file; nested one level deeper, all servers count as one entry. */
|
|
91
|
+
export function mcpTokenOverHttp(lines) {
|
|
92
|
+
if (!lines.some((l) => MCP_SERVERS.test(l)))
|
|
93
|
+
return [];
|
|
94
|
+
// A server entry sits two braces deep, so a line that starts at depth 2 or less begins a new entry.
|
|
95
|
+
let depth = 0, entry = 0;
|
|
96
|
+
const entryOf = lines.map((l, i) => { if (depth <= 2)
|
|
97
|
+
entry = i; depth += (l.match(/\{/g)?.length ?? 0) - (l.match(/\}/g)?.length ?? 0); return entry; });
|
|
98
|
+
const plain = new Set(lines.flatMap((l, i) => MCP_PLAIN_HTTP.test(l) ? [entryOf[i]] : []));
|
|
99
|
+
return lines.flatMap((l, i) => plain.has(entryOf[i]) && /"(authorization|[\w-]*(token|api[-_]?key|secret)[\w-]*)"\s*:\s*"[^"]|http:\/\/[^"]*[?&](access_token|token|api[-_]?key|key)=/i.test(l) ? [{ line: i + 1, status: "gap" }] : []);
|
|
100
|
+
}
|
|
101
|
+
/** MCP config: a server reached over the old HTTP+SSE transport. Pure. */
|
|
102
|
+
export const mcpLegacySse = (lines) => !lines.some((l) => MCP_SERVERS.test(l)) ? []
|
|
103
|
+
: lines.flatMap((l, i) => /"(type|transport)"\s*:\s*"sse"|"(url|serverUrl|endpoint)"\s*:\s*"sse:\/\//i.test(l) ? [{ line: i + 1, status: "partial" }] : []);
|
|
87
104
|
const DOCKERFILE = /^(Dockerfile|Containerfile)|\.Dockerfile$/i;
|
|
88
105
|
const NATIVE = [".java", ".kt", ".swift", ".go", ".dart"];
|
|
89
106
|
// An IV or nonce that is the same for every message: zero bytes or fixed text. Reusing one with the same key breaks
|
|
@@ -314,6 +331,18 @@ export const moreRules = [
|
|
|
314
331
|
extensions: [".json"], pathMatch: AGENT_CONFIG,
|
|
315
332
|
unseen: "Lintsure can't see whether a lockfile or a private registry pins this package somewhere else.",
|
|
316
333
|
fileTest: mcpConfigUnsafe }),
|
|
334
|
+
rule({ id: "mcp.config-token-over-http", title: "Token sent to an MCP server over plain HTTP", status: "gap", severity: "high", controls: [A04],
|
|
335
|
+
fix: "Change the server address to https. If the token has already been used over http, replace it with a new one.",
|
|
336
|
+
note: "Over plain HTTP the token travels as readable text on every request. Anyone on the network path can copy it and call the server as you (CWE-319).",
|
|
337
|
+
extensions: [".json"], pathMatch: AGENT_CONFIG,
|
|
338
|
+
unseen: "Lintsure can't see whether a tunnel or a private network carries this connection.",
|
|
339
|
+
fileTest: mcpTokenOverHttp }),
|
|
340
|
+
rule({ id: "mcp.config-legacy-sse", title: "MCP server on the old SSE transport", status: "partial", severity: "low", controls: [AST("07", "Update Drift")],
|
|
341
|
+
fix: 'Use the server\'s streamable HTTP address with "type": "http". If the server only offers SSE, update it.',
|
|
342
|
+
note: "The MCP specification replaced the HTTP+SSE transport with streamable HTTP in its 2025-03-26 version and marks the old one as deprecated. Clients are dropping it, and a server that still needs it is often an old build.",
|
|
343
|
+
extensions: [".json"], pathMatch: AGENT_CONFIG,
|
|
344
|
+
unseen: "Lintsure can't see whether this server offers the newer transport.",
|
|
345
|
+
fileTest: mcpLegacySse }),
|
|
317
346
|
// The model reads a tool's description before it decides to call the tool, so text there works as an instruction
|
|
318
347
|
// (tool poisoning, first reported for MCP in 2025). Any string in the server file counts: Python tools use the docstring.
|
|
319
348
|
rule({ id: "mcp.tool-description-poisoned", title: "MCP tool description that gives the agent orders", status: "gap", severity: "high", controls: [LLM01, LLM04],
|
|
@@ -344,6 +373,12 @@ export const moreRules = [
|
|
|
344
373
|
extensions: [".md", ".mdc"], pathMatch: SKILL_FILE,
|
|
345
374
|
unseen: "Lintsure can't tell a skill whose stated job is to manage these files, with the user's agreement, from one that changes them on the quiet.",
|
|
346
375
|
test: writesMemory }),
|
|
376
|
+
// Checked in scan() against .lintsure/skills.json, not line by line: it needs the whole file and the record.
|
|
377
|
+
rule({ id: "skill.changed-since-recorded", title: "Skill file changed since it was last reviewed", status: "partial", severity: "medium", controls: [AST("01", "Malicious Skills"), AST("02", "Supply Chain Compromise")],
|
|
378
|
+
fix: "Read the change (git diff shows it). If it is what you expect, run `lintsure skills --record` to make it the reviewed version. If not, put the file back.",
|
|
379
|
+
note: "A skill is instructions your agent follows with your permissions. A file that differs from the reviewed copy, or was added after it, means the agent may now be following text nobody read (CWE-494).",
|
|
380
|
+
extensions: [],
|
|
381
|
+
unseen: "Lintsure can't see who changed the file or why. It only sees that the file differs from the record in .lintsure/skills.json, and that record is a file an agent could edit too." }),
|
|
347
382
|
rule({ id: "skill.unrestricted-shell", title: "Skill is allowed any shell command", status: "partial", severity: "low", controls: [AST("03", "Over-Privileged Skills"), LLM03],
|
|
348
383
|
fix: "List the commands the skill needs, for example `Bash(npm run test:*)`, and leave the rest to the agent's normal permission prompts.",
|
|
349
384
|
note: "With the whole shell allowed, the skill's other limits mean little: any file can be read or changed and anything can be sent out through a command. One poisoned input to the skill then reaches the whole machine.",
|
package/dist/src/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export type Status = "met" | "partial" | "gap" | "outside";
|
|
2
2
|
export type Severity = "high" | "medium" | "low";
|
|
3
3
|
/** Built-in frameworks. Rule packs can add more, so FrameworkId is open to other strings. */
|
|
4
|
-
export type BuiltinFrameworkId = "gdpr" | "eu-ai-act" | "owasp-top10" | "cra" | "owasp-llm" | "cwe-top25" | "owasp-ast" | "owasp-api";
|
|
4
|
+
export type BuiltinFrameworkId = "gdpr" | "eu-ai-act" | "owasp-top10" | "cra" | "owasp-llm" | "cwe-top25" | "owasp-ast" | "owasp-api" | "owasp-agentic";
|
|
5
5
|
export type FrameworkId = BuiltinFrameworkId | (string & {});
|
|
6
6
|
export interface Control {
|
|
7
7
|
framework: FrameworkId;
|
package/docs/README.md
CHANGED
package/docs/agents.md
CHANGED
package/docs/frameworks.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated from Lintsure 0.3.
|
|
1
|
+
<!-- Generated from Lintsure 0.3.20 by scripts/build-docs.mjs. -->
|
|
2
2
|
# Frameworks
|
|
3
3
|
|
|
4
4
|
## EU AI Act (`eu-ai-act`)
|
|
@@ -12,6 +12,7 @@ Applies to: Anyone who builds an AI system and offers it in the EU (a provider),
|
|
|
12
12
|
- 2026-12-02: New bans on AI that makes non-consensual intimate images or child abuse material. Deadline for older generative systems to mark their output as AI-made.
|
|
13
13
|
- 2027-12-02: High-risk rules apply to uses listed in Annex III (credit, hiring, education and others). Moved later by the 2026 Digital Omnibus.
|
|
14
14
|
- 2028-08-02: High-risk rules apply to AI that is a safety part of products covered by Annex I (machinery, medical devices and others).
|
|
15
|
+
- 2030-08-02: High-risk systems that public authorities already use must meet the rules by now.
|
|
15
16
|
|
|
16
17
|
- Art. 4 AI literacy [outside code]: Take steps so the people who build and use your AI understand it well enough for their role. Softened in 2026 from a strict duty to a duty to support.
|
|
17
18
|
- Art. 5 Banned practices [partly in code]: Some uses are not allowed at all, for example manipulating people in harmful ways, social scoring, reading emotions at work or school, and (from December 2026) making intimate images of real people without consent. Rules: ai.emotion-or-biometric.
|
|
@@ -29,7 +30,7 @@ Applies to: Anyone who builds an AI system and offers it in the EU (a provider),
|
|
|
29
30
|
- Art. 50(2) Mark AI-made content [partly in code]: AI-generated images, audio, video and text should carry a machine-readable mark that they're AI-made. Rules: ai.synthetic-media.
|
|
30
31
|
- Art. 50(4) Label deepfakes [partly in code]: If you publish realistic fake media of people, places or events, say that it's AI-made. Rules: ai.synthetic-media.
|
|
31
32
|
|
|
32
|
-
Our own summary, checked on 2026-
|
|
33
|
+
Our own summary, checked on 2026-12-06. Read the official text for anything you rely on.
|
|
33
34
|
|
|
34
35
|
## GDPR (`gdpr`)
|
|
35
36
|
The EU's privacy law. If you handle data about people in the EU, you need a valid reason for each use, should collect only what you need, keep it safe, tell people what you do, and let them see, fix or delete their data. AI doesn't get special treatment: training on or feeding personal data into a model is still processing.
|
|
@@ -53,7 +54,7 @@ Applies to: Any organization that handles personal data while based in the EU, o
|
|
|
53
54
|
- Art. 35 Impact assessment (DPIA) [outside code]: Before risky processing, such as large-scale profiling or new AI uses on personal data, assess and reduce the risks.
|
|
54
55
|
- Art. 44–49 Transfers outside the EU [partly in code]: Sending personal data outside the EU needs an approved route, such as an adequacy decision or standard contract clauses.
|
|
55
56
|
|
|
56
|
-
Our own summary, checked on 2026-
|
|
57
|
+
Our own summary, checked on 2026-12-06. Read the official text for anything you rely on.
|
|
57
58
|
|
|
58
59
|
## OWASP Top 10:2025 (`owasp-top10`)
|
|
59
60
|
The OWASP Top 10 is a widely used awareness list of the ten most serious kinds of web application security risk, built from real test data and a community survey. It isn't a law or a certification, but customers, security questionnaires and many other standards point to it. The 2025 edition adds software supply chain failures and the mishandling of errors.
|
|
@@ -66,7 +67,7 @@ Applies to: Any team building a web application or API. It's voluntary, but ofte
|
|
|
66
67
|
- A02:2025 (deployed settings) Server, cloud and header configuration in production [outside code]: What is actually running: server and cloud settings, open ports, default accounts, security headers on real responses. These need a scan of the deployed system.
|
|
67
68
|
- A03:2025 Software Supply Chain Failures [partly in code]: The code you didn't write: dependencies, build tools and CI. Versions should be pinned, install scripts shouldn't fetch code, CI actions should be pinned, untrusted pull requests must not run with your secrets, and text from issues or pull requests must never become part of a CI command. Rules: deps.unpinned-version, deps.install-script, agent.config-runs-remote-code, agent.instructions-unsafe, ci.action-unpinned, ci.prt-checkout-head, ci.write-all-permissions, ci.script-injection, update.unverified-download.
|
|
68
69
|
- A03:2025 (known vulnerabilities) Dependencies with known vulnerabilities [outside code]: Whether any dependency version has a published vulnerability, and whether it's maintained. This needs vulnerability advisory data, which Lintsure doesn't download, so use a dependency scanner alongside it.
|
|
69
|
-
- A04:2025 Cryptographic Failures [checked in code]: Protect data with sound cryptography: HTTPS everywhere, certificate checks on, strong password hashing, modern ciphers, unpredictable tokens, signed tokens that are verified, and no keys in code. Rules: crypto.weak-password-hash, crypto.weak-random-token, crypto.weak-cipher, jwt.unverified, transport.plain-http, transport.tls-verify-off, secret.in-source, secret.public-env, mobile.token-in-plain-storage, mobile.cleartext-traffic, jwt.weak-secret, crypto.unsafe-compare.
|
|
70
|
+
- A04:2025 Cryptographic Failures [checked in code]: Protect data with sound cryptography: HTTPS everywhere, certificate checks on, strong password hashing, modern ciphers, unpredictable tokens, signed tokens that are verified, and no keys in code. Rules: mcp.config-token-over-http, crypto.weak-password-hash, crypto.weak-random-token, crypto.weak-cipher, jwt.unverified, transport.plain-http, transport.tls-verify-off, secret.in-source, secret.public-env, mobile.token-in-plain-storage, mobile.cleartext-traffic, jwt.weak-secret, crypto.unsafe-compare.
|
|
70
71
|
- A04:2025 (key management) Key management and encryption at rest [outside code]: How encryption keys are created, stored, rotated and retired, and whether databases and backups are encrypted. These live in your infrastructure, not your code.
|
|
71
72
|
- A05:2025 Injection [checked in code]: Keep data and code apart, so input can't become part of a SQL query, a shell command, a template, HTML on the page or code that gets run. Rules: sql.string-built, cmd.shell-built, code.eval, xss.raw-html, template.user-string, nosql.operator-input.
|
|
72
73
|
- A06:2025 Insecure Design [partly in code]: Security planned in from the start: limits on uploads, only the fields users may change, sensitive data kept out of URLs. Most of this category is about design, not individual lines. Rules: upload.unrestricted, mass-assignment, pii.in-url, mobile.webview-any-origin, html.tabnabbing.
|
|
@@ -80,7 +81,7 @@ Applies to: Any team building a web application or API. It's voluntary, but ofte
|
|
|
80
81
|
- A10:2025 Mishandling of Exceptional Conditions [partly in code]: Errors handled on purpose: none silently ignored, none shown to users in detail, and failures that leave the system closed rather than open. Rules: error.empty-catch, error.stack-to-client, config.debug-on.
|
|
81
82
|
- A10:2025 (behaviour under failure) Safe behaviour when things fail [outside code]: How the app behaves when a database, payment provider or other dependency is slow or down, and whether access checks fail closed. This needs testing under failure.
|
|
82
83
|
|
|
83
|
-
Our own summary, checked on 2026-
|
|
84
|
+
Our own summary, checked on 2026-12-06. Read the official text for anything you rely on.
|
|
84
85
|
|
|
85
86
|
## EU Cyber Resilience Act (`cra`)
|
|
86
87
|
The Cyber Resilience Act sets security rules for software and connected devices sold in the EU. Makers must build products that are secure by default, ship without known exploitable vulnerabilities, fix vulnerabilities with free security updates for the support period, and report actively exploited vulnerabilities quickly. Most products can assess themselves; some categories, such as password managers, VPNs and firewalls, face stricter checks.
|
|
@@ -108,7 +109,7 @@ Applies to: Businesses that make, import or sell software or connected hardware
|
|
|
108
109
|
- Art. 14 Reporting exploited vulnerabilities and severe incidents [outside code]: An actively exploited vulnerability or severe incident must be reported through the EU single reporting platform: early warning within 24 hours, notification within 72 hours, and a final report later. This already applies.
|
|
109
110
|
- Annex V, VII; Art. 30-32 Technical documentation, declaration and CE marking [outside code]: Technical documentation, an EU declaration of conformity and the CE marking, using the right assessment route for the product's category. Documentation is kept for ten years.
|
|
110
111
|
|
|
111
|
-
Our own summary, checked on 2026-
|
|
112
|
+
Our own summary, checked on 2026-12-06. Read the official text for anything you rely on.
|
|
112
113
|
|
|
113
114
|
## OWASP Top 10 for LLM Applications 2026 (`owasp-llm`)
|
|
114
115
|
The ten most serious security risks in apps built on large language models: prompt injection, leaking sensitive data, too much agency, supply chain, poisoned data, runaway usage, misinformation, exposed hidden context, weak vector stores and unsafe use of model output. It's an awareness list, not a law or certification.
|
|
@@ -126,7 +127,7 @@ Applies to: Any team that builds a feature on an AI model: chatbots, assistants,
|
|
|
126
127
|
- LLM09:2026 Vector and Embedding Weaknesses [outside code]: Retrieval stores must keep one user's or customer's documents away from another's, and resist planted content.
|
|
127
128
|
- LLM10:2026 Improper Output Handling [checked in code]: Treat what the model returns as untrusted. Never run it as code, a shell command or SQL, and escape it before showing it as HTML. Rules: llm.output-to-sink.
|
|
128
129
|
|
|
129
|
-
Our own summary, checked on 2026-
|
|
130
|
+
Our own summary, checked on 2026-12-06. Read the official text for anything you rely on.
|
|
130
131
|
|
|
131
132
|
## CWE Top 25 (2025) (`cwe-top25`)
|
|
132
133
|
MITRE's yearly list of the 25 most dangerous software weaknesses, ranked from real vulnerability data. Security teams, scanners and buyers use CWE numbers as a shared language, so mapping findings to them makes reports easy to compare.
|
|
@@ -144,25 +145,25 @@ Applies to: Anyone writing software. It's a reference list, not a law or certifi
|
|
|
144
145
|
- CWE-306 Missing authentication for a critical function [outside code]: Every sensitive endpoint requires a signed-in user. Needs a route-by-route review.
|
|
145
146
|
- CWE-787, 416, 125, 120, 476, 121, 122 Memory safety [outside code]: Buffer and pointer errors in C and C++. Lintsure doesn't check these languages; use a memory-safe language or a dedicated tool.
|
|
146
147
|
|
|
147
|
-
Our own summary, checked on 2026-
|
|
148
|
+
Our own summary, checked on 2026-12-06. Read the official text for anything you rely on.
|
|
148
149
|
|
|
149
150
|
## OWASP Agentic Skills Top 10 (`owasp-ast`)
|
|
150
151
|
Ten risks in the skills, instruction files and tool servers that AI coding agents load: malicious skills, a poisoned supply chain, too many permissions, misleading metadata, instructions fetched at run time, weak isolation, silent updates, weak scanning, no inventory and reuse across platforms. It's a young awareness list, still in public review, not a law or certification.
|
|
151
152
|
|
|
152
153
|
Applies to: Any team whose developers or products use an AI agent that loads skills, instruction files or MCP servers.
|
|
153
154
|
|
|
154
|
-
- AST01 Malicious Skills [partly in code]: A skill can look useful and still tell the agent to hide a step, send secrets out or change its own instructions. Read a skill's text like code before an agent uses it. Rules: agent.instructions-unsafe, skill.writes-agent-memory.
|
|
155
|
+
- AST01 Malicious Skills [partly in code]: A skill can look useful and still tell the agent to hide a step, send secrets out or change its own instructions. Read a skill's text like code before an agent uses it. Rules: agent.instructions-unsafe, skill.writes-agent-memory, skill.changed-since-recorded.
|
|
155
156
|
- AST02 Supply Chain Compromise [partly in code]: Skills, hooks and tool servers come from others. Pin them to a version you have read, and treat config files an agent runs by itself as code. Rules: agent.config-runs-remote-code, mcp.config-unsafe-server.
|
|
156
157
|
- AST03 Over-Privileged Skills [partly in code]: A skill should get only the tools, files and network access its job needs. Open shell access makes every other limit moot. Rules: agent.permissions-allow-all, agent.approval-author-alone, agent.approval-rule-files-open, skill.unrestricted-shell.
|
|
157
158
|
- AST04 Insecure Metadata [partly in code]: A skill's description and front matter are read by the agent too. They must match what the skill does and carry no hidden characters. Rules: agent.instructions-unsafe.
|
|
158
159
|
- AST05 Untrusted External Instructions [partly in code]: A skill that tells the agent to fetch a page and follow it hands control to whoever owns that page tomorrow. Keep the instructions inside the skill, or pin what is fetched. Rules: skill.fetches-remote-instructions.
|
|
159
160
|
- AST06 Weak Isolation [partly in code]: Skills and tool servers should run boxed in: local interfaces only, with sign-in, and limited to the files they declare. Rules: mcp.server-binds-all-interfaces.
|
|
160
|
-
- AST07 Update Drift [partly in code]: A skill or server that updates by itself can change after you approved it. Pin versions and look again on every update. Rules: mcp.config-unsafe-server.
|
|
161
|
+
- AST07 Update Drift [partly in code]: A skill or server that updates by itself can change after you approved it. Pin versions and look again on every update. Rules: mcp.config-unsafe-server, mcp.config-legacy-sse.
|
|
161
162
|
- AST08 Poor Scanning [outside code]: A pattern scanner reads code well and prose badly, and a skill is mostly prose. Use more than one kind of check, and never rely on a scanner that is itself a skill.
|
|
162
163
|
- AST09 No Governance [outside code]: Someone should know which skills are installed, who approved each one and how to remove one fast.
|
|
163
164
|
- AST10 Cross-Platform Reuse [outside code]: A skill moved from one agent to another can lose its limits on the way, because each agent enforces different things. Check it again on each one.
|
|
164
165
|
|
|
165
|
-
Our own summary, checked on 2026-
|
|
166
|
+
Our own summary, checked on 2026-12-06. Read the official text for anything you rely on.
|
|
166
167
|
|
|
167
168
|
## OWASP API Security Top 10 2023 (`owasp-api`)
|
|
168
169
|
The ten most serious security risks in APIs: reaching other people's records, weak sign-in, changing fields you shouldn't, no limits on use, calling functions meant for others, abusing business flows, server-side request forgery, misconfiguration, forgotten API versions and trusting other APIs too much. It's an awareness list, not a law or certification.
|
|
@@ -180,4 +181,22 @@ Applies to: Any team whose product has an API: a backend for a web or mobile app
|
|
|
180
181
|
- API9:2023 Improper Inventory Management [outside code]: Old versions, test hosts and undocumented endpoints stay reachable long after everyone forgot them, usually with weaker protection.
|
|
181
182
|
- API10:2023 Unsafe Consumption of APIs [partly in code]: Data from another company's API is input like any other. Reach it over verified TLS, validate what comes back, and don't follow its redirects blindly. Rules: transport.tls-verify-off, transport.plain-http.
|
|
182
183
|
|
|
183
|
-
Our own summary, checked on 2026-
|
|
184
|
+
Our own summary, checked on 2026-12-06. Read the official text for anything you rely on.
|
|
185
|
+
|
|
186
|
+
## OWASP Top 10 for Agentic Applications 2026 (`owasp-agentic`)
|
|
187
|
+
The ten most serious security risks in software where an AI agent plans and acts by itself: a hijacked goal, misused tools, abused sign-ins, a poisoned supply chain, code run by surprise, poisoned memory, open channels between agents, failures that spread, misplaced human trust and agents that go their own way. It's an awareness list, not a law.
|
|
188
|
+
|
|
189
|
+
Applies to: Any team that builds or runs an AI agent that calls tools, runs code or works with other agents, including coding agents.
|
|
190
|
+
|
|
191
|
+
- ASI01 Agent Goal Hijack [partly in code]: Text an agent reads can change what it sets out to do: a web page, a document, a tool description or another agent's message. Keep outside text away from the instructions, and check the goal again before a risky step. Rules: mcp.tool-description-poisoned, llm.retrieved-text-in-system-prompt, llm.user-input-in-system-prompt, llm.client-controls-system, agent.instructions-unsafe, skill.fetches-remote-instructions.
|
|
192
|
+
- ASI02 Tool Misuse and Exploitation [partly in code]: An agent can use a tool it is allowed to use in a harmful way, such as deleting data or sending it out. Give each tool the narrowest job, and ask a person before anything that can't be undone. Rules: mcp.tool-runs-shell, skill.unrestricted-shell, agent.permissions-allow-all.
|
|
193
|
+
- ASI03 Identity and Privilege Abuse [partly in code]: Agents act with keys and sign-ins that belong to people or services. A stolen or shared one lets an agent do far more than its task. Give each agent its own short-lived access, limited to the task. Rules: mcp.tool-uses-secret, mcp.config-token-over-http, agent.permissions-allow-all.
|
|
194
|
+
- ASI04 Agentic Supply Chain Vulnerabilities [partly in code]: Tools, skills, prompts and other agents are loaded while the agent runs, often from someone else. Pin what you load to a version you have read, and notice when it changes. Rules: mcp.config-unsafe-server, mcp.config-legacy-sse, agent.config-runs-remote-code, skill.changed-since-recorded, skill.fetches-remote-instructions.
|
|
195
|
+
- ASI05 Unexpected Code Execution (RCE) [partly in code]: An agent that writes and runs code, or passes text to a shell, can be talked into running an attacker's code. Run generated code in a sandbox, and never pass model text straight to a shell. Rules: mcp.tool-runs-shell, agent.config-runs-remote-code, skill.unrestricted-shell.
|
|
196
|
+
- ASI06 Memory & Context Poisoning [partly in code]: What an agent stores and reads back later shapes its next decisions. One poisoned note or document keeps steering it long after the attack. Control what gets written to memory and where retrieved text is placed. Rules: skill.writes-agent-memory, llm.retrieved-text-in-system-prompt.
|
|
197
|
+
- ASI07 Insecure Inter-Agent Communication [partly in code]: Messages between agents and tool servers can be read, changed or faked when the channel is open or has no sign-in. Use encrypted connections with sign-in, and don't listen on every network interface. Rules: mcp.server-binds-all-interfaces, mcp.config-token-over-http.
|
|
198
|
+
- ASI08 Cascading Failures [partly in code]: One wrong step can spread through chained agents and tools faster than a person can notice. Put limits on steps, spend and repeated calls, and stop the chain when a check fails. Rules: llm.unbounded-agent-loop.
|
|
199
|
+
- ASI09 Human-Agent Trust Exploitation [partly in code]: People tend to approve what a confident agent proposes. An approval step only works when the person sees what will happen, and when someone other than the agent's own author can say no. Rules: agent.approval-author-alone, agent.approval-rule-files-open, ai.hides-being-ai.
|
|
200
|
+
- ASI10 Rogue Agents [outside code]: An agent that has been taken over, or has drifted from its task, can keep acting inside its permissions while doing harm. This shows in behaviour over time, not in code.
|
|
201
|
+
|
|
202
|
+
Our own summary, checked on 2026-12-06. Read the official text for anything you rely on.
|
package/docs/rules.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<!-- Generated from Lintsure 0.3.
|
|
2
|
-
# Lintsure rules (
|
|
1
|
+
<!-- Generated from Lintsure 0.3.20 by scripts/build-docs.mjs. -->
|
|
2
|
+
# Lintsure rules (119)
|
|
3
3
|
|
|
4
4
|
## pii.logged
|
|
5
5
|
**Personal data written to logs** · status when found: gap · risk: high
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
## ai.hides-being-ai
|
|
138
138
|
**AI told to hide that it is an AI** · status when found: partial · risk: high
|
|
139
139
|
|
|
140
|
-
- Controls: eu-ai-act Art. 50(1) (Transparency for AI interacting with people)
|
|
140
|
+
- Controls: eu-ai-act Art. 50(1) (Transparency for AI interacting with people); owasp-agentic ASI09 (Human-Agent Trust Exploitation)
|
|
141
141
|
- Fix: Remove the instruction and tell users they are talking to an AI.
|
|
142
142
|
- Note: People must be told when they interact with an AI system, unless it is obvious. Marked Partial: role-play wording can be harmless.
|
|
143
143
|
- Real only when: An agent or model will read or run this: the file is where the agent looks, or the call is in code that ships. The text or input is used as written: it is an instruction or a live value, not a quoted example or a warning about one. A person does not see or approve the step before it takes effect.
|
|
@@ -276,7 +276,7 @@
|
|
|
276
276
|
## agent.config-runs-remote-code
|
|
277
277
|
**Agent config downloads and runs code** · status when found: gap · risk: high
|
|
278
278
|
|
|
279
|
-
- Controls: owasp-top10 A03:2025 (Software Supply Chain Failures); owasp-ast AST02 (Supply Chain Compromise)
|
|
279
|
+
- Controls: owasp-top10 A03:2025 (Software Supply Chain Failures); owasp-ast AST02 (Supply Chain Compromise); owasp-agentic ASI04 (Agentic Supply Chain Vulnerabilities); owasp-agentic ASI05 (Unexpected Code Execution (RCE))
|
|
280
280
|
- Fix: Don't download and run scripts from agent hooks, MCP server commands or editor tasks. Pin a reviewed local script or a versioned package instead, and review changes to these files like code.
|
|
281
281
|
- Note: Agents run these commands on their own, often at startup, with your user's permissions. A changed URL or script runs on every machine that opens the repo (CWE-829, CWE-494).
|
|
282
282
|
- Real only when: An agent or model will read or run this: the file is where the agent looks, or the call is in code that ships. The text or input is used as written: it is an instruction or a live value, not a quoted example or a warning about one. A person does not see or approve the step before it takes effect.
|
|
@@ -288,7 +288,7 @@
|
|
|
288
288
|
## agent.instructions-unsafe
|
|
289
289
|
**Agent instructions that override, hide or download and run** · status when found: gap · risk: high
|
|
290
290
|
|
|
291
|
-
- Controls: owasp-top10 A03:2025 (Software Supply Chain Failures); owasp-llm LLM01:2026 (Prompt Injection); owasp-ast AST01 (Malicious Skills); owasp-ast AST04 (Insecure Metadata)
|
|
291
|
+
- Controls: owasp-top10 A03:2025 (Software Supply Chain Failures); owasp-llm LLM01:2026 (Prompt Injection); owasp-ast AST01 (Malicious Skills); owasp-ast AST04 (Insecure Metadata); owasp-agentic ASI01 (Agent Goal Hijack)
|
|
292
292
|
- Fix: Remove the line, or rewrite it so the agent asks the user first. Install tools with a pinned, reviewed command instead of piping a download into a shell, and never tell an agent to keep something from the user.
|
|
293
293
|
- Note: Agents read these files as instructions and act on them with your permissions. Gap when the line overrides earlier instructions, hides something from the user, carries characters a person can't see, or sends secrets out. Partial when it downloads and runs a script, which some setup guides do on purpose (CWE-829, OWASP LLM01).
|
|
294
294
|
- Real only when: The file is one an agent reads as its own instructions. The line tells the agent to drop earlier instructions, hide something from the user, send secrets out, or download and run a script. It is written as an instruction, not quoted as an example of an attack.
|
|
@@ -300,7 +300,7 @@
|
|
|
300
300
|
## agent.permissions-allow-all
|
|
301
301
|
**Agent settings that skip every permission prompt** · status when found: gap · risk: high
|
|
302
302
|
|
|
303
|
-
- Controls: owasp-top10 A02:2025 (Security Misconfiguration); owasp-llm LLM03:2026 (Excessive Agency); owasp-ast AST03 (Over-Privileged Skills)
|
|
303
|
+
- Controls: owasp-top10 A02:2025 (Security Misconfiguration); owasp-llm LLM03:2026 (Excessive Agency); owasp-ast AST03 (Over-Privileged Skills); owasp-agentic ASI02 (Tool Misuse and Exploitation); owasp-agentic ASI03 (Identity and Privilege Abuse)
|
|
304
304
|
- Fix: Remove the bypass from the shared project file. Allow the few commands you trust by name (for example Bash(npm test)), and keep wider permissions in your own local settings, not in the repo.
|
|
305
305
|
- Note: Committed agent settings apply to everyone who opens the repo with that agent. Skipping prompts or allowing every shell command lets a bad instruction, a poisoned file or a mistake run without a person seeing it (CWE-250, OWASP LLM03 Excessive Agency).
|
|
306
306
|
- Real only when: An agent or model will read or run this: the file is where the agent looks, or the call is in code that ships. The text or input is used as written: it is an instruction or a live value, not a quoted example or a warning about one. A person does not see or approve the step before it takes effect.
|
|
@@ -311,7 +311,7 @@
|
|
|
311
311
|
## agent.approval-author-alone
|
|
312
312
|
**Approval policy asks for nobody but the author** · status when found: partial · risk: high
|
|
313
313
|
|
|
314
|
-
- Controls: owasp-top10 A02:2025 (Security Misconfiguration); owasp-llm LLM03:2026 (Excessive Agency); owasp-ast AST03 (Over-Privileged Skills)
|
|
314
|
+
- Controls: owasp-top10 A02:2025 (Security Misconfiguration); owasp-llm LLM03:2026 (Excessive Agency); owasp-ast AST03 (Over-Privileged Skills); owasp-agentic ASI09 (Human-Agent Trust Exploitation)
|
|
315
315
|
- Fix: Ask for a person who isn't the author on this path: seats: [{ count: 1, from: [humans, "!pr/authors"] }], or raise seats to 2. Keep the rule as it is only for paths where you have decided the author alone is enough, and say so in its purpose.
|
|
316
316
|
- Note: The author of a pull request can fill one seat, so seats: 1 asks for nobody else, and seats: 0 asks for no person at all. Where Claude also approves, a branch rule that needs one approval is met by Claude's, and with auto-merge on nobody has to act (CWE-284, OWASP LLM03 Excessive Agency).
|
|
317
317
|
- Real only when: An agent or model will read or run this: the file is where the agent looks, or the call is in code that ships. The text or input is used as written: it is an instruction or a live value, not a quoted example or a warning about one. A person does not see or approve the step before it takes effect.
|
|
@@ -323,7 +323,7 @@
|
|
|
323
323
|
## agent.approval-rule-files-open
|
|
324
324
|
**Approval policy has no stricter rule for the files that set the rules** · status when found: partial · risk: medium
|
|
325
325
|
|
|
326
|
-
- Controls: owasp-top10 A02:2025 (Security Misconfiguration); owasp-llm LLM03:2026 (Excessive Agency); owasp-ast AST03 (Over-Privileged Skills)
|
|
326
|
+
- Controls: owasp-top10 A02:2025 (Security Misconfiguration); owasp-llm LLM03:2026 (Excessive Agency); owasp-ast AST03 (Over-Privileged Skills); owasp-agentic ASI09 (Human-Agent Trust Exploitation)
|
|
327
327
|
- Fix: Add a rule for the files that steer agents and reviews, for example paths: ["**/.claude/**", "**/CLAUDE.md", "**/AGENTS.md", ".mcp.json", ".github/**"] with nested: inherit and verdict: { claude: comments, seats: [{ count: 1, from: [humans, "!pr/authors"] }] }.
|
|
328
328
|
- Note: This policy has an easy path, and no stricter rule names the agent's instructions, its settings or CI. The policy file, a root REVIEW.md and CODEOWNERS always need a person; CLAUDE.md, AGENTS.md, .mcp.json, the rest of .claude and .github do not unless a rule says so. A change there changes what every later review checks (CWE-284).
|
|
329
329
|
- Real only when: An agent or model will read or run this: the file is where the agent looks, or the call is in code that ships. The text or input is used as written: it is an instruction or a live value, not a quoted example or a warning about one. A person does not see or approve the step before it takes effect.
|
|
@@ -732,7 +732,7 @@
|
|
|
732
732
|
## mcp.config-unsafe-server
|
|
733
733
|
**MCP server run from a moving version or over plain HTTP** · status when found: partial · risk: medium
|
|
734
734
|
|
|
735
|
-
- Controls: owasp-llm LLM04:2026 (Supply Chain); owasp-top10 A08:2025 (Software or Data Integrity Failures); owasp-ast AST02 (Supply Chain Compromise); owasp-ast AST07 (Update Drift)
|
|
735
|
+
- Controls: owasp-llm LLM04:2026 (Supply Chain); owasp-top10 A08:2025 (Software or Data Integrity Failures); owasp-ast AST02 (Supply Chain Compromise); owasp-ast AST07 (Update Drift); owasp-agentic ASI04 (Agentic Supply Chain Vulnerabilities)
|
|
736
736
|
- Fix: Pin the server to an exact version you have looked at, for example some-server@1.4.2, and update it on purpose. Use https for a remote server.
|
|
737
737
|
- Note: An agent trusts the tools this server offers. With no version, or @latest, the next start can load different code and different tool descriptions than the ones you approved. Over plain HTTP anyone on the network path can change them (OWASP LLM04, CWE-829).
|
|
738
738
|
- Real only when: An agent or model will read or run this: the file is where the agent looks, or the call is in code that ships. The text or input is used as written: it is an instruction or a live value, not a quoted example or a warning about one. A person does not see or approve the step before it takes effect.
|
|
@@ -741,10 +741,33 @@
|
|
|
741
741
|
- When Partial, Lintsure can't see: Lintsure can't see whether a lockfile or a private registry pins this package somewhere else.
|
|
742
742
|
- Page: https://lintsure.com/rules/mcp-config-unsafe-server
|
|
743
743
|
|
|
744
|
+
## mcp.config-token-over-http
|
|
745
|
+
**Token sent to an MCP server over plain HTTP** · status when found: gap · risk: high
|
|
746
|
+
|
|
747
|
+
- Controls: owasp-top10 A04:2025 (Cryptographic Failures); owasp-agentic ASI03 (Identity and Privilege Abuse); owasp-agentic ASI07 (Insecure Inter-Agent Communication)
|
|
748
|
+
- Fix: Change the server address to https. If the token has already been used over http, replace it with a new one.
|
|
749
|
+
- Note: Over plain HTTP the token travels as readable text on every request. Anyone on the network path can copy it and call the server as you (CWE-319).
|
|
750
|
+
- Real only when: An agent or model will read or run this: the file is where the agent looks, or the call is in code that ships. The text or input is used as written: it is an instruction or a live value, not a quoted example or a warning about one. A person does not see or approve the step before it takes effect.
|
|
751
|
+
- Not a problem when: The file is a detector, a test set or documentation that lists these patterns to catch or explain them. It is the stated job of the skill or tool, and the user is asked before it happens. A limit set elsewhere applies: the agent's own permission prompts, an output cap, a sandbox.
|
|
752
|
+
- In other standards: https://www.opencre.org/node/standard/CWE/sectionid/319
|
|
753
|
+
- When Partial, Lintsure can't see: Lintsure can't see whether a tunnel or a private network carries this connection.
|
|
754
|
+
- Page: https://lintsure.com/rules/mcp-config-token-over-http
|
|
755
|
+
|
|
756
|
+
## mcp.config-legacy-sse
|
|
757
|
+
**MCP server on the old SSE transport** · status when found: partial · risk: low
|
|
758
|
+
|
|
759
|
+
- Controls: owasp-ast AST07 (Update Drift); owasp-agentic ASI04 (Agentic Supply Chain Vulnerabilities)
|
|
760
|
+
- Fix: Use the server's streamable HTTP address with "type": "http". If the server only offers SSE, update it.
|
|
761
|
+
- Note: The MCP specification replaced the HTTP+SSE transport with streamable HTTP in its 2025-03-26 version and marks the old one as deprecated. Clients are dropping it, and a server that still needs it is often an old build.
|
|
762
|
+
- Real only when: An agent or model will read or run this: the file is where the agent looks, or the call is in code that ships. The text or input is used as written: it is an instruction or a live value, not a quoted example or a warning about one. A person does not see or approve the step before it takes effect.
|
|
763
|
+
- Not a problem when: The file is a detector, a test set or documentation that lists these patterns to catch or explain them. It is the stated job of the skill or tool, and the user is asked before it happens. A limit set elsewhere applies: the agent's own permission prompts, an output cap, a sandbox.
|
|
764
|
+
- When Partial, Lintsure can't see: Lintsure can't see whether this server offers the newer transport.
|
|
765
|
+
- Page: https://lintsure.com/rules/mcp-config-legacy-sse
|
|
766
|
+
|
|
744
767
|
## mcp.tool-description-poisoned
|
|
745
768
|
**MCP tool description that gives the agent orders** · status when found: gap · risk: high
|
|
746
769
|
|
|
747
|
-
- Controls: owasp-llm LLM01:2026 (Prompt Injection); owasp-llm LLM04:2026 (Supply Chain)
|
|
770
|
+
- Controls: owasp-llm LLM01:2026 (Prompt Injection); owasp-llm LLM04:2026 (Supply Chain); owasp-agentic ASI01 (Agent Goal Hijack)
|
|
748
771
|
- Fix: Rewrite the description so it only says what the tool does and what it takes. Remove anything that tells the agent to ignore instructions, keep something from the user or read other files, and delete any invisible characters.
|
|
749
772
|
- Note: An agent reads tool descriptions as part of its instructions. A description that says to hide a step, ignore earlier rules or read key files can take over every agent that connects to this server (OWASP LLM01, CWE-1427).
|
|
750
773
|
- Real only when: An agent or model will read or run this: the file is where the agent looks, or the call is in code that ships. The text or input is used as written: it is an instruction or a live value, not a quoted example or a warning about one. A person does not see or approve the step before it takes effect.
|
|
@@ -756,7 +779,7 @@
|
|
|
756
779
|
## skill.fetches-remote-instructions
|
|
757
780
|
**Skill tells the agent to follow a page on the internet** · status when found: partial · risk: medium
|
|
758
781
|
|
|
759
|
-
- Controls: owasp-ast AST05 (Untrusted External Instructions); owasp-llm LLM01:2026 (Prompt Injection)
|
|
782
|
+
- Controls: owasp-ast AST05 (Untrusted External Instructions); owasp-llm LLM01:2026 (Prompt Injection); owasp-agentic ASI01 (Agent Goal Hijack); owasp-agentic ASI04 (Agentic Supply Chain Vulnerabilities)
|
|
760
783
|
- Fix: Put the steps in the skill itself, or keep a reviewed copy in the repo and point to that. If the page must be fetched, tell the agent to treat it as reference text and to ask before acting on it.
|
|
761
784
|
- Note: The skill was reviewed once, but the page can change at any time, and whoever controls it then decides what the agent does with your permissions (CWE-829).
|
|
762
785
|
- Real only when: An agent or model will read or run this: the file is where the agent looks, or the call is in code that ships. The text or input is used as written: it is an instruction or a live value, not a quoted example or a warning about one. A person does not see or approve the step before it takes effect.
|
|
@@ -768,7 +791,7 @@
|
|
|
768
791
|
## skill.writes-agent-memory
|
|
769
792
|
**Skill changes the agent's own instructions or settings** · status when found: partial · risk: medium
|
|
770
793
|
|
|
771
|
-
- Controls: owasp-ast AST01 (Malicious Skills); owasp-ast AST03 (Over-Privileged Skills)
|
|
794
|
+
- Controls: owasp-ast AST01 (Malicious Skills); owasp-ast AST03 (Over-Privileged Skills); owasp-agentic ASI06 (Memory & Context Poisoning)
|
|
772
795
|
- Fix: Have the skill show the change and ask the user before writing to these files. If writing them is not the skill's stated job, remove the line.
|
|
773
796
|
- Note: AGENTS.md, CLAUDE.md, memory files and agent settings are read at the start of every later session. A skill that writes to them keeps its influence after it has finished, and can loosen limits for everything that follows.
|
|
774
797
|
- Real only when: An agent or model will read or run this: the file is where the agent looks, or the call is in code that ships. The text or input is used as written: it is an instruction or a live value, not a quoted example or a warning about one. A person does not see or approve the step before it takes effect.
|
|
@@ -776,10 +799,22 @@
|
|
|
776
799
|
- When Partial, Lintsure can't see: Lintsure can't tell a skill whose stated job is to manage these files, with the user's agreement, from one that changes them on the quiet.
|
|
777
800
|
- Page: https://lintsure.com/rules/skill-writes-agent-memory
|
|
778
801
|
|
|
802
|
+
## skill.changed-since-recorded
|
|
803
|
+
**Skill file changed since it was last reviewed** · status when found: partial · risk: medium
|
|
804
|
+
|
|
805
|
+
- Controls: owasp-ast AST01 (Malicious Skills); owasp-ast AST02 (Supply Chain Compromise); owasp-agentic ASI04 (Agentic Supply Chain Vulnerabilities)
|
|
806
|
+
- Fix: Read the change (git diff shows it). If it is what you expect, run `lintsure skills --record` to make it the reviewed version. If not, put the file back.
|
|
807
|
+
- Note: A skill is instructions your agent follows with your permissions. A file that differs from the reviewed copy, or was added after it, means the agent may now be following text nobody read (CWE-494).
|
|
808
|
+
- Real only when: An agent or model will read or run this: the file is where the agent looks, or the call is in code that ships. The text or input is used as written: it is an instruction or a live value, not a quoted example or a warning about one. A person does not see or approve the step before it takes effect.
|
|
809
|
+
- Not a problem when: The file is a detector, a test set or documentation that lists these patterns to catch or explain them. It is the stated job of the skill or tool, and the user is asked before it happens. A limit set elsewhere applies: the agent's own permission prompts, an output cap, a sandbox.
|
|
810
|
+
- In other standards: https://www.opencre.org/node/standard/CWE/sectionid/494
|
|
811
|
+
- When Partial, Lintsure can't see: Lintsure can't see who changed the file or why. It only sees that the file differs from the record in .lintsure/skills.json, and that record is a file an agent could edit too.
|
|
812
|
+
- Page: https://lintsure.com/rules/skill-changed-since-recorded
|
|
813
|
+
|
|
779
814
|
## skill.unrestricted-shell
|
|
780
815
|
**Skill is allowed any shell command** · status when found: partial · risk: low
|
|
781
816
|
|
|
782
|
-
- Controls: owasp-ast AST03 (Over-Privileged Skills); owasp-llm LLM03:2026 (Excessive Agency)
|
|
817
|
+
- Controls: owasp-ast AST03 (Over-Privileged Skills); owasp-llm LLM03:2026 (Excessive Agency); owasp-agentic ASI02 (Tool Misuse and Exploitation); owasp-agentic ASI05 (Unexpected Code Execution (RCE))
|
|
783
818
|
- Fix: List the commands the skill needs, for example `Bash(npm run test:*)`, and leave the rest to the agent's normal permission prompts.
|
|
784
819
|
- Note: With the whole shell allowed, the skill's other limits mean little: any file can be read or changed and anything can be sent out through a command. One poisoned input to the skill then reaches the whole machine.
|
|
785
820
|
- Real only when: An agent or model will read or run this: the file is where the agent looks, or the call is in code that ships. The text or input is used as written: it is an instruction or a live value, not a quoted example or a warning about one. A person does not see or approve the step before it takes effect.
|
|
@@ -790,7 +825,7 @@
|
|
|
790
825
|
## mcp.server-binds-all-interfaces
|
|
791
826
|
**MCP server listens on every network interface** · status when found: partial · risk: medium
|
|
792
827
|
|
|
793
|
-
- Controls: owasp-ast AST06 (Weak Isolation); owasp-top10 A02:2025 (Security Misconfiguration)
|
|
828
|
+
- Controls: owasp-ast AST06 (Weak Isolation); owasp-top10 A02:2025 (Security Misconfiguration); owasp-agentic ASI07 (Insecure Inter-Agent Communication)
|
|
794
829
|
- Fix: Listen on 127.0.0.1 unless other machines must reach the server. If they must, require sign-in on every request and put it behind a firewall.
|
|
795
830
|
- Note: An agent's tool server usually runs on a developer's machine. On 0.0.0.0, anyone on the same network can call its tools, which often read files and run commands (CWE-1327).
|
|
796
831
|
- Real only when: An agent or model will read or run this: the file is where the agent looks, or the call is in code that ships. The text or input is used as written: it is an instruction or a live value, not a quoted example or a warning about one. A person does not see or approve the step before it takes effect.
|
|
@@ -802,7 +837,7 @@
|
|
|
802
837
|
## mcp.tool-runs-shell
|
|
803
838
|
**MCP tool that runs shell commands** · status when found: partial · risk: high
|
|
804
839
|
|
|
805
|
-
- Controls: owasp-llm LLM03:2026 (Excessive Agency); owasp-top10 A06:2025 (Insecure Design)
|
|
840
|
+
- Controls: owasp-llm LLM03:2026 (Excessive Agency); owasp-top10 A06:2025 (Insecure Design); owasp-agentic ASI02 (Tool Misuse and Exploitation); owasp-agentic ASI05 (Unexpected Code Execution (RCE))
|
|
806
841
|
- Fix: Run a fixed program with execFile and an argument list, never a command string. Check every argument against an allow-list, and ask the user before anything that changes files or systems.
|
|
807
842
|
- Note: The agent decides what to pass to this tool, and anything it reads (a web page, an issue, a file) can steer it. If tool input reaches the command, a prompt injection becomes a shell on this machine (CWE-78).
|
|
808
843
|
- Real only when: An agent or model will read or run this: the file is where the agent looks, or the call is in code that ships. The text or input is used as written: it is an instruction or a live value, not a quoted example or a warning about one. A person does not see or approve the step before it takes effect.
|
|
@@ -814,7 +849,7 @@
|
|
|
814
849
|
## mcp.tool-uses-secret
|
|
815
850
|
**MCP server reads a credential every tool shares** · status when found: partial · risk: low · medium confidence (shown with --all)
|
|
816
851
|
|
|
817
|
-
- Controls: owasp-llm LLM03:2026 (Excessive Agency); owasp-top10 A01:2025 (Broken Access Control)
|
|
852
|
+
- Controls: owasp-llm LLM03:2026 (Excessive Agency); owasp-top10 A01:2025 (Broken Access Control); owasp-agentic ASI03 (Identity and Privilege Abuse)
|
|
818
853
|
- Fix: Give the server a token with only the access its tools need, read-only where it can be. Split tools that write into a separate server or token.
|
|
819
854
|
- Note: Every tool in this server acts with this credential's full access, so the riskiest tool sets the blast radius for all of them. A separate key name doesn't narrow anything if the key itself can do more.
|
|
820
855
|
- Real only when: An agent or model will read or run this: the file is where the agent looks, or the call is in code that ships. The text or input is used as written: it is an instruction or a live value, not a quoted example or a warning about one. A person does not see or approve the step before it takes effect.
|
|
@@ -1153,7 +1188,7 @@
|
|
|
1153
1188
|
## llm.user-input-in-system-prompt
|
|
1154
1189
|
**User text placed inside the AI's system instructions** · status when found: partial · risk: high
|
|
1155
1190
|
|
|
1156
|
-
- Controls: owasp-llm LLM01:2026 (Prompt Injection); owasp-llm LLM08:2026 (Hidden Context Exposure)
|
|
1191
|
+
- Controls: owasp-llm LLM01:2026 (Prompt Injection); owasp-llm LLM08:2026 (Hidden Context Exposure); owasp-agentic ASI01 (Agent Goal Hijack)
|
|
1157
1192
|
- Fix: Keep the system prompt fixed. Send what the user typed as a separate user message, and never put it inside the system instructions.
|
|
1158
1193
|
- Note: Text in the system prompt is treated as the app's own instructions. If user text goes there, a user can rewrite the rules the AI follows (prompt injection). Marked Partial: the inserted value may be safe text your app controls.
|
|
1159
1194
|
- Real only when: Text a user or an outside document supplies is placed in the system or developer message. The model can call tools or its answer is acted on, so changed instructions have an effect. Nothing separates the outside text from the instructions or strips instruction-like content.
|
|
@@ -1163,7 +1198,7 @@
|
|
|
1163
1198
|
## llm.retrieved-text-in-system-prompt
|
|
1164
1199
|
**Retrieved or stored text placed inside the AI's system instructions** · status when found: partial · risk: medium
|
|
1165
1200
|
|
|
1166
|
-
- Controls: owasp-llm LLM01:2026 (Prompt Injection)
|
|
1201
|
+
- Controls: owasp-llm LLM01:2026 (Prompt Injection); owasp-agentic ASI01 (Agent Goal Hijack); owasp-agentic ASI06 (Memory & Context Poisoning)
|
|
1167
1202
|
- Fix: Keep the system prompt fixed. Pass retrieved documents, search results and memories as a separate message, marked as reference material, and tell the model not to follow instructions found in them.
|
|
1168
1203
|
- Note: A web page, an uploaded file or a saved memory can contain a line written for the model. In the system prompt it carries the app's authority, so whoever wrote that text can steer the AI (OWASP LLM01). Marked Partial: the source may be one only your team writes.
|
|
1169
1204
|
- Real only when: An agent or model will read or run this: the file is where the agent looks, or the call is in code that ships. The text or input is used as written: it is an instruction or a live value, not a quoted example or a warning about one. A person does not see or approve the step before it takes effect.
|
|
@@ -1185,7 +1220,7 @@
|
|
|
1185
1220
|
## llm.unbounded-agent-loop
|
|
1186
1221
|
**AI agent loop with no real step limit** · status when found: gap · risk: medium
|
|
1187
1222
|
|
|
1188
|
-
- Controls: owasp-llm LLM06:2026 (Unbounded Consumption); owasp-api API4:2023 (Unrestricted Resource Consumption)
|
|
1223
|
+
- Controls: owasp-llm LLM06:2026 (Unbounded Consumption); owasp-api API4:2023 (Unrestricted Resource Consumption); owasp-agentic ASI08 (Cascading Failures)
|
|
1189
1224
|
- Fix: Stop the loop after a small number of steps, for example stopWhen: stepCountIs(10), and set maxOutputTokens.
|
|
1190
1225
|
- Note: Each step is another paid model call and maybe another tool run. With no limit, one request, or one prompt-injected document, can keep the agent going until something times out.
|
|
1191
1226
|
- Real only when: An agent or model will read or run this: the file is where the agent looks, or the call is in code that ships. The text or input is used as written: it is an instruction or a live value, not a quoted example or a warning about one. A person does not see or approve the step before it takes effect.
|
|
@@ -1195,7 +1230,7 @@
|
|
|
1195
1230
|
## llm.client-controls-system
|
|
1196
1231
|
**The browser chooses the AI's system instructions** · status when found: gap · risk: high
|
|
1197
1232
|
|
|
1198
|
-
- Controls: owasp-llm LLM01:2026 (Prompt Injection)
|
|
1233
|
+
- Controls: owasp-llm LLM01:2026 (Prompt Injection); owasp-agentic ASI01 (Agent Goal Hijack)
|
|
1199
1234
|
- Fix: Build the system prompt on the server. Take only the user's messages from the request, and ignore any system text it sends.
|
|
1200
1235
|
- Note: Whoever calls the route can rewrite the rules the AI follows, including what it may say or which tools it may use (prompt injection, OWASP LLM01).
|
|
1201
1236
|
- Real only when: An agent or model will read or run this: the file is where the agent looks, or the call is in code that ships. The text or input is used as written: it is an instruction or a live value, not a quoted example or a warning about one. A person does not see or approve the step before it takes effect.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lintsure/core",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.20",
|
|
4
4
|
"description": "Lintsure engine: rules, framework knowledge and reports for readiness checks of AI-written code. Not an audit or legal advice.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|