@lintsure/core 0.3.13 → 0.3.15

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/docs/rules.md CHANGED
@@ -1,5 +1,5 @@
1
- <!-- Generated from Lintsure 0.3.13 by scripts/build-docs.mjs. -->
2
- # Lintsure rules (85)
1
+ <!-- Generated from Lintsure 0.3.15 by scripts/build-docs.mjs. -->
2
+ # Lintsure rules (106)
3
3
 
4
4
  ## pii.logged
5
5
  **Personal data written to logs** · status when found: gap · risk: high
@@ -66,7 +66,7 @@
66
66
  - Page: https://lintsure.com/rules/sql-string-built
67
67
 
68
68
  ## cors.any-origin
69
- **API open to any website, with cookies or credentials** · status when found: partial · risk: high · medium confidence (shown with --all)
69
+ **API open to any website, with cookies or credentials** · status when found: partial · risk: high
70
70
 
71
71
  - Controls: owasp-top10 A02:2025 (Security Misconfiguration); owasp-top10 A01:2025 (Broken Access Control); cra Annex I Part I (2)(b) (Secure by default configuration)
72
72
  - Fix: List the exact origins that may call the API. Never combine an open or reflected origin with credentials.
@@ -223,7 +223,7 @@
223
223
 
224
224
  - Controls: owasp-top10 A03:2025 (Software Supply Chain Failures); owasp-llm LLM01:2026 (Prompt Injection)
225
225
  - 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.
226
- - 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 or sends secrets out. Partial when it downloads and runs a script, which some setup guides do on purpose (CWE-829, OWASP LLM01).
226
+ - 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).
227
227
  - When Partial, Lintsure can't see: Lintsure reads the line, not who wrote it or whether the file came from a trusted skill. Check where this file came from before an agent uses it.
228
228
  - Page: https://lintsure.com/rules/agent-instructions-unsafe
229
229
 
@@ -404,6 +404,149 @@
404
404
  - Note: Stack traces show file paths, library versions and sometimes data, which helps attackers (CWE-209).
405
405
  - Page: https://lintsure.com/rules/error-stack-to-client
406
406
 
