@skillsmith/core 0.12.2 → 0.12.4
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/CHANGELOG.md +173 -0
- package/README.md +2 -2
- package/dist/.tsbuildinfo +1 -1
- package/dist/src/config/owned-lock.acquire.d.ts +8 -0
- package/dist/src/config/owned-lock.acquire.d.ts.map +1 -1
- package/dist/src/config/owned-lock.acquire.js +19 -4
- package/dist/src/config/owned-lock.acquire.js.map +1 -1
- package/dist/src/config/owned-lock.claim.d.ts +4 -2
- package/dist/src/config/owned-lock.claim.d.ts.map +1 -1
- package/dist/src/config/owned-lock.claim.js +42 -8
- package/dist/src/config/owned-lock.claim.js.map +1 -1
- package/dist/src/config/owned-lock.d.ts.map +1 -1
- package/dist/src/config/owned-lock.js +1 -0
- package/dist/src/config/owned-lock.js.map +1 -1
- package/dist/src/config/owned-lock.test.js +126 -2
- package/dist/src/config/owned-lock.test.js.map +1 -1
- package/dist/src/config/owned-lock.types.d.ts +9 -0
- package/dist/src/config/owned-lock.types.d.ts.map +1 -1
- package/dist/src/db/createDatabase.d.ts.map +1 -1
- package/dist/src/db/createDatabase.js +0 -2
- package/dist/src/db/createDatabase.js.map +1 -1
- package/dist/src/exports/services.install.d.ts +1 -0
- package/dist/src/exports/services.install.d.ts.map +1 -1
- package/dist/src/exports/services.install.js +5 -0
- package/dist/src/exports/services.install.js.map +1 -1
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +3 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/install/fan-out.cleanup.d.ts +37 -0
- package/dist/src/install/fan-out.cleanup.d.ts.map +1 -0
- package/dist/src/install/fan-out.cleanup.js +75 -0
- package/dist/src/install/fan-out.cleanup.js.map +1 -0
- package/dist/src/install/fan-out.d.ts +41 -31
- package/dist/src/install/fan-out.d.ts.map +1 -1
- package/dist/src/install/fan-out.js +213 -112
- package/dist/src/install/fan-out.js.map +1 -1
- package/dist/src/install/fan-out.leftovers.d.ts +60 -0
- package/dist/src/install/fan-out.leftovers.d.ts.map +1 -0
- package/dist/src/install/fan-out.leftovers.js +251 -0
- package/dist/src/install/fan-out.leftovers.js.map +1 -0
- package/dist/src/install/fan-out.locks.d.ts +12 -0
- package/dist/src/install/fan-out.locks.d.ts.map +1 -0
- package/dist/src/install/fan-out.locks.js +114 -0
- package/dist/src/install/fan-out.locks.js.map +1 -0
- package/dist/src/install/fan-out.manifest.d.ts +64 -0
- package/dist/src/install/fan-out.manifest.d.ts.map +1 -0
- package/dist/src/install/fan-out.manifest.js +130 -0
- package/dist/src/install/fan-out.manifest.js.map +1 -0
- package/dist/src/install/fan-out.overwrite.d.ts +51 -0
- package/dist/src/install/fan-out.overwrite.d.ts.map +1 -0
- package/dist/src/install/fan-out.overwrite.js +343 -0
- package/dist/src/install/fan-out.overwrite.js.map +1 -0
- package/dist/src/install/remove-if-same.d.ts +58 -0
- package/dist/src/install/remove-if-same.d.ts.map +1 -0
- package/dist/src/install/remove-if-same.js +222 -0
- package/dist/src/install/remove-if-same.js.map +1 -0
- package/dist/src/provenance/backfill.d.ts.map +1 -1
- package/dist/src/provenance/backfill.js +15 -2
- package/dist/src/provenance/backfill.js.map +1 -1
- package/dist/src/scripts/__tests__/scan-imported-skills.test.js +9 -1
- package/dist/src/scripts/__tests__/scan-imported-skills.test.js.map +1 -1
- package/dist/src/scripts/scan-imported-skills.d.ts +7 -1
- package/dist/src/scripts/scan-imported-skills.d.ts.map +1 -1
- package/dist/src/scripts/scan-imported-skills.js +15 -2
- package/dist/src/scripts/scan-imported-skills.js.map +1 -1
- package/dist/src/scripts/skill-scanner/allowlist.d.ts +10 -0
- package/dist/src/scripts/skill-scanner/allowlist.d.ts.map +1 -1
- package/dist/src/scripts/skill-scanner/allowlist.js +10 -0
- package/dist/src/scripts/skill-scanner/allowlist.js.map +1 -1
- package/dist/src/scripts/skill-scanner/index.d.ts +8 -0
- package/dist/src/scripts/skill-scanner/index.d.ts.map +1 -1
- package/dist/src/scripts/skill-scanner/index.js +13 -5
- package/dist/src/scripts/skill-scanner/index.js.map +1 -1
- package/dist/src/scripts/skill-scanner/trust-scorer.d.ts.map +1 -1
- package/dist/src/scripts/skill-scanner/trust-scorer.js +6 -0
- package/dist/src/scripts/skill-scanner/trust-scorer.js.map +1 -1
- package/dist/src/security/scanner/SecurityScanner.action-context.d.ts +15 -0
- package/dist/src/security/scanner/SecurityScanner.action-context.d.ts.map +1 -0
- package/dist/src/security/scanner/SecurityScanner.action-context.js +209 -0
- package/dist/src/security/scanner/SecurityScanner.action-context.js.map +1 -0
- package/dist/src/security/scanner/SecurityScanner.d.ts +25 -0
- package/dist/src/security/scanner/SecurityScanner.d.ts.map +1 -1
- package/dist/src/security/scanner/SecurityScanner.helpers.d.ts +40 -1
- package/dist/src/security/scanner/SecurityScanner.helpers.d.ts.map +1 -1
- package/dist/src/security/scanner/SecurityScanner.helpers.js +88 -51
- package/dist/src/security/scanner/SecurityScanner.helpers.js.map +1 -1
- package/dist/src/security/scanner/SecurityScanner.js +39 -6
- package/dist/src/security/scanner/SecurityScanner.js.map +1 -1
- package/dist/src/security/scanner/SecurityScanner.pii.d.ts +30 -0
- package/dist/src/security/scanner/SecurityScanner.pii.d.ts.map +1 -1
- package/dist/src/security/scanner/SecurityScanner.pii.js +8 -1
- package/dist/src/security/scanner/SecurityScanner.pii.js.map +1 -1
- package/dist/src/security/scanner/SecurityScanner.prose-lexicon.d.ts +60 -0
- package/dist/src/security/scanner/SecurityScanner.prose-lexicon.d.ts.map +1 -0
- package/dist/src/security/scanner/SecurityScanner.prose-lexicon.js +228 -0
- package/dist/src/security/scanner/SecurityScanner.prose-lexicon.js.map +1 -0
- package/dist/src/security/scanner/SecurityScanner.scanners.d.ts.map +1 -1
- package/dist/src/security/scanner/SecurityScanner.scanners.js +42 -5
- package/dist/src/security/scanner/SecurityScanner.scanners.js.map +1 -1
- package/dist/src/security/scanner/SecurityScanner.value-gate.d.ts +69 -0
- package/dist/src/security/scanner/SecurityScanner.value-gate.d.ts.map +1 -0
- package/dist/src/security/scanner/SecurityScanner.value-gate.js +271 -0
- package/dist/src/security/scanner/SecurityScanner.value-gate.js.map +1 -0
- package/dist/src/security/scanner/SecurityScanner.weak-passwords.d.ts +55 -0
- package/dist/src/security/scanner/SecurityScanner.weak-passwords.d.ts.map +1 -0
- package/dist/src/security/scanner/SecurityScanner.weak-passwords.js +308 -0
- package/dist/src/security/scanner/SecurityScanner.weak-passwords.js.map +1 -0
- package/dist/src/security/scanner/patterns.d.ts +61 -6
- package/dist/src/security/scanner/patterns.d.ts.map +1 -1
- package/dist/src/security/scanner/patterns.js +70 -61
- package/dist/src/security/scanner/patterns.js.map +1 -1
- package/dist/src/security/scanner/patterns.sensitive-path.d.ts +73 -0
- package/dist/src/security/scanner/patterns.sensitive-path.d.ts.map +1 -0
- package/dist/src/security/scanner/patterns.sensitive-path.js +192 -0
- package/dist/src/security/scanner/patterns.sensitive-path.js.map +1 -0
- package/dist/src/security/scanner/regex-utils.d.ts +31 -17
- package/dist/src/security/scanner/regex-utils.d.ts.map +1 -1
- package/dist/src/security/scanner/regex-utils.js +31 -17
- package/dist/src/security/scanner/regex-utils.js.map +1 -1
- package/dist/src/security/scanner/types.d.ts +9 -0
- package/dist/src/security/scanner/types.d.ts.map +1 -1
- package/dist/src/services/agent-pack/prompt-source.d.ts.map +1 -1
- package/dist/src/services/agent-pack/prompt-source.js +3 -2
- package/dist/src/services/agent-pack/prompt-source.js.map +1 -1
- package/dist/src/services/skill-installation.content.d.ts +7 -2
- package/dist/src/services/skill-installation.content.d.ts.map +1 -1
- package/dist/src/services/skill-installation.content.js +75 -28
- package/dist/src/services/skill-installation.content.js.map +1 -1
- package/dist/src/services/skill-installation.helpers.d.ts.map +1 -1
- package/dist/src/services/skill-installation.helpers.js +8 -0
- package/dist/src/services/skill-installation.helpers.js.map +1 -1
- package/dist/src/services/skill-installation.io.d.ts +1 -29
- package/dist/src/services/skill-installation.io.d.ts.map +1 -1
- package/dist/src/services/skill-installation.io.dirs.d.ts +15 -0
- package/dist/src/services/skill-installation.io.dirs.d.ts.map +1 -0
- package/dist/src/services/skill-installation.io.dirs.js +84 -0
- package/dist/src/services/skill-installation.io.dirs.js.map +1 -0
- package/dist/src/services/skill-installation.io.js +6 -176
- package/dist/src/services/skill-installation.io.js.map +1 -1
- package/dist/src/services/skill-installation.io.rollback.d.ts +138 -0
- package/dist/src/services/skill-installation.io.rollback.d.ts.map +1 -0
- package/dist/src/services/skill-installation.io.rollback.js +218 -0
- package/dist/src/services/skill-installation.io.rollback.js.map +1 -0
- package/dist/src/services/skill-installation.io.write.d.ts +69 -0
- package/dist/src/services/skill-installation.io.write.d.ts.map +1 -0
- package/dist/src/services/skill-installation.io.write.js +417 -0
- package/dist/src/services/skill-installation.io.write.js.map +1 -0
- package/dist/src/services/skill-installation.service.d.ts.map +1 -1
- package/dist/src/services/skill-installation.service.finalize.d.ts +62 -0
- package/dist/src/services/skill-installation.service.finalize.d.ts.map +1 -0
- package/dist/src/services/skill-installation.service.finalize.js +136 -0
- package/dist/src/services/skill-installation.service.finalize.js.map +1 -0
- package/dist/src/services/skill-installation.service.js +66 -80
- package/dist/src/services/skill-installation.service.js.map +1 -1
- package/dist/src/services/skill-installation.target-guard.d.ts +82 -0
- package/dist/src/services/skill-installation.target-guard.d.ts.map +1 -0
- package/dist/src/services/skill-installation.target-guard.js +410 -0
- package/dist/src/services/skill-installation.target-guard.js.map +1 -0
- package/dist/src/services/skill-installation.types.d.ts +13 -1
- package/dist/src/services/skill-installation.types.d.ts.map +1 -1
- package/dist/src/services/skill-installation.types.js.map +1 -1
- package/dist/src/services/skill-installation.uninstall.d.ts +3 -1
- package/dist/src/services/skill-installation.uninstall.d.ts.map +1 -1
- package/dist/src/services/skill-installation.uninstall.helpers.d.ts +59 -0
- package/dist/src/services/skill-installation.uninstall.helpers.d.ts.map +1 -0
- package/dist/src/services/skill-installation.uninstall.helpers.js +124 -0
- package/dist/src/services/skill-installation.uninstall.helpers.js.map +1 -0
- package/dist/src/services/skill-installation.uninstall.js +148 -25
- package/dist/src/services/skill-installation.uninstall.js.map +1 -1
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/utils/index.d.ts.map +1 -1
- package/dist/src/utils/index.js +2 -0
- package/dist/src/utils/index.js.map +1 -1
- package/dist/src/utils/safe-fs.d.ts +69 -0
- package/dist/src/utils/safe-fs.d.ts.map +1 -1
- package/dist/src/utils/safe-fs.js +113 -2
- package/dist/src/utils/safe-fs.js.map +1 -1
- package/dist/src/utils/skill-name.d.ts +19 -0
- package/dist/src/utils/skill-name.d.ts.map +1 -0
- package/dist/src/utils/skill-name.js +26 -0
- package/dist/src/utils/skill-name.js.map +1 -0
- package/dist/src/utils/skill-name.test.d.ts +2 -0
- package/dist/src/utils/skill-name.test.d.ts.map +1 -0
- package/dist/src/utils/skill-name.test.js +34 -0
- package/dist/src/utils/skill-name.test.js.map +1 -0
- package/dist/tests/install/fan-out.test.js +1951 -13
- package/dist/tests/install/fan-out.test.js.map +1 -1
- package/dist/tests/install/remove-if-same.test.d.ts +2 -0
- package/dist/tests/install/remove-if-same.test.d.ts.map +1 -0
- package/dist/tests/install/remove-if-same.test.js +298 -0
- package/dist/tests/install/remove-if-same.test.js.map +1 -0
- package/dist/tests/integration/fan-out-lock-contention.test.d.ts +11 -0
- package/dist/tests/integration/fan-out-lock-contention.test.d.ts.map +1 -0
- package/dist/tests/integration/fan-out-lock-contention.test.js +53 -0
- package/dist/tests/integration/fan-out-lock-contention.test.js.map +1 -0
- package/dist/tests/provenance/backfill.test.js +43 -0
- package/dist/tests/provenance/backfill.test.js.map +1 -1
- package/dist/tests/security/ContinuousSecurity.performance.test.js +12 -7
- package/dist/tests/security/ContinuousSecurity.performance.test.js.map +1 -1
- package/dist/tests/security/ContinuousSecurity.test.js +14 -2
- package/dist/tests/security/ContinuousSecurity.test.js.map +1 -1
- package/dist/tests/security/ai-defence-multiline-promotion.test.d.ts +10 -12
- package/dist/tests/security/ai-defence-multiline-promotion.test.d.ts.map +1 -1
- package/dist/tests/security/ai-defence-multiline-promotion.test.js +26 -33
- package/dist/tests/security/ai-defence-multiline-promotion.test.js.map +1 -1
- package/dist/tests/security/nested-instruction-long-attribute.test.js +20 -10
- package/dist/tests/security/nested-instruction-long-attribute.test.js.map +1 -1
- package/dist/tests/security/scanner-evidence-tiers.test.js +15 -0
- package/dist/tests/security/scanner-evidence-tiers.test.js.map +1 -1
- package/dist/tests/security/scanner-multiline-cap.test.d.ts +21 -0
- package/dist/tests/security/scanner-multiline-cap.test.d.ts.map +1 -0
- package/dist/tests/security/scanner-multiline-cap.test.js +152 -0
- package/dist/tests/security/scanner-multiline-cap.test.js.map +1 -0
- package/dist/tests/security/scanner-regression-guard.test.js +66 -1
- package/dist/tests/security/scanner-regression-guard.test.js.map +1 -1
- package/dist/tests/security/scanner-witness-sw1.test.d.ts +32 -0
- package/dist/tests/security/scanner-witness-sw1.test.d.ts.map +1 -0
- package/dist/tests/security/scanner-witness-sw1.test.js +255 -0
- package/dist/tests/security/scanner-witness-sw1.test.js.map +1 -0
- package/dist/tests/security/sensitive-path-adversarial-review.test.d.ts +2 -0
- package/dist/tests/security/sensitive-path-adversarial-review.test.d.ts.map +1 -0
- package/dist/tests/security/sensitive-path-adversarial-review.test.js +313 -0
- package/dist/tests/security/sensitive-path-adversarial-review.test.js.map +1 -0
- package/dist/tests/security/sensitive-path-boolean-flag.test.d.ts +2 -0
- package/dist/tests/security/sensitive-path-boolean-flag.test.d.ts.map +1 -0
- package/dist/tests/security/sensitive-path-boolean-flag.test.js +151 -0
- package/dist/tests/security/sensitive-path-boolean-flag.test.js.map +1 -0
- package/dist/tests/security/sensitive-path-fp.test.js +314 -0
- package/dist/tests/security/sensitive-path-fp.test.js.map +1 -1
- package/dist/tests/security/sensitive-path-prefixed-secrets.test.d.ts +2 -0
- package/dist/tests/security/sensitive-path-prefixed-secrets.test.d.ts.map +1 -0
- package/dist/tests/security/sensitive-path-prefixed-secrets.test.js +176 -0
- package/dist/tests/security/sensitive-path-prefixed-secrets.test.js.map +1 -0
- package/dist/tests/security/smi5879-corroboration.core.test.js +44 -0
- package/dist/tests/security/smi5879-corroboration.core.test.js.map +1 -1
- package/dist/tests/security/weak-password-lexicon.test.d.ts +18 -0
- package/dist/tests/security/weak-password-lexicon.test.d.ts.map +1 -0
- package/dist/tests/security/weak-password-lexicon.test.js +132 -0
- package/dist/tests/security/weak-password-lexicon.test.js.map +1 -0
- package/dist/tests/skill-scanner/allowlist.test.js +58 -4
- package/dist/tests/skill-scanner/allowlist.test.js.map +1 -1
- package/dist/tests/skill-scanner/categorizer.test.d.ts +2 -0
- package/dist/tests/skill-scanner/categorizer.test.d.ts.map +1 -0
- package/dist/tests/skill-scanner/categorizer.test.js +71 -0
- package/dist/tests/skill-scanner/categorizer.test.js.map +1 -0
- package/dist/tests/skill-scanner/cli-guard.test.d.ts +23 -0
- package/dist/tests/skill-scanner/cli-guard.test.d.ts.map +1 -0
- package/dist/tests/skill-scanner/cli-guard.test.js +71 -0
- package/dist/tests/skill-scanner/cli-guard.test.js.map +1 -0
- package/dist/tests/unit/services/skill-installation.content.test.js +59 -0
- package/dist/tests/unit/services/skill-installation.content.test.js.map +1 -1
- package/dist/tests/unit/services/skill-installation.io.client-agent-path.test.js +35 -14
- package/dist/tests/unit/services/skill-installation.io.client-agent-path.test.js.map +1 -1
- package/dist/tests/unit/services/skill-installation.io.rollback.test.d.ts +2 -0
- package/dist/tests/unit/services/skill-installation.io.rollback.test.d.ts.map +1 -0
- package/dist/tests/unit/services/skill-installation.io.rollback.test.js +984 -0
- package/dist/tests/unit/services/skill-installation.io.rollback.test.js.map +1 -0
- package/dist/tests/unit/services/skill-installation.io.rollback.unit.test.d.ts +2 -0
- package/dist/tests/unit/services/skill-installation.io.rollback.unit.test.d.ts.map +1 -0
- package/dist/tests/unit/services/skill-installation.io.rollback.unit.test.js +148 -0
- package/dist/tests/unit/services/skill-installation.io.rollback.unit.test.js.map +1 -0
- package/dist/tests/unit/services/skill-installation.service.error-codes.test.js +19 -0
- package/dist/tests/unit/services/skill-installation.service.error-codes.test.js.map +1 -1
- package/dist/tests/unit/services/skill-installation.service.finalize.test.d.ts +2 -0
- package/dist/tests/unit/services/skill-installation.service.finalize.test.d.ts.map +1 -0
- package/dist/tests/unit/services/skill-installation.service.finalize.test.js +147 -0
- package/dist/tests/unit/services/skill-installation.service.finalize.test.js.map +1 -0
- package/dist/tests/unit/services/skill-installation.service.sensitive-path-fp.test.d.ts +29 -0
- package/dist/tests/unit/services/skill-installation.service.sensitive-path-fp.test.d.ts.map +1 -0
- package/dist/tests/unit/services/skill-installation.service.sensitive-path-fp.test.js +200 -0
- package/dist/tests/unit/services/skill-installation.service.sensitive-path-fp.test.js.map +1 -0
- package/dist/tests/unit/services/skill-installation.service.test.js +43 -0
- package/dist/tests/unit/services/skill-installation.service.test.js.map +1 -1
- package/dist/tests/unit/services/skill-installation.target-guard.test.d.ts +2 -0
- package/dist/tests/unit/services/skill-installation.target-guard.test.d.ts.map +1 -0
- package/dist/tests/unit/services/skill-installation.target-guard.test.js +590 -0
- package/dist/tests/unit/services/skill-installation.target-guard.test.js.map +1 -0
- package/dist/tests/unit/services/skill-installation.uninstall.guard.test.d.ts +2 -0
- package/dist/tests/unit/services/skill-installation.uninstall.guard.test.d.ts.map +1 -0
- package/dist/tests/unit/services/skill-installation.uninstall.guard.test.js +473 -0
- package/dist/tests/unit/services/skill-installation.uninstall.guard.test.js.map +1 -0
- package/dist/tests/utils/safe-fs.test.js +129 -2
- package/dist/tests/utils/safe-fs.test.js.map +1 -1
- package/package.json +6 -1
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Security Scanner Patterns — the `sensitive_path` family
|
|
3
|
+
* @module @skillsmith/core/security/scanner/patterns.sensitive-path
|
|
4
|
+
*
|
|
5
|
+
* SMI-5207: extracted from patterns.ts, which sat 18 lines under the repo's
|
|
6
|
+
* 500-line pre-commit gate (scripts/check-file-length.mjs) before this wave —
|
|
7
|
+
* not enough headroom for the 12 hoisted pattern consts plus the two new
|
|
8
|
+
* severity-gate classification sets below (~42 lines). Same
|
|
9
|
+
* move-the-family-then-re-export convention already used twice in patterns.ts
|
|
10
|
+
* (patterns.jailbreak.ts, SMI-5876; patterns.exec.ts, SMI-6033 Wave 4).
|
|
11
|
+
*
|
|
12
|
+
* Every symbol here is re-exported unchanged from patterns.ts, so every
|
|
13
|
+
* existing import path keeps working AND reference identity is preserved —
|
|
14
|
+
* load-bearing, because scanSensitivePaths() classifies patterns by reference
|
|
15
|
+
* (`pattern === ENV_PATH_PATTERN`, `VALUE_GATED_KEYWORD_PATTERNS.has(pattern)`,
|
|
16
|
+
* and now `PATH_FORM_PATTERNS.has(pattern)` /
|
|
17
|
+
* `VALUE_GATED_ASSIGNMENT_PATTERNS.has(pattern)`).
|
|
18
|
+
*
|
|
19
|
+
* NOTE: a change to SENSITIVE_PATH_PATTERNS or to the severity classification
|
|
20
|
+
* below requires bumping SCANNER_RULESET_VERSION in patterns.ts — see that
|
|
21
|
+
* constant's own doc comment.
|
|
22
|
+
*/
|
|
23
|
+
export declare const ENV_PATH_PATTERN: RegExp;
|
|
24
|
+
export declare const SENSITIVE_PATH_PATTERNS: RegExp[];
|
|
25
|
+
export declare const VALUE_GATED_KEYWORD_PATTERNS: ReadonlySet<RegExp>;
|
|
26
|
+
/**
|
|
27
|
+
* SMI-5207 (MF-3): the 9 path/filename-form entries. HIGH only when an action
|
|
28
|
+
* verb or shell operator appears within +/-1 line of the match; otherwise
|
|
29
|
+
* MEDIUM — a bare path *mention* is the common case, so evidence is required
|
|
30
|
+
* to escalate. See scanSensitivePaths' hasPathActionContext().
|
|
31
|
+
*/
|
|
32
|
+
export declare const PATH_FORM_PATTERNS: ReadonlySet<RegExp>;
|
|
33
|
+
/**
|
|
34
|
+
* SMI-5207 (MF-4): the 3 keyword-assignment entries. HIGH BY DEFAULT —
|
|
35
|
+
* `keyword: value` is a syntactic credential-assignment shape, rare in
|
|
36
|
+
* innocent prose — downgraded to MEDIUM only on positive prose evidence about
|
|
37
|
+
* the assigned value. See scanSensitivePaths' assignmentHasRealValue().
|
|
38
|
+
*
|
|
39
|
+
* Partition check (guarded by a dedicated test): 1 (ENV) + 9 (PATH_FORM) +
|
|
40
|
+
* 3 (ASSIGNMENT) + 2 (VALUE_GATED_KEYWORD) + 1 (OBSERVE_ONLY_MEDIUM) = 16,
|
|
41
|
+
* total and disjoint. An unclassified future pattern falls through to
|
|
42
|
+
* scanSensitivePaths' fail-CLOSED `else` branch and stays HIGH.
|
|
43
|
+
*/
|
|
44
|
+
export declare const VALUE_GATED_ASSIGNMENT_PATTERNS: ReadonlySet<RegExp>;
|
|
45
|
+
/**
|
|
46
|
+
* SMI-6508 (MF-5): always MEDIUM, never value-gated and never escalated.
|
|
47
|
+
*
|
|
48
|
+
* WHY A NEW CLASS RATHER THAN THE MF-4 SET. Adding the prefixed form to
|
|
49
|
+
* VALUE_GATED_ASSIGNMENT_PATTERNS would make it HIGH-by-default, which blocks
|
|
50
|
+
* installation — there is no allowlist in that path and undoing it costs a
|
|
51
|
+
* package publish. Measured against 66,495 real skill contents in prod: the
|
|
52
|
+
* prefixed form newly matches 259 skills / 418 lines, of which the MF-4 value
|
|
53
|
+
* gate would call 191 "real value" → HIGH, newly blocking 132 skills (0.20% of
|
|
54
|
+
* the corpus, ~975 extrapolated to the full population). Shape analysis put
|
|
55
|
+
* roughly 46% of those 191 in false-positive-looking shapes — multi-word prose,
|
|
56
|
+
* lowercase identifiers, paths — and left 104 genuinely ambiguous.
|
|
57
|
+
*
|
|
58
|
+
* So the detection ships at MEDIUM: the finding becomes visible without costing
|
|
59
|
+
* a single install, and the accumulated real-world findings become the evidence
|
|
60
|
+
* for whether HIGH is justified later. Promoting it is a one-line move into the
|
|
61
|
+
* MF-4 set once that evidence exists.
|
|
62
|
+
*
|
|
63
|
+
* DELIBERATE ASYMMETRY. `DB_PASSWORD=` and `AWS_CREDENTIALS=` already reach
|
|
64
|
+
* HIGH today, because CREDENTIALS_ASSIGN_PATTERN and PASSWORD_ASSIGN_PATTERN
|
|
65
|
+
* carry no `\b` and so have always matched their prefixed forms. Those are
|
|
66
|
+
* grandfathered, not endorsed: their prefixed-form FP rate has never been
|
|
67
|
+
* measured. This entry is MEDIUM because we measured it and the others are not
|
|
68
|
+
* because we have not — that asymmetry reflects the evidence, and levelling it
|
|
69
|
+
* in either direction without measuring first would be the wrong fix. See
|
|
70
|
+
* SMI-6508.
|
|
71
|
+
*/
|
|
72
|
+
export declare const OBSERVE_ONLY_MEDIUM_PATTERNS: ReadonlySet<RegExp>;
|
|
73
|
+
//# sourceMappingURL=patterns.sensitive-path.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patterns.sensitive-path.d.ts","sourceRoot":"","sources":["../../../../src/security/scanner/patterns.sensitive-path.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAmCH,eAAO,MAAM,gBAAgB,QAAoE,CAAA;AA0CjG,eAAO,MAAM,uBAAuB,UA4BnC,CAAA;AAID,eAAO,MAAM,4BAA4B,EAAE,WAAW,CAAC,MAAM,CAG3D,CAAA;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAUjD,CAAA;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,+BAA+B,EAAE,WAAW,CAAC,MAAM,CAI9D,CAAA;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,4BAA4B,EAAE,WAAW,CAAC,MAAM,CAE3D,CAAA"}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Security Scanner Patterns — the `sensitive_path` family
|
|
3
|
+
* @module @skillsmith/core/security/scanner/patterns.sensitive-path
|
|
4
|
+
*
|
|
5
|
+
* SMI-5207: extracted from patterns.ts, which sat 18 lines under the repo's
|
|
6
|
+
* 500-line pre-commit gate (scripts/check-file-length.mjs) before this wave —
|
|
7
|
+
* not enough headroom for the 12 hoisted pattern consts plus the two new
|
|
8
|
+
* severity-gate classification sets below (~42 lines). Same
|
|
9
|
+
* move-the-family-then-re-export convention already used twice in patterns.ts
|
|
10
|
+
* (patterns.jailbreak.ts, SMI-5876; patterns.exec.ts, SMI-6033 Wave 4).
|
|
11
|
+
*
|
|
12
|
+
* Every symbol here is re-exported unchanged from patterns.ts, so every
|
|
13
|
+
* existing import path keeps working AND reference identity is preserved —
|
|
14
|
+
* load-bearing, because scanSensitivePaths() classifies patterns by reference
|
|
15
|
+
* (`pattern === ENV_PATH_PATTERN`, `VALUE_GATED_KEYWORD_PATTERNS.has(pattern)`,
|
|
16
|
+
* and now `PATH_FORM_PATTERNS.has(pattern)` /
|
|
17
|
+
* `VALUE_GATED_ASSIGNMENT_PATTERNS.has(pattern)`).
|
|
18
|
+
*
|
|
19
|
+
* NOTE: a change to SENSITIVE_PATH_PATTERNS or to the severity classification
|
|
20
|
+
* below requires bumping SCANNER_RULESET_VERSION in patterns.ts — see that
|
|
21
|
+
* constant's own doc comment.
|
|
22
|
+
*/
|
|
23
|
+
// Sensitive file path patterns
|
|
24
|
+
// SMI-4396 Wave 2: bare-keyword variants (credentials, secrets?, password) tightened
|
|
25
|
+
// to require assignment/path/file-extension context. Without this tuning,
|
|
26
|
+
// documentation keywords in SKILL.md frontmatter and prose (1Password integration
|
|
27
|
+
// guides, security-research skill domain vocabulary) tripped HIGH severity.
|
|
28
|
+
//
|
|
29
|
+
// SMI-5359 Wave 4 — FP-narrowing for two over-firing entries (severity policy lives
|
|
30
|
+
// in scanSensitivePaths so the array length / regression-guard baseline is unchanged):
|
|
31
|
+
// MF-1: bare /api[_-]?key/i & /auth[_-]?token/i fired HIGH on ANY substring —
|
|
32
|
+
// benign prose ("set your api_key in the dashboard"), `export API_KEY=$1`, and
|
|
33
|
+
// `apiKey: <YOUR_KEY>` placeholders. They are now VALUE-GATED: HIGH only when the
|
|
34
|
+
// line assigns a real (non-placeholder, sufficiently-entropic) secret. The
|
|
35
|
+
// value-BEARING leak is already caught at PII (PII_PATTERNS[0/2]); the
|
|
36
|
+
// credential-in-an-outbound-curl exfil is caught by DATA_EXFILTRATION_PATTERNS
|
|
37
|
+
// (the `$API_KEY`-in-a-fetched-URL pattern added there). See
|
|
38
|
+
// VALUE_GATED_KEYWORD_PATTERNS.
|
|
39
|
+
// MF-2: lone /\.env/i fired HIGH on every `.env` mention AND on the benign committed
|
|
40
|
+
// family (.envrc, .env.example/.sample/.template/.schema/.dist). ENV_PATH_PATTERN
|
|
41
|
+
// negative-lookaheads exclude that family; scanSensitivePaths downgrades a LONE
|
|
42
|
+
// `.env` to MEDIUM and keeps HIGH when it co-occurs with a read/exfil verb or
|
|
43
|
+
// shell pipe/redirect (`cat .env | curl ...`).
|
|
44
|
+
//
|
|
45
|
+
// SMI-5207 — the remaining 12 entries got the same treatment the two MF-1 keywords
|
|
46
|
+
// and the MF-2 `.env` entry already had: severity is now context-gated rather than
|
|
47
|
+
// unconditionally HIGH. MF-3 covers the 9 path-form entries (action verb or shell
|
|
48
|
+
// operator within +/-1 line), MF-4 the 3 keyword-assignment entries (HIGH unless the
|
|
49
|
+
// assigned value positively reads as prose). Both gates live in
|
|
50
|
+
// SecurityScanner.scanners.ts; this module only supplies the classification.
|
|
51
|
+
// MF-2: `.env` as a real env-file reference. Excludes `.envrc` (direnv config) and the
|
|
52
|
+
// committed placeholder family (.env.example/.sample/.template/.schema/.dist). The
|
|
53
|
+
// `(?![A-Za-z])` guard also drops the `.environment`/`.envision` English-word FP while
|
|
54
|
+
// still matching real variants like `.env`, `.env.local`, `.env.production`.
|
|
55
|
+
export const ENV_PATH_PATTERN = /\.env(?![A-Za-z])(?!\.(?:example|sample|template|schema|dist))/i;
|
|
56
|
+
// MF-1: bare credential keywords — value-gated in scanSensitivePaths, never standalone HIGH.
|
|
57
|
+
const API_KEY_KEYWORD = /api[_-]?key/i;
|
|
58
|
+
const AUTH_TOKEN_KEYWORD = /auth[_-]?token/i;
|
|
59
|
+
// SMI-5207: the 12 non-`.env` entries are hoisted from inline array literals to named
|
|
60
|
+
// consts so scanSensitivePaths can classify each by severity gate BY REFERENCE. The
|
|
61
|
+
// array's order is unchanged; its length grew 15 → 16 with SMI-6508's MF-5 entry — the regression-guard floor
|
|
62
|
+
// (scanner-regression-guard.test.ts) still holds.
|
|
63
|
+
// Contextual credentials: filename or assignment, not bare prose
|
|
64
|
+
const CREDENTIALS_FILE_PATTERN = /credentials\.(?:json|ya?ml|env|toml|txt)/i;
|
|
65
|
+
const CREDENTIALS_ASSIGN_PATTERN = /credentials\s*[:=]/i;
|
|
66
|
+
// Contextual secrets: assignment or path, not bare word
|
|
67
|
+
const SECRETS_ASSIGN_PATTERN = /\bsecrets?\s*[:=]/i;
|
|
68
|
+
/**
|
|
69
|
+
* SMI-6508 (MF-5): the PREFIXED assignment form — `API_SECRETS=`, `app_secrets:`,
|
|
70
|
+
* `mySecrets=`, and the singular `API_SECRET=`. Exactly complementary to
|
|
71
|
+
* SECRETS_ASSIGN_PATTERN above: that one carries `\b`, and `_` is a word
|
|
72
|
+
* character, so it cannot match after an underscore or a camelCase hump. The
|
|
73
|
+
* lookbehind here matches precisely the cases its boundary excludes, so the two
|
|
74
|
+
* never both fire on one match. `MY-SECRETS=` and `my.secrets=` stay with the
|
|
75
|
+
* bare pattern, since `-` and `.` are non-word characters its `\b` already
|
|
76
|
+
* accepts.
|
|
77
|
+
*
|
|
78
|
+
* MEDIUM by classification, NOT value-gated — see OBSERVE_ONLY_MEDIUM_PATTERNS.
|
|
79
|
+
*/
|
|
80
|
+
const SECRETS_PREFIXED_ASSIGN_PATTERN = /(?<=[A-Za-z0-9_])secrets?\s*[:=]/i;
|
|
81
|
+
const SECRETS_PATH_PATTERN = /\bsecrets?\/[a-z0-9_.-]+/i;
|
|
82
|
+
const PEM_PATTERN = /\.pem$/i;
|
|
83
|
+
const KEY_FILE_PATTERN = /\.key$/i;
|
|
84
|
+
const CRT_PATTERN = /\.crt$/i;
|
|
85
|
+
// Contextual password: assignment or URL (postgres://user:pass@host) only
|
|
86
|
+
const PASSWORD_ASSIGN_PATTERN = /password\s*[:=]/i;
|
|
87
|
+
const SSH_DIR_PATTERN = /~\/\.ssh/i;
|
|
88
|
+
const AWS_DIR_PATTERN = /~\/\.aws/i;
|
|
89
|
+
const CONFIG_DIR_PATTERN = /~\/\.config/i;
|
|
90
|
+
// SMI-4396 Wave 2: explicit system-file paths. Added so that tightening
|
|
91
|
+
// bare /credentials/i and /password/i into assignment-context variants
|
|
92
|
+
// doesn't drop coverage of obvious sensitive references like /etc/passwd.
|
|
93
|
+
const ETC_SYSTEM_FILE_PATTERN = /\/etc\/(?:passwd|shadow|sudoers|hosts)\b/i;
|
|
94
|
+
export const SENSITIVE_PATH_PATTERNS = [
|
|
95
|
+
ENV_PATH_PATTERN,
|
|
96
|
+
CREDENTIALS_FILE_PATTERN,
|
|
97
|
+
CREDENTIALS_ASSIGN_PATTERN,
|
|
98
|
+
SECRETS_ASSIGN_PATTERN,
|
|
99
|
+
SECRETS_PATH_PATTERN,
|
|
100
|
+
PEM_PATTERN,
|
|
101
|
+
KEY_FILE_PATTERN,
|
|
102
|
+
CRT_PATTERN,
|
|
103
|
+
PASSWORD_ASSIGN_PATTERN,
|
|
104
|
+
API_KEY_KEYWORD,
|
|
105
|
+
AUTH_TOKEN_KEYWORD,
|
|
106
|
+
SSH_DIR_PATTERN,
|
|
107
|
+
AWS_DIR_PATTERN,
|
|
108
|
+
CONFIG_DIR_PATTERN,
|
|
109
|
+
ETC_SYSTEM_FILE_PATTERN,
|
|
110
|
+
// SMI-6508 follow-up — MUST STAY LAST. scanSensitivePaths `break`s on the
|
|
111
|
+
// FIRST entry that matches, in THIS array's order, so an always-MEDIUM entry
|
|
112
|
+
// placed ahead of a HIGH-capable one SUPPRESSES it. This shipped briefly at
|
|
113
|
+
// index 4 and was a live scanner-evasion primitive: appending the comment
|
|
114
|
+
// `# a_secrets:` flipped `cat ~/.ssh/id_rsa` and `curl -F f=@/etc/passwd …`
|
|
115
|
+
// from a blocking HIGH to a passing MEDIUM, because MF-5 won the race
|
|
116
|
+
// against SSH_DIR / ETC_SYSTEM_FILE. Any future always-MEDIUM entry belongs
|
|
117
|
+
// here too, after every HIGH-capable pattern. The cost is deliberate and the
|
|
118
|
+
// right way round: on a co-occurring line the other entry reports instead,
|
|
119
|
+
// which slightly undercounts MF-5's own observability — never losing
|
|
120
|
+
// severity dominates never losing a count.
|
|
121
|
+
SECRETS_PREFIXED_ASSIGN_PATTERN,
|
|
122
|
+
];
|
|
123
|
+
// MF-1: the two bare-keyword patterns above emit HIGH only when accompanied by a real
|
|
124
|
+
// assigned secret value; scanSensitivePaths suppresses an otherwise-bare match.
|
|
125
|
+
export const VALUE_GATED_KEYWORD_PATTERNS = new Set([
|
|
126
|
+
API_KEY_KEYWORD,
|
|
127
|
+
AUTH_TOKEN_KEYWORD,
|
|
128
|
+
]);
|
|
129
|
+
/**
|
|
130
|
+
* SMI-5207 (MF-3): the 9 path/filename-form entries. HIGH only when an action
|
|
131
|
+
* verb or shell operator appears within +/-1 line of the match; otherwise
|
|
132
|
+
* MEDIUM — a bare path *mention* is the common case, so evidence is required
|
|
133
|
+
* to escalate. See scanSensitivePaths' hasPathActionContext().
|
|
134
|
+
*/
|
|
135
|
+
export const PATH_FORM_PATTERNS = new Set([
|
|
136
|
+
CREDENTIALS_FILE_PATTERN,
|
|
137
|
+
SECRETS_PATH_PATTERN,
|
|
138
|
+
PEM_PATTERN,
|
|
139
|
+
KEY_FILE_PATTERN,
|
|
140
|
+
CRT_PATTERN,
|
|
141
|
+
SSH_DIR_PATTERN,
|
|
142
|
+
AWS_DIR_PATTERN,
|
|
143
|
+
CONFIG_DIR_PATTERN,
|
|
144
|
+
ETC_SYSTEM_FILE_PATTERN,
|
|
145
|
+
]);
|
|
146
|
+
/**
|
|
147
|
+
* SMI-5207 (MF-4): the 3 keyword-assignment entries. HIGH BY DEFAULT —
|
|
148
|
+
* `keyword: value` is a syntactic credential-assignment shape, rare in
|
|
149
|
+
* innocent prose — downgraded to MEDIUM only on positive prose evidence about
|
|
150
|
+
* the assigned value. See scanSensitivePaths' assignmentHasRealValue().
|
|
151
|
+
*
|
|
152
|
+
* Partition check (guarded by a dedicated test): 1 (ENV) + 9 (PATH_FORM) +
|
|
153
|
+
* 3 (ASSIGNMENT) + 2 (VALUE_GATED_KEYWORD) + 1 (OBSERVE_ONLY_MEDIUM) = 16,
|
|
154
|
+
* total and disjoint. An unclassified future pattern falls through to
|
|
155
|
+
* scanSensitivePaths' fail-CLOSED `else` branch and stays HIGH.
|
|
156
|
+
*/
|
|
157
|
+
export const VALUE_GATED_ASSIGNMENT_PATTERNS = new Set([
|
|
158
|
+
CREDENTIALS_ASSIGN_PATTERN,
|
|
159
|
+
SECRETS_ASSIGN_PATTERN,
|
|
160
|
+
PASSWORD_ASSIGN_PATTERN,
|
|
161
|
+
]);
|
|
162
|
+
/**
|
|
163
|
+
* SMI-6508 (MF-5): always MEDIUM, never value-gated and never escalated.
|
|
164
|
+
*
|
|
165
|
+
* WHY A NEW CLASS RATHER THAN THE MF-4 SET. Adding the prefixed form to
|
|
166
|
+
* VALUE_GATED_ASSIGNMENT_PATTERNS would make it HIGH-by-default, which blocks
|
|
167
|
+
* installation — there is no allowlist in that path and undoing it costs a
|
|
168
|
+
* package publish. Measured against 66,495 real skill contents in prod: the
|
|
169
|
+
* prefixed form newly matches 259 skills / 418 lines, of which the MF-4 value
|
|
170
|
+
* gate would call 191 "real value" → HIGH, newly blocking 132 skills (0.20% of
|
|
171
|
+
* the corpus, ~975 extrapolated to the full population). Shape analysis put
|
|
172
|
+
* roughly 46% of those 191 in false-positive-looking shapes — multi-word prose,
|
|
173
|
+
* lowercase identifiers, paths — and left 104 genuinely ambiguous.
|
|
174
|
+
*
|
|
175
|
+
* So the detection ships at MEDIUM: the finding becomes visible without costing
|
|
176
|
+
* a single install, and the accumulated real-world findings become the evidence
|
|
177
|
+
* for whether HIGH is justified later. Promoting it is a one-line move into the
|
|
178
|
+
* MF-4 set once that evidence exists.
|
|
179
|
+
*
|
|
180
|
+
* DELIBERATE ASYMMETRY. `DB_PASSWORD=` and `AWS_CREDENTIALS=` already reach
|
|
181
|
+
* HIGH today, because CREDENTIALS_ASSIGN_PATTERN and PASSWORD_ASSIGN_PATTERN
|
|
182
|
+
* carry no `\b` and so have always matched their prefixed forms. Those are
|
|
183
|
+
* grandfathered, not endorsed: their prefixed-form FP rate has never been
|
|
184
|
+
* measured. This entry is MEDIUM because we measured it and the others are not
|
|
185
|
+
* because we have not — that asymmetry reflects the evidence, and levelling it
|
|
186
|
+
* in either direction without measuring first would be the wrong fix. See
|
|
187
|
+
* SMI-6508.
|
|
188
|
+
*/
|
|
189
|
+
export const OBSERVE_ONLY_MEDIUM_PATTERNS = new Set([
|
|
190
|
+
SECRETS_PREFIXED_ASSIGN_PATTERN,
|
|
191
|
+
]);
|
|
192
|
+
//# sourceMappingURL=patterns.sensitive-path.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patterns.sensitive-path.js","sourceRoot":"","sources":["../../../../src/security/scanner/patterns.sensitive-path.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,+BAA+B;AAC/B,qFAAqF;AACrF,0EAA0E;AAC1E,kFAAkF;AAClF,4EAA4E;AAC5E,EAAE;AACF,oFAAoF;AACpF,uFAAuF;AACvF,gFAAgF;AAChF,mFAAmF;AACnF,sFAAsF;AACtF,+EAA+E;AAC/E,2EAA2E;AAC3E,mFAAmF;AACnF,iEAAiE;AACjE,oCAAoC;AACpC,uFAAuF;AACvF,sFAAsF;AACtF,oFAAoF;AACpF,kFAAkF;AAClF,mDAAmD;AACnD,EAAE;AACF,mFAAmF;AACnF,mFAAmF;AACnF,kFAAkF;AAClF,qFAAqF;AACrF,gEAAgE;AAChE,6EAA6E;AAE7E,u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C5E,6EAA6E;IAC7E,2EAA2E;IAC3E,qEAAqE;IACrE,2CAA2C;IAC3C,+BAA+B;CAChC,CAAA;AAED,sFAAsF;AACtF,gFAAgF;AAChF,MAAM,CAAC,MAAM,4BAA4B,GAAwB,IAAI,GAAG,CAAC;IACvE,eAAe;IACf,kBAAkB;CACnB,CAAC,CAAA;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAwB,IAAI,GAAG,CAAC;IAC7D,wBAAwB;IACxB,oBAAoB;IACpB,WAAW;IACX,gBAAgB;IAChB,WAAW;IACX,eAAe;IACf,eAAe;IACf,kBAAkB;IAClB,uBAAuB;CACxB,CAAC,CAAA;AAEF;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAwB,IAAI,GAAG,CAAC;IAC1E,0BAA0B;IAC1B,sBAAsB;IACtB,uBAAuB;CACxB,CAAC,CAAA;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAwB,IAAI,GAAG,CAAC;IACvE,+BAA+B;CAChC,CAAC,CAAA"}
|
|
@@ -11,25 +11,39 @@
|
|
|
11
11
|
*/
|
|
12
12
|
export declare const MAX_LINE_LENGTH_FOR_REGEX = 10000;
|
|
13
13
|
/**
|
|
14
|
-
* SMI-
|
|
15
|
-
* UTF-16 code units (JavaScript `string.length` — NOT bytes/code
|
|
16
|
-
* SecurityScanner.ts's content-length finding message).
|
|
14
|
+
* SMI-5879 (design §3.4): Cap for the FULL-CONTENT (multiline "pass 1") regex
|
|
15
|
+
* scan, in UTF-16 code units (JavaScript `string.length` — NOT bytes/code
|
|
16
|
+
* points; see SecurityScanner.ts's content-length finding message).
|
|
17
17
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* (
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
18
|
+
* SMI-5881 set this equal to MAX_LINE_LENGTH_FOR_REGEX (10,000) and declined
|
|
19
|
+
* to raise it, citing a doubling-based extrapolation from smaller inputs that
|
|
20
|
+
* projected "unacceptable latency well before 1,000,000" for
|
|
21
|
+
* AD_CRLF_INJECTION-class patterns. SMI-5879 independently re-measured
|
|
22
|
+
* directly at 1,000,000 (not extrapolated) across the 7 ported multiline
|
|
23
|
+
* patterns (AD_CRLF_INJECTION, AD_ROLE_MARKER_BARE, AD_HTML_COMMENT_VERB/NOUN,
|
|
24
|
+
* AD_DELIMITER_BARE, AD_AN2_ROLE_BODY_NEXT_LINE, JB_JS3A/JS3B) against
|
|
25
|
+
* per-pattern adversarial near-miss shapes (not just the CRLF-pair shape
|
|
26
|
+
* SMI-5881 used) and found linear scaling with a worst case of ~56ms at
|
|
27
|
+
* 1,000,000 chars (AD_HTML_COMMENT_NOUN, "repeated HTML-comment-open"
|
|
28
|
+
* near-miss) — confirmed still linear (not superlinear) up to 4,000,000
|
|
29
|
+
* chars (~145ms), comfortably under the section 7.3 250ms per-case budget.
|
|
30
|
+
* The prior extrapolation does not hold empirically at this exact size; the
|
|
31
|
+
* measured worst case has real headroom, just less than the ~78x this
|
|
32
|
+
* design doc's own (unverified) claim asserted. Raising this cap closes the
|
|
33
|
+
* 10 KB pass-1 truncation blind spot (design §3.4) — the edge's own
|
|
34
|
+
* MAX_SKILL_CONTENT_SIZE is 1,000,000 bytes, so pass 1 previously saw only
|
|
35
|
+
* the first 1% of a large SKILL.md.
|
|
36
|
+
*
|
|
37
|
+
* Still declared separately from MAX_LINE_LENGTH_FOR_REGEX because the two
|
|
38
|
+
* caps protect different scan passes (per-line vs whole-document) and may
|
|
39
|
+
* need to diverge again. See SecurityScanner.ts's `effectiveMultilineLimit`
|
|
40
|
+
* (`Math.min(MAX_CONTENT_LENGTH_FOR_REGEX, maxContentLength)`) for how this
|
|
41
|
+
* interacts with the per-tier content-length ceiling — a trust tier with a
|
|
42
|
+
* SMALLER configured `maxContentLength` still tightens the effective limit
|
|
43
|
+
* below this cap; none currently need MORE than this cap for the multiline
|
|
44
|
+
* pass specifically.
|
|
31
45
|
*/
|
|
32
|
-
export declare const MAX_CONTENT_LENGTH_FOR_REGEX =
|
|
46
|
+
export declare const MAX_CONTENT_LENGTH_FOR_REGEX = 1000000;
|
|
33
47
|
/**
|
|
34
48
|
* SMI-882: Safe regex test with length limit
|
|
35
49
|
* Applies input length limit before regex matching to prevent ReDoS attacks.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"regex-utils.d.ts","sourceRoot":"","sources":["../../../../src/security/scanner/regex-utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,QAAQ,CAAA;AAE9C
|
|
1
|
+
{"version":3,"file":"regex-utils.d.ts","sourceRoot":"","sources":["../../../../src/security/scanner/regex-utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,QAAQ,CAAA;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,4BAA4B,UAAY,CAAA;AAErD;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,SAAS,GAAE,MAAkC,GAC5C,gBAAgB,GAAG,IAAI,CAIzB;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,SAAS,GAAE,MAAkC,GAC5C,OAAO,CAIT"}
|
|
@@ -11,25 +11,39 @@
|
|
|
11
11
|
*/
|
|
12
12
|
export const MAX_LINE_LENGTH_FOR_REGEX = 10000;
|
|
13
13
|
/**
|
|
14
|
-
* SMI-
|
|
15
|
-
* UTF-16 code units (JavaScript `string.length` — NOT bytes/code
|
|
16
|
-
* SecurityScanner.ts's content-length finding message).
|
|
14
|
+
* SMI-5879 (design §3.4): Cap for the FULL-CONTENT (multiline "pass 1") regex
|
|
15
|
+
* scan, in UTF-16 code units (JavaScript `string.length` — NOT bytes/code
|
|
16
|
+
* points; see SecurityScanner.ts's content-length finding message).
|
|
17
17
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* (
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
18
|
+
* SMI-5881 set this equal to MAX_LINE_LENGTH_FOR_REGEX (10,000) and declined
|
|
19
|
+
* to raise it, citing a doubling-based extrapolation from smaller inputs that
|
|
20
|
+
* projected "unacceptable latency well before 1,000,000" for
|
|
21
|
+
* AD_CRLF_INJECTION-class patterns. SMI-5879 independently re-measured
|
|
22
|
+
* directly at 1,000,000 (not extrapolated) across the 7 ported multiline
|
|
23
|
+
* patterns (AD_CRLF_INJECTION, AD_ROLE_MARKER_BARE, AD_HTML_COMMENT_VERB/NOUN,
|
|
24
|
+
* AD_DELIMITER_BARE, AD_AN2_ROLE_BODY_NEXT_LINE, JB_JS3A/JS3B) against
|
|
25
|
+
* per-pattern adversarial near-miss shapes (not just the CRLF-pair shape
|
|
26
|
+
* SMI-5881 used) and found linear scaling with a worst case of ~56ms at
|
|
27
|
+
* 1,000,000 chars (AD_HTML_COMMENT_NOUN, "repeated HTML-comment-open"
|
|
28
|
+
* near-miss) — confirmed still linear (not superlinear) up to 4,000,000
|
|
29
|
+
* chars (~145ms), comfortably under the section 7.3 250ms per-case budget.
|
|
30
|
+
* The prior extrapolation does not hold empirically at this exact size; the
|
|
31
|
+
* measured worst case has real headroom, just less than the ~78x this
|
|
32
|
+
* design doc's own (unverified) claim asserted. Raising this cap closes the
|
|
33
|
+
* 10 KB pass-1 truncation blind spot (design §3.4) — the edge's own
|
|
34
|
+
* MAX_SKILL_CONTENT_SIZE is 1,000,000 bytes, so pass 1 previously saw only
|
|
35
|
+
* the first 1% of a large SKILL.md.
|
|
36
|
+
*
|
|
37
|
+
* Still declared separately from MAX_LINE_LENGTH_FOR_REGEX because the two
|
|
38
|
+
* caps protect different scan passes (per-line vs whole-document) and may
|
|
39
|
+
* need to diverge again. See SecurityScanner.ts's `effectiveMultilineLimit`
|
|
40
|
+
* (`Math.min(MAX_CONTENT_LENGTH_FOR_REGEX, maxContentLength)`) for how this
|
|
41
|
+
* interacts with the per-tier content-length ceiling — a trust tier with a
|
|
42
|
+
* SMALLER configured `maxContentLength` still tightens the effective limit
|
|
43
|
+
* below this cap; none currently need MORE than this cap for the multiline
|
|
44
|
+
* pass specifically.
|
|
31
45
|
*/
|
|
32
|
-
export const MAX_CONTENT_LENGTH_FOR_REGEX =
|
|
46
|
+
export const MAX_CONTENT_LENGTH_FOR_REGEX = 1_000_000;
|
|
33
47
|
/**
|
|
34
48
|
* SMI-882: Safe regex test with length limit
|
|
35
49
|
* Applies input length limit before regex matching to prevent ReDoS attacks.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"regex-utils.js","sourceRoot":"","sources":["../../../../src/security/scanner/regex-utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,KAAK,CAAA;AAE9C
|
|
1
|
+
{"version":3,"file":"regex-utils.js","sourceRoot":"","sources":["../../../../src/security/scanner/regex-utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,KAAK,CAAA;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,SAAS,CAAA;AAErD;;;;;;;;GAQG;AACH,MAAM,UAAU,aAAa,CAC3B,OAAe,EACf,KAAa,EACb,YAAoB,yBAAyB;IAE7C,2DAA2D;IAC3D,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;IAC9E,OAAO,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;AACjC,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc,CAC5B,OAAe,EACf,KAAa,EACb,YAAoB,yBAAyB;IAE7C,2DAA2D;IAC3D,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;IAC9E,OAAO,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;AAChC,CAAC"}
|
|
@@ -117,6 +117,15 @@ export interface ScanReport {
|
|
|
117
117
|
riskScore: number;
|
|
118
118
|
/** Breakdown of risk score by category */
|
|
119
119
|
riskBreakdown: RiskScoreBreakdown;
|
|
120
|
+
/**
|
|
121
|
+
* SMI-5879 (design §3.3.6): true when the jailbreak or ai_defence multiline
|
|
122
|
+
* pass hit its per-pattern iteration ceiling before exhausting matches on a
|
|
123
|
+
* pathological same-line-repetition input. NOT provably score-neutral — the
|
|
124
|
+
* write path must treat this scan as authoritative for RAISING a verdict
|
|
125
|
+
* only, never for lowering an existing quarantine. Absent/undefined is
|
|
126
|
+
* equivalent to `false` (not truncated) for gating purposes.
|
|
127
|
+
*/
|
|
128
|
+
multilineTruncated?: boolean;
|
|
120
129
|
}
|
|
121
130
|
/**
|
|
122
131
|
* Verdict returned by comparing two scans of the SAME skill to detect a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/security/scanner/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH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BAAkB;IACjC,SAAS,EAAE,MAAM,CAAA;IACjB,iBAAiB,EAAE,MAAM,CAAA;IACzB,aAAa,EAAE,MAAM,CAAA;IACrB,gBAAgB,EAAE,MAAM,CAAA;IACxB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,cAAc,EAAE,MAAM,CAAA;IACtB,cAAc,EAAE,MAAM,CAAA;IACtB,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;IACX,aAAa,EAAE,MAAM,CAAA;IACrB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,SAAS,EAAE,MAAM,CAAA;IACjB,gBAAgB,EAAE,MAAM,CAAA;IACxB,cAAc,EAAE,MAAM,CAAA;IACtB,cAAc,EAAE,MAAM,CAAA;IACtB,cAAc,EAAE,MAAM,CAAA;IACtB,iBAAiB,EAAE,MAAM,CAAA;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,OAAO,CAAA;IACf,QAAQ,EAAE,eAAe,EAAE,CAAA;IAC3B,SAAS,EAAE,IAAI,CAAA;IACf,cAAc,EAAE,MAAM,CAAA;IACtB,0EAA0E;IAC1E,SAAS,EAAE,MAAM,CAAA;IACjB,0CAA0C;IAC1C,aAAa,EAAE,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/security/scanner/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAC3B,KAAK,GACL,gBAAgB,GAChB,WAAW,GACX,oBAAoB,GACpB,oBAAoB,GACpB,gBAAgB,GAChB,mBAAmB,GACnB,sBAAsB,GACtB,YAAY,GACZ,MAAM,GACN,KAAK,GACL,gBAAgB,GAChB,sBAAsB,GACtB,WAAW,GACX,mBAAmB,GACnB,iBAA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Aa,CAAC,EAAE,MAAM,CAAA;IACtB,sEAAsE;IACtE,wBAAwB,CAAC,EAAE,wBAAwB,CAAA;CACpD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-source.d.ts","sourceRoot":"","sources":["../../../../src/services/agent-pack/prompt-source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAE5E,mFAAmF;AACnF,eAAO,MAAM,gBAAgB,EAAE,SAAS,MAAM,EAI7C,CAAA;AAED,0DAA0D;AAC1D,eAAO,MAAM,oBAAoB,EAAE,SAAS,MAAM,EAIjD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,SAAS,WAAW,EA+B/C,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,IAAI,EAAE,SAAS,aAAa,EA0ExC,CAAA;AAED,mEAAmE;AACnE,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EAI/C,CAAA;AAED,0FAA0F;AAC1F,eAAO,MAAM,gBAAgB,EAAE,SAAS,cAAc,EAgBrD,CAAA;AAED,oFAAoF;AACpF,eAAO,MAAM,eAAe,EAAE,SAAS,MAAM,EAI5C,CAAA;AAED,wDAAwD;AACxD,eAAO,MAAM,QAAQ,EAAE,SAAS,MAAM,EAMrC,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,uBAAuB,EAAE,SAAS,MAAM,EAEpD,CAAA;AAED,0EAA0E;AAC1E,eAAO,MAAM,qBAAqB,EAAE,SAAS,MAAM,
|
|
1
|
+
{"version":3,"file":"prompt-source.d.ts","sourceRoot":"","sources":["../../../../src/services/agent-pack/prompt-source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAE5E,mFAAmF;AACnF,eAAO,MAAM,gBAAgB,EAAE,SAAS,MAAM,EAI7C,CAAA;AAED,0DAA0D;AAC1D,eAAO,MAAM,oBAAoB,EAAE,SAAS,MAAM,EAIjD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,SAAS,WAAW,EA+B/C,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,IAAI,EAAE,SAAS,aAAa,EA0ExC,CAAA;AAED,mEAAmE;AACnE,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EAI/C,CAAA;AAED,0FAA0F;AAC1F,eAAO,MAAM,gBAAgB,EAAE,SAAS,cAAc,EAgBrD,CAAA;AAED,oFAAoF;AACpF,eAAO,MAAM,eAAe,EAAE,SAAS,MAAM,EAI5C,CAAA;AAED,wDAAwD;AACxD,eAAO,MAAM,QAAQ,EAAE,SAAS,MAAM,EAMrC,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,uBAAuB,EAAE,SAAS,MAAM,EAEpD,CAAA;AAED,0EAA0E;AAC1E,eAAO,MAAM,qBAAqB,EAAE,SAAS,MAAM,EAelD,CAAA;AAED,8EAA8E;AAC9E,eAAO,MAAM,iBAAiB,4NAC6L,CAAA;AAE3N,6EAA6E;AAC7E,eAAO,MAAM,gBAAgB,+bACuZ,CAAA"}
|
|
@@ -200,8 +200,9 @@ export const CLI_FALLBACK_PARAGRAPHS = [
|
|
|
200
200
|
/** Command lines for the CLI Fallback fenced code block, one per line. */
|
|
201
201
|
export const CLI_FALLBACK_COMMANDS = [
|
|
202
202
|
'# Keep skills current',
|
|
203
|
-
'skillsmith diff <skill>
|
|
204
|
-
'skillsmith update
|
|
203
|
+
'skillsmith diff <skill> # what changed since your installed version',
|
|
204
|
+
'skillsmith update --all --dry-run # review updates first',
|
|
205
|
+
'skillsmith update <skill> # then update one skill at a time',
|
|
205
206
|
'',
|
|
206
207
|
'# Audit and clean up inventory',
|
|
207
208
|
'skillsmith audit collisions',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-source.js","sourceRoot":"","sources":["../../../../src/services/agent-pack/prompt-source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,mFAAmF;AACnF,MAAM,CAAC,MAAM,gBAAgB,GAAsB;IACjD,gMAAgM;IAChM,kYAAkY;IAClY,qUAAqU;CACtU,CAAA;AAED,0DAA0D;AAC1D,MAAM,CAAC,MAAM,oBAAoB,GAAsB;IACrD,kYAAkY;IAClY,wMAAwM;IACxM,2JAA2J;CAC5J,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAA2B;IACnD;QACE,EAAE,EAAE,qBAAqB;QACzB,KAAK,EAAE,yCAAyC;QAChD,IAAI,EAAE,sUAAsU;KAC7U;IACD;QACE,EAAE,EAAE,wBAAwB;QAC5B,KAAK,EAAE,wDAAwD;QAC/D,IAAI,EAAE,qRAAqR;KAC5R;IACD;QACE,EAAE,EAAE,YAAY;QAChB,KAAK,EAAE,qCAAqC;QAC5C,IAAI,EAAE,wPAAwP;KAC/P;IACD;QACE,EAAE,EAAE,gBAAgB;QACpB,KAAK,EAAE,8BAA8B;QACrC,IAAI,EAAE,sTAAsT;KAC7T;IACD;QACE,EAAE,EAAE,aAAa;QACjB,KAAK,EAAE,iCAAiC;QACxC,IAAI,EAAE,4PAA4P;KACnQ;IACD;QACE,EAAE,EAAE,kBAAkB;QACtB,KAAK,EAAE,2CAA2C;QAClD,IAAI,EAAE,ieAAie;KACxe;CACF,CAAA;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,IAAI,GAA6B;IAC5C;QACE,EAAE,EAAE,cAAc;QAClB,KAAK,EAAE,wBAAwB;QAC/B,IAAI,EAAE;YACJ,uFAAuF;YACvF,oIAAoI;YACpI,sNAAsN;YACtN,6GAA6G;YAC7G,8bAA8b;YAC9b,+JAA+J;SAChK,CAAC,IAAI,CAAC,IAAI,CAAC;QACZ,KAAK,EAA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C9C,IAAI,EAAE,sTAAsT;KAC7T;IACD;QACE,EAAE,EAAE,IAAI;QACR,KAAK,EAAE,qCAAqC;QAC5C,IAAI,EAAE,wOAAwO;KAC/O;IACD;QACE,EAAE,EAAE,IAAI;QACR,KAAK,EAAE,+BAA+B;QACtC,IAAI,EAAE,uQAAuQ;KAC9Q;CACF,CAAA;AAED,oFAAoF;AACpF,MAAM,CAAC,MAAM,eAAe,GAAsB;IAChD,mTAAmT;IACnT,sJAAsJ;IACtJ,sZAAsZ;CACvZ,CAAA;AAED,wDAAwD;AACxD,MAAM,CAAC,MAAM,QAAQ,GAAsB;IACzC,2EAA2E;IAC3E,0HAA0H;IAC1H,wGAAwG;IACxG,iFAAiF;IACjF,qFAAqF;CACtF,CAAA;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAsB;IACxD,8PAA8P;CAC/P,CAAA;AAED,0EAA0E;AAC1E,MAAM,CAAC,MAAM,qBAAqB,GAAsB;IACtD,uBAAuB;IACvB,
|
|
1
|
+
{"version":3,"file":"prompt-source.js","sourceRoot":"","sources":["../../../../src/services/agent-pack/prompt-source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,mFAAmF;AACnF,MAAM,CAAC,MAAM,gBAAgB,GAAsB;IACjD,gMAAgM;IAChM,kYAAkY;IAClY,qUAAqU;CACtU,CAAA;AAED,0DAA0D;AAC1D,MAAM,CAAC,MAAM,oBAAoB,GAAsB;IACrD,kYAAkY;IAClY,wMAAwM;IACxM,2JAA2J;CAC5J,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAA2B;IACnD;QACE,EAAE,EAAE,qBAAqB;QACzB,KAAK,EAAE,yCAAyC;QAChD,IAAI,EAAE,sUAAsU;KAC7U;IACD;QACE,EAAE,EAAE,wBAAwB;QAC5B,KAAK,EAAE,wDAAwD;QAC/D,IAAI,EAAE,qRAAqR;KAC5R;IACD;QACE,EAAE,EAAE,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B;IACvB,iFAAiF;IACjF,4DAA4D;IAC5D,uEAAuE;IACvE,EAAE;IACF,gCAAgC;IAChC,6BAA6B;IAC7B,EAAE;IACF,iCAAiC;IACjC,6CAA6C;IAC7C,uCAAuC;IACvC,mDAAmD;IACnD,uCAAuC;IACvC,0CAA0C;CAC3C,CAAA;AAED,8EAA8E;AAC9E,MAAM,CAAC,MAAM,iBAAiB,GAC5B,yNAAyN,CAAA;AAE3N,6EAA6E;AAC7E,MAAM,CAAC,MAAM,gBAAgB,GAC3B,kbAAkb,CAAA"}
|
|
@@ -60,8 +60,13 @@ import type { ManifestManager } from './skill-manifest.js';
|
|
|
60
60
|
* - any key that, after `path.resolve()` against `installPath`, resolves
|
|
61
61
|
* outside `installPath` (a lexical backstop behind the checks above,
|
|
62
62
|
* matching `writeInstallFiles()`'s own lexical escape check);
|
|
63
|
-
* - two keys that `path.normalize()` to the same on-disk path
|
|
64
|
-
*
|
|
63
|
+
* - two keys that `path.normalize()` to the same on-disk path CASE
|
|
64
|
+
* -INSENSITIVELY (SMI-6529 M4/M9) — a collision on any filesystem, but
|
|
65
|
+
* specifically catches a case-insensitive alias (e.g. "SKILL.md" and
|
|
66
|
+
* "skill.md" — literally the same inode on default APFS) that a
|
|
67
|
+
* case-sensitive string comparison would miss, in addition to the
|
|
68
|
+
* exact-string collision it already caught (e.g. "SKILL.md" and
|
|
69
|
+
* "./SKILL.md").
|
|
65
70
|
*/
|
|
66
71
|
export declare function validateContentKeys(content: Record<string, string>, installPath: string): {
|
|
67
72
|
valid: true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill-installation.content.d.ts","sourceRoot":"","sources":["../../../src/services/skill-installation.content.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAIH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAC3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,KAAK,EACV,gBAAgB,EAChB,yBAAyB,EACzB,aAAa,EACd,MAAM,+BAA+B,CAAA;AAEtC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"skill-installation.content.d.ts","sourceRoot":"","sources":["../../../src/services/skill-installation.content.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAIH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAC3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,KAAK,EACV,gBAAgB,EAChB,yBAAyB,EACzB,aAAa,EACd,MAAM,+BAA+B,CAAA;AAEtC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAuD1D;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,WAAW,EAAE,MAAM,GAClB;IAAE,KAAK,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAqCnD;AA8DD;;yCAEyC;AACzC,MAAM,WAAW,wBAAyB,SAAQ,yBAAyB;IACzE,EAAE,EAAE,QAAQ,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,eAAe,CAAA;IACzB,MAAM,EAAE,QAAQ,CAAA;IAChB,UAAU,EAAE,gBAAgB,CAAA;IAC5B;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,aAAa,CAAC,CAuMjG"}
|