@lintsure/core 0.3.14 → 0.3.16
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/assessment.js +76 -76
- package/dist/src/guidance.d.ts +1 -1
- package/dist/src/guidance.js +36 -3
- package/dist/src/index.d.ts +21 -1
- package/dist/src/index.js +197 -23
- package/dist/src/knowledge/cra.js +2 -2
- package/dist/src/knowledge/gdpr.js +4 -4
- package/dist/src/knowledge/index.js +2 -2
- package/dist/src/knowledge/more.d.ts +2 -0
- package/dist/src/knowledge/more.js +88 -2
- package/dist/src/knowledge/owasp-top10.js +1 -1
- package/dist/src/review.d.ts +10 -0
- package/dist/src/review.js +25 -0
- package/dist/src/rules/api.d.ts +10 -0
- package/dist/src/rules/api.js +43 -0
- package/dist/src/rules/cra.d.ts +4 -0
- package/dist/src/rules/cra.js +72 -2
- package/dist/src/rules/index.d.ts +1 -0
- package/dist/src/rules/index.js +46 -10
- package/dist/src/rules/more.d.ts +29 -0
- package/dist/src/rules/more.js +347 -4
- package/dist/src/rules/owasp.d.ts +12 -1
- package/dist/src/rules/owasp.js +99 -32
- package/dist/src/rules/stack.js +2 -1
- package/dist/src/rules/standards.js +20 -6
- package/dist/src/types.d.ts +7 -1
- package/dist/src/verify.d.ts +20 -0
- package/dist/src/verify.js +120 -0
- package/docs/README.md +1 -1
- package/docs/agents.md +34 -1
- package/docs/frameworks.md +46 -10
- package/docs/rules.md +547 -31
- package/package.json +42 -42
package/docs/frameworks.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Generated from Lintsure 0.3.
|
|
1
|
+
<!-- Generated from Lintsure 0.3.16 by scripts/build-docs.mjs. -->
|
|
2
2
|
# Frameworks
|
|
3
3
|
|
|
4
4
|
## EU AI Act (`eu-ai-act`)
|
|
@@ -40,15 +40,15 @@ Applies to: Any organization that handles personal data while based in the EU, o
|
|
|
40
40
|
|
|
41
41
|
- Art. 5 Core principles [partly in code]: Use data fairly and openly, only for clear purposes, collect the minimum, keep it accurate, don't keep it longer than needed, and keep it secure. Rules: pii.to-analytics, pii.logged.
|
|
42
42
|
- Art. 6 A lawful reason [outside code]: Every use of personal data needs one of six legal bases, such as consent, a contract, or legitimate interests weighed against people's rights.
|
|
43
|
-
- Art. 7 Consent done right [partly in code]: If you rely on consent, it must be freely given, specific, informed and as easy to withdraw as to give. No pre-ticked boxes.
|
|
44
|
-
- Art. 9 Sensitive data [partly in code]: Health, biometric, ethnic, religious, political, sexual and union data is off-limits unless a specific exception applies. Rules: ai.emotion-or-biometric.
|
|
43
|
+
- Art. 7 Consent done right [partly in code]: If you rely on consent, it must be freely given, specific, informed and as easy to withdraw as to give. No pre-ticked boxes. Rules: privacy.consent-preticked.
|
|
44
|
+
- Art. 9 Sensitive data [partly in code]: Health, biometric, ethnic, religious, political, sexual and union data is off-limits unless a specific exception applies. Rules: ai.emotion-or-biometric, privacy.special-category-field.
|
|
45
45
|
- Art. 12–15 Transparency and access [outside code]: Tell people clearly what you collect and why, and give them a copy of their data when they ask.
|
|
46
|
-
- Art. 17 Right to erasure [partly in code]: When someone asks, and no exception applies, delete their data everywhere you hold it, including backups on rotation and third-party tools.
|
|
46
|
+
- Art. 17 Right to erasure [partly in code]: When someone asks, and no exception applies, delete their data everywhere you hold it, including backups on rotation and third-party tools. Rules: privacy.memory-no-delete.
|
|
47
47
|
- Art. 22 Automated decisions [partly in code]: People have the right not to be subject to fully automated decisions with legal or similarly big effects, unless an exception applies and safeguards like human review are in place. Rules: ai.automated-decision.
|
|
48
48
|
- Art. 25 Privacy by design and default [partly in code]: Build privacy in from the start, and make the most private setting the default. Rules: pii.in-url, pii.to-analytics.
|
|
49
49
|
- Art. 28 Processors [partly in code]: Vendors that handle personal data for you need a contract with specific data protection terms. Rules: pii.to-analytics.
|
|
50
50
|
- Art. 30 Records of processing [outside code]: Keep a list of what personal data you process, why, with whom you share it and how long you keep it.
|
|
51
|
-
- Art. 32 Security of processing [checked in code]: Protect personal data with security that fits the risk: encryption, access control, testing and the ability to recover. Rules: pii.logged, secret.in-source, transport.plain-http, transport.tls-verify-off, crypto.weak-password-hash, sql.string-built, pii.in-url, supabase.rls-disabled, supabase.policy-allows-all, supabase.service-key-in-client, supabase.function-no-auth, secret.public-env, mobile.token-in-plain-storage, mobile.cleartext-traffic, mobile.backup-allowed.
|
|
51
|
+
- Art. 32 Security of processing [checked in code]: Protect personal data with security that fits the risk: encryption, access control, testing and the ability to recover. Rules: crypto.static-iv, crypto.weak-parameters, mobile.debuggable-build, payment.card-code-stored, pii.logged, secret.in-source, transport.plain-http, transport.tls-verify-off, crypto.weak-password-hash, sql.string-built, pii.in-url, supabase.rls-disabled, supabase.policy-allows-all, supabase.service-key-in-client, supabase.function-no-auth, secret.public-env, mobile.token-in-plain-storage, mobile.cleartext-traffic, mobile.backup-allowed.
|
|
52
52
|
- Art. 33–34 Breach notification [outside code]: Tell the regulator within 72 hours of learning about a risky breach, and tell affected people when the risk to them is high.
|
|
53
53
|
- 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
54
|
- 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.
|
|
@@ -62,7 +62,7 @@ Applies to: Any team building a web application or API. It's voluntary, but ofte
|
|
|
62
62
|
|
|
63
63
|
- A01:2025 Broken Access Control [partly in code]: People must only reach the data and actions meant for them. This covers file paths, redirects, requests your server makes on a user's behalf (SSRF), forged requests from other sites, and permissions kept where users can change them. Rules: path.user-input, redirect.open, ssrf.user-url, csrf.disabled, fs.world-writable, cors.any-origin, cookie.trusted-role, supabase.rls-disabled, supabase.policy-allows-all, supabase.service-key-in-client, supabase.function-no-auth, authz.no-owner-check, ws.no-origin-check, cloud.public-bucket.
|
|
64
64
|
- A01:2025 (ownership checks) Every record is checked against the signed-in user [outside code]: Whether each endpoint checks that the record belongs to the person asking (often called IDOR). A line-by-line code check can't tell; it needs design review and testing with two accounts.
|
|
65
|
-
- A02:2025 Security Misconfiguration [partly in code]: Safe settings by default: debug off, real host names, strong secret keys, cookies marked secure, XML parsers that don't load outside files, and errors that don't reveal internals. Rules: config.debug-on, agent.permissions-allow-all, config.allowed-hosts-any, config.default-secret-key, xml.external-entities, cors.any-origin, session.cookie-insecure, error.stack-to-client, build.sourcemaps-public, release.env-not-ignored, k8s.privileged, docker.socket-mounted, graphql.introspection.
|
|
65
|
+
- A02:2025 Security Misconfiguration [partly in code]: Safe settings by default: debug off, real host names, strong secret keys, cookies marked secure, XML parsers that don't load outside files, and errors that don't reveal internals. Rules: cloud.database-public, cloud.network-open, cloud.iam-allow-all, cloud.function-url-no-auth, docker.runs-as-root, docker.image-unpinned, docker.secret-in-build, docker.copies-everything, config.debug-on, agent.permissions-allow-all, config.allowed-hosts-any, config.default-secret-key, xml.external-entities, cors.any-origin, session.cookie-insecure, error.stack-to-client, build.sourcemaps-public, release.env-not-ignored, k8s.privileged, docker.socket-mounted, graphql.introspection.
|
|
66
66
|
- 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
67
|
- 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
68
|
- 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.
|
|
@@ -99,9 +99,9 @@ Applies to: Businesses that make, import or sell software or connected hardware
|
|
|
99
99
|
- Annex I Part I (2)(j) Limited attack surface [partly in code]: Fewer ways in: no open redirects, no server requests to any address a user picks, limits on uploads, and errors that don't reveal internals. Rules: ssrf.user-url, redirect.open, upload.unrestricted, error.stack-to-client.
|
|
100
100
|
- Annex I Part I (2)(l) Security logging [partly in code]: Security-relevant activity is recorded so problems can be spotted, without putting secrets in the logs or letting entries be forged. Users should be able to opt out where it fits. Rules: log.secret, log.injection.
|
|
101
101
|
- Annex I Part I (2)(a) No known exploitable vulnerabilities [outside code]: Nothing ships with a vulnerability that's already public and exploitable, including in dependencies. This needs advisory data, which Lintsure doesn't download, so use a dependency scanner alongside it.
|
|
102
|
-
- Annex I Part II (1) Components identified, including an SBOM [partly in code]: You know what's in your product: pinned dependencies, no unexplained compiled files, and a machine-readable software bill of materials (SBOM) covering at least the top-level components. Rules: repo.no-sbom, repo.binary-committed, deps.unpinned-version, deps.install-script.
|
|
102
|
+
- Annex I Part II (1) Components identified, including an SBOM [partly in code]: You know what's in your product: pinned dependencies, no unexplained compiled files, and a machine-readable software bill of materials (SBOM) covering at least the top-level components. Rules: repo.no-sbom, repo.binary-committed, deps.unpinned-version, deps.install-script, deps.unsafe-source.
|
|
103
103
|
- Annex I Part II (5) Coordinated vulnerability disclosure policy [partly in code]: A published way for anyone to report a vulnerability to you, and a process for handling reports. Rules: repo.no-security-policy.
|
|
104
|
-
- Annex I Part II (7) Updates distributed securely [partly in code]: Builds and updates can't be swapped or tampered with: pinned CI steps, workflow tokens limited to what they need, untrusted pull requests and issue text kept away from secrets and commands, and nothing run straight from a download without a check. Rules: update.unverified-download, ci.action-unpinned, ci.prt-checkout-head, ci.write-all-permissions, ci.script-injection.
|
|
104
|
+
- Annex I Part II (7) Updates distributed securely [partly in code]: Builds and updates can't be swapped or tampered with: pinned CI steps, workflow tokens limited to what they need, untrusted pull requests and issue text kept away from secrets and commands, and nothing run straight from a download without a check. Rules: update.unverified-download, ci.action-unpinned, ci.prt-checkout-head, ci.write-all-permissions, ci.script-injection, ci.scan-cannot-fail.
|
|
105
105
|
- Annex I Part II (2) Vulnerabilities fixed without delay [partly in code]: When a component you use gets a security fix, it reaches your product quickly. Automated update pull requests are the usual way to make that happen. Rules: repo.no-dependency-updates.
|
|
106
106
|
- Annex I Part II (2), (8) Free security updates for the support period [outside code]: Vulnerabilities are fixed without delay and security updates are free for the support period, which is at least five years unless the product is expected to be used for less, and stated when it's sold (Art. 13(8)).
|
|
107
107
|
- Art. 13(2) Cybersecurity risk assessment [outside code]: A documented assessment of the product's security risks, kept up to date and used to decide which requirements apply and how.
|
|
@@ -115,10 +115,10 @@ The ten most serious security risks in apps built on large language models: prom
|
|
|
115
115
|
|
|
116
116
|
Applies to: Any team that builds a feature on an AI model: chatbots, assistants, agents, retrieval (RAG) and AI features inside other apps.
|
|
117
117
|
|
|
118
|
-
- LLM01:2026 Prompt Injection [partly in code]: 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. Rules: llm.user-input-in-system-prompt, agent.instructions-unsafe, llm.client-controls-system.
|
|
118
|
+
- LLM01:2026 Prompt Injection [partly in code]: 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. Rules: llm.user-input-in-system-prompt, llm.retrieved-text-in-system-prompt, agent.instructions-unsafe, llm.client-controls-system, mcp.tool-description-poisoned.
|
|
119
119
|
- LLM02:2026 Sensitive Information Disclosure [partly in code]: Keys, personal data and internal details must not reach the model, its logs or its answers unless they're meant to. Rules: secret.in-source, secret.public-env, pii.logged, log.secret.
|
|
120
120
|
- LLM03:2026 Excessive Agency [partly in code]: Tools and permissions given to an agent should be the minimum it needs, with a person approving anything risky. Rules: agent.permissions-allow-all, mcp.tool-runs-shell, mcp.tool-uses-secret.
|
|
121
|
-
- LLM04:2026 Supply Chain [partly in code]: Models, datasets, plugins and packages come from others. Pin and check them like any dependency. Rules: deps.unpinned-version, deps.install-script, agent.config-runs-remote-code, ml.unsafe-model-load.
|
|
121
|
+
- LLM04:2026 Supply Chain [partly in code]: Models, datasets, plugins and packages come from others. Pin and check them like any dependency. Rules: deps.unpinned-version, deps.install-script, agent.config-runs-remote-code, ml.unsafe-model-load, mcp.config-unsafe-server.
|
|
122
122
|
- LLM05:2026 Data and Model Poisoning [outside code]: Training, fine-tuning or retrieval data can be tampered with to change the model's behaviour.
|
|
123
123
|
- LLM06:2026 Unbounded Consumption [partly in code]: Limit output size, request rate and cost per user, so one person can't run up a bill or take the service down. Rules: llm.no-output-limit, ai.call-not-logged, llm.unbounded-agent-loop.
|
|
124
124
|
- LLM07:2026 Misinformation [outside code]: Models state wrong things confidently. Show sources, say it's AI and keep a person in the loop where it matters.
|
|
@@ -145,3 +145,39 @@ Applies to: Anyone writing software. It's a reference list, not a law or certifi
|
|
|
145
145
|
- 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
146
|
|
|
147
147
|
Our own summary, checked on 2026-11-09. Read the official text for anything you rely on.
|
|
148
|
+
|
|
149
|
+
## OWASP Agentic Skills Top 10 (`owasp-ast`)
|
|
150
|
+
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
|
+
Applies to: Any team whose developers or products use an AI agent that loads skills, instruction files or MCP servers.
|
|
153
|
+
|
|
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
|
+
- 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
|
+
- 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, skill.unrestricted-shell.
|
|
157
|
+
- 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
|
+
- 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
|
+
- 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
|
+
- 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
|
+
- AST09 No Governance [outside code]: Someone should know which skills are installed, who approved each one and how to remove one fast.
|
|
163
|
+
- 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
|
+
Our own summary, checked on 2026-11-23. Read the official text for anything you rely on.
|
|
166
|
+
|
|
167
|
+
## OWASP API Security Top 10 2023 (`owasp-api`)
|
|
168
|
+
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.
|
|
169
|
+
|
|
170
|
+
Applies to: Any team whose product has an API: a backend for a web or mobile app, a public API, or endpoints called by other services.
|
|
171
|
+
|
|
172
|
+
- API1:2023 Broken Object Level Authorization [partly in code]: Every request for a record by id must check that this caller may see that record. A valid sign-in is not enough. Rules: authz.no-owner-check, supabase.rls-disabled, supabase.policy-allows-all.
|
|
173
|
+
- API2:2023 Broken Authentication [partly in code]: Sign-in, tokens and password resets must resist guessing, forgery and theft: verified tokens that expire, strong password hashing and limits on attempts. Rules: auth.hardcoded-password, jwt.unverified, jwt.no-expiry, jwt.no-algorithm-pin, jwt.weak-secret, crypto.weak-password-hash, session.cookie-insecure, auth.no-rate-limit.
|
|
174
|
+
- API3:2023 Broken Object Property Level Authorization [partly in code]: A caller should only read and change the fields meant for them. Don't save a whole request body, and don't return whole records. Rules: mass-assignment.
|
|
175
|
+
- API4:2023 Unrestricted Resource Consumption [partly in code]: Limit how often, how much and how long: request rates, page sizes, upload sizes, and anything you pay for per call. Rules: auth.no-rate-limit, llm.no-output-limit, llm.unbounded-agent-loop, upload.unrestricted.
|
|
176
|
+
- API5:2023 Broken Function Level Authorization [partly in code]: Admin and other privileged endpoints must check the caller's role on the server. Hiding the button in the app does not protect the endpoint. Rules: authz.admin-route-no-check, cookie.trusted-role, supabase.function-no-auth, cloud.function-url-no-auth.
|
|
177
|
+
- API6:2023 Unrestricted Access to Sensitive Business Flows [outside code]: A flow such as buying, booking or signing up can be abused when it is run at scale by a script, even if every single call is allowed.
|
|
178
|
+
- API7:2023 Server Side Request Forgery [partly in code]: When the server fetches an address a caller supplied, check it against an allow-list first, or it can be pointed at your own internal systems. Rules: ssrf.user-url.
|
|
179
|
+
- API8:2023 Security Misconfiguration [partly in code]: Open CORS, debug mode, detailed errors and switched-off checks give attackers a head start. Ship with them closed. Rules: cors.any-origin, config.debug-on, error.stack-to-client, graphql.introspection, config.allowed-hosts-any, transport.tls-verify-off.
|
|
180
|
+
- 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
|
+
- 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
|
+
Our own summary, checked on 2026-11-23. Read the official text for anything you rely on.
|