407
+ ## crypto.static-iv
408
+ **Encryption with a fixed IV or nonce** · status when found: gap · risk: medium
409
+
410
+ - Controls: owasp-top10 A04:2025 (Cryptographic Failures); gdpr Art. 32 (Security of processing)
411
+ - Fix: Make a new random IV for every message (crypto.randomBytes, os.urandom, SecureRandom) and store it next to the ciphertext. It doesn't need to be secret, only never reused.
412
+ - Note: With the same key and the same IV, two messages can be compared and partly recovered. In AES-GCM a repeated nonce lets an attacker forge messages (CWE-329, CWE-323).
413
+ - Page: https://lintsure.com/rules/crypto-static-iv
414
+
415
+ ## crypto.weak-parameters
416
+ **Key size or work factor too low** · status when found: gap · risk: medium
417
+
418
+ - Controls: owasp-top10 A04:2025 (Cryptographic Failures); gdpr Art. 32 (Security of processing)
419
+ - Fix: Use RSA keys of 2048 bits or more, bcrypt with 10 rounds or more, and PBKDF2 with the iteration count current guidance gives (600,000 for SHA-256), or switch to Argon2.
420
+ - Note: Short keys can be factored and low work factors make stolen password hashes cheap to crack on ordinary hardware (CWE-326, CWE-916).
421
+ - Page: https://lintsure.com/rules/crypto-weak-parameters
422
+
423
+ ## mobile.debuggable-build
424
+ **Android release build that can be debugged** · status when found: gap · risk: medium
425
+
426
+ - Controls: owasp-top10 A02:2025 (Security Misconfiguration); gdpr Art. 32 (Security of processing)
427
+ - Fix: Remove android:debuggable from the manifest and keep debuggable false in the release build type. The build tools set it for debug builds on their own.
428
+ - Note: A debuggable app lets anyone with the phone attach a debugger, read its private files and change what it does (CWE-489).
429
+ - Page: https://lintsure.com/rules/mobile-debuggable-build
430
+
431
+ ## privacy.consent-preticked
432
+ **Consent box that starts ticked** · status when found: gap · risk: medium
433
+
434
+ - Controls: gdpr Art. 7 (Conditions for consent)
435
+ - Fix: Start the box empty and let the person tick it. Store when they did and the wording they saw.
436
+ - Note: Consent has to be an active choice. A box that is ticked for the person is not consent under the GDPR, so anything sent on that basis has no legal ground (Art. 7, recital 32).
437
+ - When Partial, Lintsure can't see: Lintsure can't tell whether this box is the legal basis for anything. A ticked box for a setting the person already chose earlier is fine.
438
+ - Page: https://lintsure.com/rules/privacy-consent-preticked
439
+
440
+ ## privacy.special-category-field
441
+ **Sensitive category of personal data stored** · status when found: partial · risk: medium
442
+
443
+ - Controls: gdpr Art. 9 (Special categories of personal data)
444
+ - Fix: Check that you need this field at all. If you do, write down the Art. 9 exception you rely on, usually explicit consent, and limit who can read it.
445
+ - Note: Religion, ethnicity, sexual orientation, political views, union membership, health and genetic data may not be processed unless a specific exception applies. Marked Partial: the exception is a decision outside the code.
446
+ - Page: https://lintsure.com/rules/privacy-special-category-field
447
+
448
+ ## payment.card-code-stored
449
+ **Card security code stored** · status when found: gap · risk: high
450
+
451
+ - Controls: gdpr Art. 32 (Security of processing); owasp-top10 A02:2025 (Security Misconfiguration)
452
+ - Fix: Never store the card security code. Send the card straight to your payment provider and keep only the token it gives back.
453
+ - Note: The three or four digit code exists to prove the card is in the buyer's hand. Card scheme rules (PCI DSS 3.3.1) forbid keeping it after authorisation, even encrypted, and a leak makes every stored card usable.
454
+ - Page: https://lintsure.com/rules/payment-card-code-stored
455
+
456
+ ## cloud.database-public
457
+ **Database reachable from the internet** · status when found: gap · risk: high
458
+
459
+ - Controls: owasp-top10 A01:2025 (Broken Access Control); owasp-top10 A02:2025 (Security Misconfiguration)
460
+ - Fix: Set publicly_accessible to false, put the database in a private subnet, and reach it through the app, a bastion or a VPN.
461
+ - Note: A database with a public address is one leaked or guessed password away from a full data breach, and it is found by scanners within hours (CWE-284).
462
+ - Page: https://lintsure.com/rules/cloud-database-public
463
+
464
+ ## cloud.network-open
465
+ **Admin or database port open to the whole internet** · status when found: gap · risk: high
466
+
467
+ - Controls: owasp-top10 A01:2025 (Broken Access Control); owasp-top10 A02:2025 (Security Misconfiguration)
468
+ - Fix: Limit the rule to the addresses that need it (your office, a VPN, a bastion), or remove it and use a session manager.
469
+ - Note: Remote login and database ports that accept connections from 0.0.0.0/0 are scanned and attacked all day (CWE-284).
470
+ - When Partial, Lintsure can't see: Lintsure reads this file only. It can't see a network ACL or a firewall in front that narrows the rule.
471
+ - Page: https://lintsure.com/rules/cloud-network-open
472
+
473
+ ## cloud.iam-allow-all
474
+ **Policy that allows every action on every resource** · status when found: gap · risk: high
475
+
476
+ - Controls: owasp-top10 A01:2025 (Broken Access Control); owasp-top10 A02:2025 (Security Misconfiguration)
477
+ - Fix: List the actions and resources the role really needs. Start from what it calls today and add as you go.
478
+ - Note: Whoever gets this role's credentials, through a leaked key or a compromised service, controls the whole account (CWE-732).
479
+ - Page: https://lintsure.com/rules/cloud-iam-allow-all
480
+
481
+ ## cloud.function-url-no-auth
482
+ **Function URL that anyone can call** · status when found: partial · risk: medium
483
+
484
+ - Controls: owasp-top10 A01:2025 (Broken Access Control); owasp-top10 A07:2025 (Authentication Failures)
485
+ - Fix: Use AWS_IAM as the authorization type, or check a signature or token in the function before doing anything.
486
+ - Note: With authorization set to NONE the function runs for anyone who has the URL. Marked Partial: public webhooks do this on purpose and check a signature in code.
487
+ - Page: https://lintsure.com/rules/cloud-function-url-no-auth
488
+
489
+ ## docker.runs-as-root
490
+ **Container image that runs as root** · status when found: partial · risk: low
491
+
492
+ - Controls: owasp-top10 A02:2025 (Security Misconfiguration)
493
+ - Fix: Add a user and switch to it in the last stage, for example `RUN adduser -D app` then `USER app`, or use a base image built to run without root.
494
+ - Note: With no USER line the app runs as root inside the container. A bug that lets someone run code then starts with full rights in the container, which makes breaking out to the host much easier (CWE-250). Marked Partial: the platform may set the user when it starts the container.
495
+ - When Partial, Lintsure can't see: Lintsure can't see a user set at run time (Kubernetes runAsUser, docker run --user) or one the base image already sets.
496
+ - Page: https://lintsure.com/rules/docker-runs-as-root
497
+
498
+ ## docker.image-unpinned
499
+ **Base image with no fixed version** · status when found: partial · risk: low
500
+
501
+ - Controls: owasp-top10 A08:2025 (Software or Data Integrity Failures)
502
+ - Fix: Name a version, for example `FROM node:22.11-slim`, and update it on purpose. Pin a digest for anything you ship to others.
503
+ - Note: With no tag, or `latest`, every build can pull a different image, so a broken or tampered release reaches you without any change in your repo (CWE-829).
504
+ - Page: https://lintsure.com/rules/docker-image-unpinned
505
+
506
+ ## docker.secret-in-build
507
+ **Secret given a value in a Dockerfile** · status when found: gap · risk: high
508
+
509
+ - Controls: owasp-top10 A02:2025 (Security Misconfiguration); owasp-top10 A08:2025 (Software or Data Integrity Failures)
510
+ - Fix: Pass the secret when the container starts (an environment variable or a mounted secret), or use `RUN --mount=type=secret` for build steps. Rotate the value: it is in every image built so far.
511
+ - Note: ENV and ARG values are stored in the image. Anyone who can pull the image, or read its build history, can read the secret (CWE-798).
512
+ - Page: https://lintsure.com/rules/docker-secret-in-build
513
+
514
+ ## mcp.config-unsafe-server
515
+ **MCP server run from a moving version or over plain HTTP** · status when found: partial · risk: medium
516
+
517
+ - Controls: owasp-llm LLM04:2026 (Supply Chain); owasp-top10 A08:2025 (Software or Data Integrity Failures)
518
+ - 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.
519
+ - 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).
520
+ - When Partial, Lintsure can't see: Lintsure can't see whether a lockfile or a private registry pins this package somewhere else.
521
+ - Page: https://lintsure.com/rules/mcp-config-unsafe-server
522
+
523
+ ## mcp.tool-description-poisoned
524
+ **MCP tool description that gives the agent orders** · status when found: gap · risk: high
525
+
526
+ - Controls: owasp-llm LLM01:2026 (Prompt Injection); owasp-llm LLM04:2026 (Supply Chain)
527
+ - 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.
528
+ - 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).
529
+ - When Partial, Lintsure can't see: Lintsure reads this server's source, not the servers it connects to. It can't tell a real attack from a security tool that lists these phrases to detect them.
530
+ - Page: https://lintsure.com/rules/mcp-tool-description-poisoned
531
+
532
+ ## mcp.tool-runs-shell
533
+ **MCP tool that runs shell commands** · status when found: partial · risk: high
534
+
535
+ - Controls: owasp-llm LLM03:2026 (Excessive Agency); owasp-top10 A06:2025 (Insecure Design)
536
+ - 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.
537
+ - 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).
538
+ - When Partial, Lintsure can't see: Lintsure can't tell whether the tool's input reaches the command, or whether the command is fixed.
539
+ - Page: https://lintsure.com/rules/mcp-tool-runs-shell
540
+
541
+ ## mcp.tool-uses-secret
542
+ **MCP server reads a credential every tool shares** · status when found: partial · risk: low · medium confidence (shown with --all)
543
+
544
+ - Controls: owasp-llm LLM03:2026 (Excessive Agency); owasp-top10 A01:2025 (Broken Access Control)
545
+ - 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.
546
+ - 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.
547
+ - When Partial, Lintsure can't see: Lintsure can't see what this credential is allowed to do.
548
+ - Page: https://lintsure.com/rules/mcp-tool-uses-secret
549
+
407
550
  ## authz.no-owner-check
