@lintsure/core 0.3.4 → 0.3.5
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/index.d.ts +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/knowledge/more.js +22 -22
- package/dist/src/rules/standards.js +6 -6
- package/package.json +2 -2
package/dist/src/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export * from "./guidance.js";
|
|
|
12
12
|
export { toAssessmentHtml } from "./assessment.js";
|
|
13
13
|
export * from "./knowledge/index.js";
|
|
14
14
|
export { loadPacks, registerPack, type Pack } from "./packs.js";
|
|
15
|
-
export declare const RULES_VERSION = "0.3.
|
|
15
|
+
export declare const RULES_VERSION = "0.3.5";
|
|
16
16
|
/** Shown with every result, in every interface. Lintsure prepares; people decide. */
|
|
17
17
|
export declare const DISCLAIMER: string;
|
|
18
18
|
/** What a report must never be read as. Used in the report and by the MCP server. */
|
package/dist/src/index.js
CHANGED
|
@@ -19,7 +19,7 @@ export { toAssessmentHtml } from "./assessment.js";
|
|
|
19
19
|
export * from "./knowledge/index.js";
|
|
20
20
|
export { loadPacks, registerPack } from "./packs.js";
|
|
21
21
|
import { loadPacks } from "./packs.js";
|
|
22
|
-
export const RULES_VERSION = "0.3.
|
|
22
|
+
export const RULES_VERSION = "0.3.5";
|
|
23
23
|
/** Shown with every result, in every interface. Lintsure prepares; people decide. */
|
|
24
24
|
export const DISCLAIMER = "Lintsure is a readiness tool, not an audit, a certification or legal advice. " +
|
|
25
25
|
"Its rules reflect our reading of the publicly available text of each framework, and they check code only. " +
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Own-words summaries. OWASP texts are CC BY-SA 4.0: we reference IDs and names only.
|
|
2
2
|
// Not affiliated with or endorsed by OWASP or MITRE.
|
|
3
3
|
export const owaspLlm = {
|
|
4
|
-
id: "owasp-llm", name: "OWASP Top 10 for LLM Applications
|
|
5
|
-
summary: "The ten most serious security risks in apps built on large language models: prompt injection, leaking sensitive data, supply chain, poisoned data,
|
|
4
|
+
id: "owasp-llm", name: "OWASP Top 10 for LLM Applications 2026", kind: "standard",
|
|
5
|
+
summary: "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.",
|
|
6
6
|
whoItAppliesTo: "Any team that builds a feature on an AI model: chatbots, assistants, agents, retrieval (RAG) and AI features inside other apps.",
|
|
7
7
|
applies(p) {
|
|
8
8
|
if (p.usesAI && (p.generativeAI || p.interactsWithPeople))
|
|
@@ -10,36 +10,36 @@ export const owaspLlm = {
|
|
|
10
10
|
return null;
|
|
11
11
|
},
|
|
12
12
|
obligations: [
|
|
13
|
-
{ ref: "LLM01:
|
|
13
|
+
{ ref: "LLM01:2026", title: "Prompt Injection", inCode: "partly", rules: ["llm.user-input-in-system-prompt"],
|
|
14
14
|
plain: "User text, web pages or files can carry instructions that change what the model does. Keep instructions and user content apart, and limit what the model can do.",
|
|
15
15
|
evidence: "How prompts are built, and tests with hostile input." },
|
|
16
|
-
{ ref: "LLM02:
|
|
16
|
+
{ ref: "LLM02:2026", title: "Sensitive Information Disclosure", inCode: "partly", rules: ["secret.in-source", "secret.public-env", "pii.logged", "log.secret"],
|
|
17
17
|
plain: "Keys, personal data and internal details must not reach the model, its logs or its answers unless they're meant to.",
|
|
18
18
|
evidence: "What data is sent to the model provider, and the provider's data retention terms." },
|
|
19
|
-
{ ref: "LLM03:
|
|
19
|
+
{ ref: "LLM03:2026", title: "Excessive Agency", inCode: "no",
|
|
20
|
+
plain: "Tools and permissions given to an agent should be the minimum it needs, with a person approving anything risky.",
|
|
21
|
+
evidence: "A list of the tools each agent can call and which need approval." },
|
|
22
|
+
{ ref: "LLM04:2026", title: "Supply Chain", inCode: "partly", rules: ["deps.unpinned-version", "deps.install-script"],
|
|
20
23
|
plain: "Models, datasets, plugins and packages come from others. Pin and check them like any dependency.",
|
|
21
24
|
evidence: "Where each model and dataset comes from, and its licence." },
|
|
22
|
-
{ ref: "
|
|
25
|
+
{ ref: "LLM05:2026", title: "Data and Model Poisoning", inCode: "no",
|
|
23
26
|
plain: "Training, fine-tuning or retrieval data can be tampered with to change the model's behaviour.",
|
|
24
27
|
evidence: "Data sources, who can change them, and checks on new data." },
|
|
25
|
-
{ ref: "
|
|
26
|
-
plain: "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.",
|
|
27
|
-
evidence: "How model output is validated before use." },
|
|
28
|
-
{ ref: "LLM06:2025", title: "Excessive Agency", inCode: "no",
|
|
29
|
-
plain: "Tools and permissions given to an agent should be the minimum it needs, with a person approving anything risky.",
|
|
30
|
-
evidence: "A list of the tools each agent can call and which need approval." },
|
|
31
|
-
{ ref: "LLM07:2025", title: "System Prompt Leakage", inCode: "partly", rules: ["llm.user-input-in-system-prompt"],
|
|
32
|
-
plain: "Assume users can read the system prompt. Don't put secrets or access rules in it, and don't mix user text into it.",
|
|
33
|
-
evidence: "System prompts reviewed for secrets and access logic." },
|
|
34
|
-
{ ref: "LLM08:2025", title: "Vector and Embedding Weaknesses", inCode: "no",
|
|
35
|
-
plain: "Retrieval stores must keep one user's or customer's documents away from another's, and resist planted content.",
|
|
36
|
-
evidence: "Access rules on the vector store and tests across two accounts." },
|
|
37
|
-
{ ref: "LLM09:2025", title: "Misinformation", inCode: "no",
|
|
38
|
-
plain: "Models state wrong things confidently. Show sources, say it's AI and keep a person in the loop where it matters.",
|
|
39
|
-
evidence: "How answers are checked and how users are told the limits." },
|
|
40
|
-
{ ref: "LLM10:2025", title: "Unbounded Consumption", inCode: "partly", rules: ["llm.no-output-limit", "ai.call-not-logged"],
|
|
28
|
+
{ ref: "LLM06:2026", title: "Unbounded Consumption", inCode: "partly", rules: ["llm.no-output-limit", "ai.call-not-logged"],
|
|
41
29
|
plain: "Limit output size, request rate and cost per user, so one person can't run up a bill or take the service down.",
|
|
42
30
|
evidence: "Rate limits, spending alerts and usage monitoring." },
|
|
31
|
+
{ ref: "LLM07:2026", title: "Misinformation", inCode: "no",
|
|
32
|
+
plain: "Models state wrong things confidently. Show sources, say it's AI and keep a person in the loop where it matters.",
|
|
33
|
+
evidence: "How answers are checked and how users are told the limits." },
|
|
34
|
+
{ ref: "LLM08:2026", title: "Hidden Context Exposure", inCode: "partly", rules: ["llm.user-input-in-system-prompt"],
|
|
35
|
+
plain: "Assume users can read anything in the model's context: system prompt, retrieved documents, tool results and memory. Don't put secrets or access rules there, and don't mix user text into instructions.",
|
|
36
|
+
evidence: "System prompts and other context sources reviewed for secrets and access logic." },
|
|
37
|
+
{ ref: "LLM09:2026", title: "Vector and Embedding Weaknesses", inCode: "no",
|
|
38
|
+
plain: "Retrieval stores must keep one user's or customer's documents away from another's, and resist planted content.",
|
|
39
|
+
evidence: "Access rules on the vector store and tests across two accounts." },
|
|
40
|
+
{ ref: "LLM10:2026", title: "Improper Output Handling", inCode: "yes", rules: ["llm.output-to-sink"],
|
|
41
|
+
plain: "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.",
|
|
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
45
|
checkedOn: "2026-11-09",
|
|
@@ -3,14 +3,14 @@ const DRAFT = { mappedBy: "beta", reviewedAt: "pending" };
|
|
|
3
3
|
const c = (framework) => (id, title) => ({ framework, id, title });
|
|
4
4
|
const LLM = c("owasp-llm"), CWE = c("cwe-top25");
|
|
5
5
|
const W = (n, title) => CWE(`CWE-${n}`, title);
|
|
6
|
-
const LLM01 = LLM("LLM01:
|
|
6
|
+
const LLM01 = LLM("LLM01:2026", "Prompt Injection"), LLM02 = LLM("LLM02:2026", "Sensitive Information Disclosure"), LLM04 = LLM("LLM04:2026", "Supply Chain"), LLM10 = LLM("LLM10:2026", "Improper Output Handling"), LLM08 = LLM("LLM08:2026", "Hidden Context Exposure"), LLM06 = LLM("LLM06:2026", "Unbounded Consumption");
|
|
7
7
|
const GDPR32 = { framework: "gdpr", id: "Art. 32", title: "Security of processing" };
|
|
8
8
|
const OW = (n, title) => ({ framework: "owasp-top10", id: `A${n}:2025`, title });
|
|
9
9
|
const A04 = OW("04", "Cryptographic Failures"), A06 = OW("06", "Insecure Design");
|
|
10
10
|
/** LLM and CWE controls for rules that already exist. Merged by id in rules/index.ts. */
|
|
11
11
|
export const standardsForExisting = {
|
|
12
12
|
"secret.in-source": [LLM02], "secret.public-env": [LLM02, W(200, "Exposure of Sensitive Information")], "pii.logged": [LLM02, W(200, "Exposure of Sensitive Information")],
|
|
13
|
-
"log.secret": [LLM02, W(200, "Exposure of Sensitive Information")], "deps.unpinned-version": [
|
|
13
|
+
"log.secret": [LLM02, W(200, "Exposure of Sensitive Information")], "deps.unpinned-version": [LLM04], "deps.install-script": [LLM04],
|
|
14
14
|
"xss.raw-html": [W(79, "Cross-site Scripting")], "template.user-string": [W(79, "Cross-site Scripting"), W(94, "Code Injection")],
|
|
15
15
|
"sql.string-built": [W(89, "SQL Injection")], "nosql.operator-input": [W(20, "Improper Input Validation")],
|
|
16
16
|
"csrf.disabled": [W(352, "Cross-Site Request Forgery")], "path.user-input": [W(22, "Path Traversal")],
|
|
@@ -22,7 +22,7 @@ export const standardsForExisting = {
|
|
|
22
22
|
"fs.world-writable": [W(284, "Improper Access Control")], "mass-assignment": [W(20, "Improper Input Validation"), W(639, "Authorization Bypass Through User-Controlled Key")],
|
|
23
23
|
"pii.in-url": [W(200, "Exposure of Sensitive Information")], "error.stack-to-client": [W(200, "Exposure of Sensitive Information")],
|
|
24
24
|
"build.sourcemaps-public": [W(200, "Exposure of Sensitive Information")], "llm.no-output-limit": [W(770, "Allocation of Resources Without Limits or Throttling")],
|
|
25
|
-
"ai.call-not-logged": [
|
|
25
|
+
"ai.call-not-logged": [LLM06],
|
|
26
26
|
};
|
|
27
27
|
const CODE = [".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs", ".py"];
|
|
28
28
|
// Words for what a model sends back, so its output can be followed to a dangerous place on the same line.
|
|
@@ -33,17 +33,17 @@ const USER_TEXT = /\$\{[^}]*\b(req\.(body|query|params)|request\.(json|form|args
|
|
|
33
33
|
const rule = (r) => ({ ...r, ...DRAFT });
|
|
34
34
|
export const standardsRules = [
|
|
35
35
|
// OWASP Top 10 for LLM Applications
|
|
36
|
-
rule({ id: "llm.user-input-in-system-prompt", title: "User text placed inside the AI's system instructions", status: "partial", severity: "high", controls: [LLM01,
|
|
36
|
+
rule({ id: "llm.user-input-in-system-prompt", title: "User text placed inside the AI's system instructions", status: "partial", severity: "high", controls: [LLM01, LLM08],
|
|
37
37
|
fix: "Keep the system prompt fixed. Send what the user typed as a separate user message, and never put it inside the system instructions.",
|
|
38
38
|
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.",
|
|
39
39
|
extensions: CODE,
|
|
40
40
|
test: (l) => /\b(role\s*:\s*["']system["']|system(Prompt|_prompt|Message|_message|Instruction)?\s*[:=]|["']system["']\s*,)/.test(l) && USER_TEXT.test(l) }),
|
|
41
|
-
rule({ id: "llm.output-to-sink", title: "AI output run as code, a command, a query or page HTML", status: "gap", severity: "high", controls: [
|
|
41
|
+
rule({ id: "llm.output-to-sink", title: "AI output run as code, a command, a query or page HTML", status: "gap", severity: "high", controls: [LLM10],
|
|
42
42
|
fix: "Treat model output like input from a stranger: validate it against what you expect, escape it for HTML, and never run it as code, a shell command or SQL.",
|
|
43
43
|
note: "A model's reply can be steered by anyone who can influence its input. Passing it straight to eval, a shell, a database query or innerHTML lets them run code or change data.",
|
|
44
44
|
extensions: CODE,
|
|
45
45
|
test: (l) => MODEL_OUTPUT.test(l) && SINKS.test(l) }),
|
|
46
|
-
rule({ id: "llm.no-output-limit", title: "AI call with no limit on how much it may generate", status: "partial", severity: "low", controls: [
|
|
46
|
+
rule({ id: "llm.no-output-limit", title: "AI call with no limit on how much it may generate", status: "partial", severity: "low", controls: [LLM06],
|
|
47
47
|
fix: "Set a maximum output size on each call (max_tokens, maxTokens or max_output_tokens), and limit how often each user can call it.",
|
|
48
48
|
note: "Without a limit, one request can run up a large bill or tie up the service (unbounded consumption). Marked Partial: the limit may be set in a shared client or wrapper.",
|
|
49
49
|
extensions: CODE,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lintsure/core",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
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",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"keywords": [
|
|
31
31
|
"compliance",
|
|
32
|
-
"gdpr",
|
|
32
|
+
"gdpr",
|
|
33
33
|
"eu-ai-act",
|
|
34
34
|
"mcp",
|
|
35
35
|
"static-analysis",
|