408
551
  **Record loaded by an id from the request, with no owner check** · status when found: partial · risk: high · medium confidence (shown with --all)
409
552
 
@@ -414,7 +557,7 @@
414
557
  - Page: https://lintsure.com/rules/authz-no-owner-check
415
558
 
416
559
  ## jwt.no-algorithm-pin
417
- **Token verified without saying which algorithm is allowed** · status when found: partial · risk: medium
560
+ **Token verified without saying which algorithm is allowed** · status when found: partial · risk: medium · medium confidence (shown with --all)
418
561
 
419
562
  - Controls: owasp-top10 A07:2025 (Authentication Failures)
420
563
  - Fix: Pass the algorithm you sign with, for example jwt.verify(token, key, { algorithms: ["RS256"] }), or algorithms=["HS256"] in PyJWT.
@@ -438,7 +581,7 @@
438
581
  - Page: https://lintsure.com/rules/proto-pollution
439
582
 
440
583
  ## html.tabnabbing
441
- **Link opens a new tab without rel="noopener"** · status when found: partial · risk: low
584
+ **Link opens a new tab without rel="noopener"** · status when found: partial · risk: low · medium confidence (shown with --all)
442
585
 
443
586
  - Controls: owasp-top10 A06:2025 (Insecure Design)
444
587
  - Fix: Add rel="noopener noreferrer" to links with target="_blank".
@@ -495,6 +638,23 @@
495
638
  - Note: Introspection hands anyone a full map of your API, including fields you never meant to advertise (CWE-200).
496
639
  - Page: https://lintsure.com/rules/graphql-introspection
497
640
 
641
+ ## ml.unsafe-model-load
642
+ **Model loaded in a way that can run code** · status when found: gap · risk: high
643
+
644
+ - Controls: owasp-top10 A08:2025 (Software or Data Integrity Failures); owasp-llm LLM04:2026 (Supply Chain)
645
+ - Fix: Load weights only: torch.load(path, weights_only=True), or use safetensors. Don't pass trust_remote_code=True; if a model needs it, pin the exact revision you reviewed.
646
+ - Note: A model checkpoint saved with pickle can carry code that runs the moment it is loaded, and trust_remote_code=True runs Python from the model's repository on your server (CWE-502). Since PyTorch 2.6, torch.load loads weights only by default, so a plain call is Partial: it depends on your PyTorch version.
647
+ - When Partial, Lintsure can't see: Lintsure can't see which PyTorch version runs this, or whether the model file comes only from you.
648
+ - Page: https://lintsure.com/rules/ml-unsafe-model-load
649
+
650
+ ## config.default-service-password
651
+ **Database or service left on its default password** · status when found: partial · risk: high
652
+
653
+ - Controls: owasp-top10 A07:2025 (Authentication Failures); owasp-top10 A02:2025 (Security Misconfiguration)
654
+ - Fix: Set a long random password from a secret store or an untracked .env file, for example POSTGRES_PASSWORD=${POSTGRES_PASSWORD} with no default.
655
+ - Note: These defaults are published in every image's documentation, so anyone who can reach the port can log in (CWE-1393). Marked Partial: fine on a laptop with the port bound to 127.0.0.1, not on a server.
656
+ - Page: https://lintsure.com/rules/config-default-service-password
657
+
498
658
  ## supabase.rls-disabled
499
659
  **Database table without row level security** · status when found: partial · risk: high
500
660
 
@@ -562,6 +722,22 @@
562
722
  - When Partial, Lintsure can't see: Lintsure looked for a rate limiter in this file, middleware and package.json. It can't see limits set in a firewall, gateway or hosting dashboard.
563
723
  - Page: https://lintsure.com/rules/auth-no-rate-limit
564
724
 
725
+ ## ci.scan-cannot-fail
726
+ **Security scan in CI that can never fail the build** · status when found: partial · risk: low
727
+
728
+ - Controls: cra Annex I Part II (7) (Updates distributed securely); owasp-top10 A03:2025 (Software Supply Chain Failures)
729
+ - Fix: Let the scan fail the job. If it is too noisy, limit it to high severity or to new findings instead of ignoring its result.
730
+ - Note: With `|| true`, a soft-fail flag or continue-on-error, the scan runs and reports but nothing stops a build that has findings, so it gives a sense of safety it doesn't deliver. Marked Partial: some teams read the report by hand on purpose.
731
+ - Page: https://lintsure.com/rules/ci-scan-cannot-fail
732
+
733
+ ## deps.unsafe-source
734
+ **Packages fetched from a source that can be swapped** · status when found: gap · risk: medium
735
+
736
+ - Controls: cra Annex I Part II (1) (Components identified, including an SBOM); owasp-top10 A03:2025 (Software Supply Chain Failures); owasp-top10 A08:2025 (Software or Data Integrity Failures)
737
+ - Fix: Use one index or registry over https. For private packages, point only their scope or name at the private registry (npm: @scope:registry=..., pip: --index-url with a proxy that serves both) instead of adding a second index.
738
+ - Note: Over plain HTTP, or with certificate checks off, anyone on the network path can serve a different package. With a second pip index, a public package that takes an internal name with a higher version is installed instead (dependency confusion, CWE-829). Partial for the second-index case: your internal names may already be reserved.
739
+ - Page: https://lintsure.com/rules/deps-unsafe-source
740
+
565
741
  ## repo.no-security-policy
566
742
  **No way for people to report a vulnerability** · status when found: partial · risk: medium
567
743
 
package/package.json CHANGED
@@ -1,42 +1,42 @@
1
- {
2
- "name": "@lintsure/core",
3
- "version": "0.3.13",
4
- "description": "Lintsure engine: rules, framework knowledge and reports for readiness checks of AI-written code. Not an audit or legal advice.",
5
- "license": "Apache-2.0",
6
- "type": "module",
7
- "main": "dist/src/index.js",
8
- "types": "dist/src/index.d.ts",
9
- "files": [
10
- "dist/src",
11
- "docs",
12
- "README.md",
13
- "LICENSE"
14
- ],
15
- "author": "Lintsure <hello@lintsure.com>",
16
- "homepage": "https://lintsure.com/docs",
17
- "repository": {
18
- "type": "git",
19
- "url": "git+https://github.com/lintsure/lintsure.git"
20
- },
21
- "bugs": {
22
- "url": "https://github.com/lintsure/lintsure/issues",
23
- "email": "support@lintsure.com"
24
- },
25
- "engines": {
26
- "node": ">=22"
27
- },
28
- "publishConfig": {
29
- "access": "public"
30
- },
31
- "keywords": [
32
- "compliance",
33
- "gdpr",
34
- "eu-ai-act",
35
- "mcp",
36
- "static-analysis",
37
- "readiness"
38
- ],
39
- "scripts": {
40
- "prepublishOnly": "cd ../.. && npm test"
41
- }
42
- }
1
+ {
2
+ "name": "@lintsure/core",
3
+ "version": "0.3.15",
4
+ "description": "Lintsure engine: rules, framework knowledge and reports for readiness checks of AI-written code. Not an audit or legal advice.",
5
+ "license": "Apache-2.0",
6
+ "type": "module",
7
+ "main": "dist/src/index.js",
8
+ "types": "dist/src/index.d.ts",
9
+ "files": [
10
+ "dist/src",
11
+ "docs",
12
+ "README.md",
13
+ "LICENSE"
14
+ ],
15
+ "author": "Lintsure <hello@lintsure.com>",
16
+ "homepage": "https://lintsure.com/docs",
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/lintsure/lintsure.git"
20
+ },
21
+ "bugs": {
22
+ "url": "https://github.com/lintsure/lintsure/issues",
23
+ "email": "support@lintsure.com"
24
+ },
25
+ "engines": {
26
+ "node": ">=22"
27
+ },
28
+ "publishConfig": {
29
+ "access": "public"
30
+ },
31
+ "keywords": [
32
+ "compliance",
33
+ "gdpr",
34
+ "eu-ai-act",
35
+ "mcp",
36
+ "static-analysis",
37
+ "readiness"
38
+ ],
39
+ "scripts": {
40
+ "prepublishOnly": "cd ../.. && npm test"
41
+ }
42
+ }