@codyswann/lisa 4.96.2 → 4.96.3
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/README.md +7 -0
- package/all/copy-overwrite/scripts/lisa-audit.mjs +59 -0
- package/all/copy-overwrite/scripts/lisa-gates.mjs +30 -13
- package/all/copy-overwrite/scripts/npm-updater-helper-graph.json +1 -1
- package/dist/cli/doctor-readiness-audit-allowlist.d.ts +19 -2
- package/dist/cli/doctor-readiness-audit-allowlist.d.ts.map +1 -1
- package/dist/cli/doctor-readiness-audit-allowlist.js +70 -17
- package/dist/cli/doctor-readiness-audit-allowlist.js.map +1 -1
- package/dist/cli/doctor-readiness-audit-scope.d.ts +24 -0
- package/dist/cli/doctor-readiness-audit-scope.d.ts.map +1 -0
- package/dist/cli/doctor-readiness-audit-scope.js +165 -0
- package/dist/cli/doctor-readiness-audit-scope.js.map +1 -0
- package/dist/cli/doctor-readiness-supply-chain-scan.js +1 -1
- package/dist/cli/doctor-readiness-supply-chain-scan.js.map +1 -1
- package/dist/cli/doctor-readiness-supply-chain.d.ts.map +1 -1
- package/dist/cli/doctor-readiness-supply-chain.js +4 -2
- package/dist/cli/doctor-readiness-supply-chain.js.map +1 -1
- package/dist/core/audit-capture.d.ts +31 -0
- package/dist/core/audit-capture.d.ts.map +1 -0
- package/dist/core/audit-capture.js +82 -0
- package/dist/core/audit-capture.js.map +1 -0
- package/dist/core/audit-exclusions.d.ts +32 -0
- package/dist/core/audit-exclusions.d.ts.map +1 -0
- package/dist/core/audit-exclusions.js +109 -0
- package/dist/core/audit-exclusions.js.map +1 -0
- package/dist/core/audit-field-names.d.ts +32 -0
- package/dist/core/audit-field-names.d.ts.map +1 -0
- package/dist/core/audit-field-names.js +107 -0
- package/dist/core/audit-field-names.js.map +1 -0
- package/dist/core/audit-lockfile.d.ts +9 -0
- package/dist/core/audit-lockfile.d.ts.map +1 -0
- package/dist/core/audit-lockfile.js +197 -0
- package/dist/core/audit-lockfile.js.map +1 -0
- package/dist/core/audit-manager.d.ts +8 -0
- package/dist/core/audit-manager.d.ts.map +1 -0
- package/dist/core/audit-manager.js +94 -0
- package/dist/core/audit-manager.js.map +1 -0
- package/dist/core/audit-matcher.d.ts +10 -0
- package/dist/core/audit-matcher.d.ts.map +1 -0
- package/dist/core/audit-matcher.js +103 -0
- package/dist/core/audit-matcher.js.map +1 -0
- package/dist/core/audit-report.d.ts +9 -0
- package/dist/core/audit-report.d.ts.map +1 -0
- package/dist/core/audit-report.js +132 -0
- package/dist/core/audit-report.js.map +1 -0
- package/dist/core/audit-types.d.ts +31 -0
- package/dist/core/audit-types.d.ts.map +1 -0
- package/dist/core/audit-types.js +2 -0
- package/dist/core/audit-types.js.map +1 -0
- package/dist/core/audit.d.ts +25 -0
- package/dist/core/audit.d.ts.map +1 -0
- package/dist/core/audit.js +53 -0
- package/dist/core/audit.js.map +1 -0
- package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
- package/dist/core/lisa-owned-hash-ledger.js +40 -0
- package/dist/core/lisa-owned-hash-ledger.js.map +1 -1
- package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
- package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
- package/dist/core/upstream-evidence-manifest.js +52 -9
- package/dist/core/upstream-evidence-manifest.js.map +1 -1
- package/package.json +11 -6
- package/plugins/lisa/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa/rules/eager/security-audit-handling.md +2 -2
- package/plugins/lisa/rules/reference/security-audit-handling.md +9 -0
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-agy/plugin.json +1 -1
- package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/rules/eager/security-audit-handling.md +2 -2
- package/plugins/lisa-copilot/rules/reference/security-audit-handling.md +9 -0
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/rules/security-audit-handling-reference.mdc +9 -0
- package/plugins/lisa-cursor/rules/security-audit-handling.mdc +2 -2
- package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/rules/eager/security-audit-handling.md +2 -2
- package/plugins/lisa-devin/rules/reference/security-audit-handling.md +9 -0
- package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-agy/plugin.json +1 -1
- package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-agy/plugin.json +1 -1
- package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-agy/plugin.json +1 -1
- package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-agy/plugin.json +1 -1
- package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-agy/plugin.json +1 -1
- package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-agy/plugin.json +1 -1
- package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-agy/plugin.json +1 -1
- package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/src/base/rules/eager/security-audit-handling.md +2 -2
- package/plugins/src/base/rules/reference/security-audit-handling.md +9 -0
- package/scripts/lisa-audit.mjs +59 -0
- package/scripts/two-channel-couplings.json +2 -2
- package/typescript/copy-contents/.husky/pre-push +5 -124
- package/typescript/copy-overwrite/.prettierignore +1 -0
- package/typescript/copy-overwrite/audit.ignore.config.json +6 -6
- package/typescript/package-lisa/package.lisa.json +4 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lisa-openclaw",
|
|
3
|
-
"version": "4.96.
|
|
3
|
+
"version": "4.96.3",
|
|
4
4
|
"description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Cody Swann"
|
|
@@ -10,7 +10,7 @@ For each high/critical advisory the gate reports, take the **first** action that
|
|
|
10
10
|
2. **If an upgrade isn't possible** (no compatible patched version on the dependency graph): **force a resolution/override** on the vulnerable leaf package (both `resolutions` and `overrides`), regenerate the lockfile, retry. Done.
|
|
11
11
|
3. **If an override isn't possible either** (would break a dependent, or no fixed version exists anywhere): **evaluate whether the advisory actually affects this project** — is the vulnerable code path reachable, does it process untrusted input, is it runtime vs. dev/build-only?
|
|
12
12
|
4. **If it does affect the project** and neither (1) nor (2) was possible: **ask a human** what to do. This is the only rung that pauses for a person.
|
|
13
|
-
5. **If it does not affect the project**: **add a documented exclusion yourself** to `audit.ignore.local.json` (`
|
|
13
|
+
5. **If it does not affect the project**: **add a documented exclusion yourself** to `audit.ignore.local.json` (`id`, `package`, `reason` = impact evaluation; dev-only copy: add `versions`, `paths`; see https://github.com/CodySwannGT/lisa/blob/main/docs/dependency-audit-exclusions.md), commit, retry. No human approval needed.
|
|
14
14
|
|
|
15
15
|
Steps 1, 2, 3, and 5 are autonomous. Only step 4 escalates.
|
|
16
16
|
|
|
@@ -31,7 +31,7 @@ If those checks fail, the override is "not possible" — drop to step 3.
|
|
|
31
31
|
|
|
32
32
|
- Never add a blanket audit bypass or lower the configured audit level.
|
|
33
33
|
- Never escalate to a human (step 4) before genuinely attempting steps 1–3.
|
|
34
|
-
- Never add an ignore entry (step 5) without an impact evaluation recorded in its `reason`. (
|
|
34
|
+
- Never add an ignore entry (step 5) without an impact evaluation recorded in its `reason`. (`lisa doctor` flags an exclusion with no written decision; the audit itself does not read `reason`.)
|
|
35
35
|
|
|
36
36
|
## Rails (bundler-audit)
|
|
37
37
|
|
|
@@ -23,6 +23,15 @@ Steps 1, 2, 3, and 5 are autonomous. Do not stop and ask the user except at step
|
|
|
23
23
|
5. **Step 3 — evaluate impact:** If neither an upgrade nor an override is possible (no fixed version exists, or every compatible pin breaks a dependent), determine whether the vulnerability actually affects this project. Consider: is the vulnerable code path reachable from this project's usage? Does it process untrusted input? Is the dependency runtime, or dev/build-only? Record the conclusion.
|
|
24
24
|
6. **Step 4 — escalate:** If the evaluation shows the vulnerability **does** affect the project and neither step 1 nor step 2 was possible, ask the user what to do. This is the only step that pauses for a human.
|
|
25
25
|
7. **Step 5 — ignore:** If the evaluation shows the vulnerability **does not** affect the project, add an exclusion entry to `audit.ignore.local.json` yourself, in the format `{"id": "GHSA-xxx", "package": "pkg-name", "reason": "<impact evaluation: why this advisory does not affect this project>"}`, then commit and retry the push. No human approval is required for this step — the `reason` field is the record of your evaluation.
|
|
26
|
+
- **Scope the exclusion to the copy you evaluated.** An entry with only `id` (and `package`) hides the advisory for every copy of the package, including one a production dependency pulls in later. Two optional fields narrow it, and every field present must hold together:
|
|
27
|
+
- `versions` — a semver range the excused installed copies must fall inside, such as `">=3.0.0 <4.0.0"`.
|
|
28
|
+
- `paths` — a non-empty array of exact lockfile key paths for the excused copies: a `bun.lock` `packages` key such as `"lint-plugin/pkg"`, a `package-lock.json` `packages` key such as `"node_modules/lint-plugin/node_modules/pkg"`, or a `yarn.lock` selector key. No globs. Bun keys and nested npm keys isolate one parent. A `yarn.lock` selector names a requested range, not a parent, and a hoisted npm key (`"node_modules/pkg"`) names an install location; any later dependent that asks for that range or resolves to that hoisted copy is covered too, so pair those keys with a tight `versions` range.
|
|
29
|
+
- `package` is the lowercase npm name the audit reports (`tar`, not `node-tar`). A misspelled scope field (`path`, `version`, `Paths`) fails the audit instead of silently excusing every copy; other extra keys are ignored.
|
|
30
|
+
- **Whenever the vulnerable copy is dev-only** (reached only through a devDependency, such as a lint plugin pinned to an old major), add `versions` and `paths` rather than an ID-wide entry:
|
|
31
|
+
```json
|
|
32
|
+
{"id": "GHSA-xxx", "package": "pkg", "versions": ">=3.0.0 <4.0.0", "paths": ["lint-plugin/pkg"], "reason": "<impact evaluation>"}
|
|
33
|
+
```
|
|
34
|
+
Then any other vulnerable copy — on an unlisted path or through an npm alias — still fails the audit and is named by its lockfile path. An empty `paths` array, an invalid range, or an unreadable lockfile fails the audit with a diagnostic; it never widens into an ID-wide exclusion. The pre-push hook, the gate registry, and CI use the same matcher. `lisa doctor` checks the scope fields and that the lockfile is readable, and reports any remaining exclusion without `versions` or `paths`, but it does not match advisories against lockfile copies — a valid-looking path that names the wrong copy can pass doctor and still be rejected by the audit. Doctor also does not reject an entry with no `id` or an exclusion file that does not parse; the audit does. Only the audit proves the exclusion files are accepted. In CI, the reusable workflow audits the manager its `package_manager` input names (default `npm`), so set that input to the project's manager. A scoped entry always wins over a wider entry for the same advisory and package. Full contract: https://github.com/CodySwannGT/lisa/blob/main/docs/dependency-audit-exclusions.md
|
|
26
35
|
|
|
27
36
|
### Critical: Override the vulnerable package, not its parent
|
|
28
37
|
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// This file is managed by Lisa and IS replaced on each `lisa` run.
|
|
3
|
+
// Do not edit directly — durable changes belong upstream in Lisa.
|
|
4
|
+
|
|
5
|
+
/** Resolve the current Lisa package's canonical audit implementation. */
|
|
6
|
+
import { readFileSync } from "node:fs";
|
|
7
|
+
import { pathToFileURL } from "node:url";
|
|
8
|
+
import { resolve } from "node:path";
|
|
9
|
+
|
|
10
|
+
try {
|
|
11
|
+
const root = process.cwd();
|
|
12
|
+
const manifest = JSON.parse(
|
|
13
|
+
readFileSync(resolve(root, "package.json"), "utf8")
|
|
14
|
+
);
|
|
15
|
+
const source =
|
|
16
|
+
manifest.name === "@codyswann/lisa"
|
|
17
|
+
? pathToFileURL(resolve(root, "dist/core/audit.js")).href
|
|
18
|
+
: "@codyswann/lisa/audit";
|
|
19
|
+
const { evaluateAuditReport, runDependencyAudit, detectAuditManager } =
|
|
20
|
+
await import(source);
|
|
21
|
+
const managerIndex = process.argv.indexOf("--manager");
|
|
22
|
+
const manager =
|
|
23
|
+
managerIndex < 0
|
|
24
|
+
? detectAuditManager(root)
|
|
25
|
+
: process.argv[managerIndex + 1];
|
|
26
|
+
if (!["bun", "npm", "yarn"].includes(manager))
|
|
27
|
+
throw new Error("Unsupported audit package manager");
|
|
28
|
+
const verdict = process.argv.includes("--stdin")
|
|
29
|
+
? evaluateAuditReport(root, manager, readFileSync(0, "utf8"))
|
|
30
|
+
: await runDependencyAudit(root, manager, {
|
|
31
|
+
attempts: process.env.LISA_AUDIT_ATTEMPTS,
|
|
32
|
+
retryDelay: process.env.LISA_AUDIT_RETRY_DELAY,
|
|
33
|
+
});
|
|
34
|
+
for (const message of verdict.messages) console.log(message);
|
|
35
|
+
console.log(
|
|
36
|
+
verdict.passed
|
|
37
|
+
? "✅ No high or critical vulnerabilities found in production dependencies (excluding documented exceptions)"
|
|
38
|
+
: "❌ High or critical vulnerabilities found in production dependencies"
|
|
39
|
+
);
|
|
40
|
+
if (!verdict.passed)
|
|
41
|
+
console.log(
|
|
42
|
+
" Next step: upgrade or override the named copy; if it is dev-only and reviewed, add its lockfile path to `paths` in audit.ignore.local.json — see https://github.com/CodySwannGT/lisa/blob/main/docs/dependency-audit-exclusions.md"
|
|
43
|
+
);
|
|
44
|
+
process.exitCode = verdict.passed ? 0 : 1;
|
|
45
|
+
} catch (error) {
|
|
46
|
+
// Two different failures, worded so a gate runner can tell them apart. A
|
|
47
|
+
// capture that produced no usable report audited nothing: re-run it. Any
|
|
48
|
+
// other error is the project's own exclusion or lockfile input, which no
|
|
49
|
+
// re-run will fix, so it is reported as an invalid configuration.
|
|
50
|
+
console.error(
|
|
51
|
+
error?.name === "AuditCaptureError" ||
|
|
52
|
+
["ERR_MODULE_NOT_FOUND", "ERR_PACKAGE_PATH_NOT_EXPORTED"].includes(
|
|
53
|
+
error?.code
|
|
54
|
+
)
|
|
55
|
+
? `❌ Security audit failed closed: ${error.message}`
|
|
56
|
+
: `❌ Security audit configuration invalid: ${error.message}`
|
|
57
|
+
);
|
|
58
|
+
process.exitCode = 1;
|
|
59
|
+
}
|
|
@@ -661,107 +661,11 @@ echo "🔒 Running security audit..."
|
|
|
661
661
|
if lisa_gate_covers dependency-vulnerability; then
|
|
662
662
|
echo "ℹ️ Covered by the dependency-vulnerability gate; the built-in audit stands down."
|
|
663
663
|
else
|
|
664
|
-
#
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
for _config_file in audit.ignore.config.json audit.ignore.local.json; do
|
|
668
|
-
if [ -f "$_config_file" ]; then
|
|
669
|
-
_FILE_IDS=$(jq -r '.exclusions[].id' "$_config_file" 2>/dev/null)
|
|
670
|
-
if [ -n "$_FILE_IDS" ]; then
|
|
671
|
-
_EXCLUSIONS="$_EXCLUSIONS $_FILE_IDS"
|
|
672
|
-
fi
|
|
673
|
-
fi
|
|
674
|
-
done
|
|
675
|
-
echo "$_EXCLUSIONS" | tr ' ' '\n' | sort -u | grep -v '^$' | tr '\n' ' '
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
# Load CVE exclusion IDs from JSON config files (for yarn's CVE-based filtering)
|
|
679
|
-
load_audit_cves() {
|
|
680
|
-
_CVES=""
|
|
681
|
-
for _config_file in audit.ignore.config.json audit.ignore.local.json; do
|
|
682
|
-
if [ -f "$_config_file" ]; then
|
|
683
|
-
_FILE_CVES=$(jq -r '.exclusions[] | select(.cve != null) | .cve' "$_config_file" 2>/dev/null)
|
|
684
|
-
if [ -n "$_FILE_CVES" ]; then
|
|
685
|
-
_CVES="$_CVES $_FILE_CVES"
|
|
686
|
-
fi
|
|
687
|
-
fi
|
|
688
|
-
done
|
|
689
|
-
echo "$_CVES" | tr ' ' '\n' | sort -u | grep -v '^$' | tr '\n' ' '
|
|
690
|
-
}
|
|
691
|
-
|
|
692
|
-
AUDIT_EXCLUSIONS=$(load_audit_exclusions)
|
|
693
|
-
AUDIT_CVES=$(load_audit_cves)
|
|
694
|
-
|
|
695
|
-
if [ "$PACKAGE_MANAGER" = "yarn" ]; then
|
|
696
|
-
# Build jq filter for GHSA IDs
|
|
697
|
-
GHSA_FILTER=""
|
|
698
|
-
for _id in $AUDIT_EXCLUSIONS; do
|
|
699
|
-
if [ -n "$GHSA_FILTER" ]; then
|
|
700
|
-
GHSA_FILTER="$GHSA_FILTER or .data.advisory.github_advisory_id == \"$_id\""
|
|
701
|
-
else
|
|
702
|
-
GHSA_FILTER=".data.advisory.github_advisory_id == \"$_id\""
|
|
703
|
-
fi
|
|
704
|
-
done
|
|
705
|
-
|
|
706
|
-
# Build jq filter for CVE IDs
|
|
707
|
-
CVE_FILTER=""
|
|
708
|
-
for _cve in $AUDIT_CVES; do
|
|
709
|
-
if [ -n "$CVE_FILTER" ]; then
|
|
710
|
-
CVE_FILTER="$CVE_FILTER or . == \"$_cve\""
|
|
711
|
-
else
|
|
712
|
-
CVE_FILTER=". == \"$_cve\""
|
|
713
|
-
fi
|
|
714
|
-
done
|
|
715
|
-
|
|
716
|
-
# Combine GHSA and CVE filters
|
|
717
|
-
COMBINED_FILTER=""
|
|
718
|
-
if [ -n "$GHSA_FILTER" ] && [ -n "$CVE_FILTER" ]; then
|
|
719
|
-
COMBINED_FILTER="($GHSA_FILTER or (.data.advisory.cves | any($CVE_FILTER)))"
|
|
720
|
-
elif [ -n "$GHSA_FILTER" ]; then
|
|
721
|
-
COMBINED_FILTER="($GHSA_FILTER)"
|
|
722
|
-
elif [ -n "$CVE_FILTER" ]; then
|
|
723
|
-
COMBINED_FILTER="((.data.advisory.cves | any($CVE_FILTER)))"
|
|
724
|
-
fi
|
|
725
|
-
|
|
726
|
-
if [ -n "$COMBINED_FILTER" ]; then
|
|
727
|
-
yarn audit --groups dependencies --json | jq -r "select(.type == \"auditAdvisory\") | select(.data.advisory.severity == \"high\" or .data.advisory.severity == \"critical\") | select(($COMBINED_FILTER) | not) | .data.advisory" > high_vulns.json
|
|
728
|
-
else
|
|
729
|
-
yarn audit --groups dependencies --json | jq -r 'select(.type == "auditAdvisory") | select(.data.advisory.severity == "high" or .data.advisory.severity == "critical") | .data.advisory' > high_vulns.json
|
|
730
|
-
fi
|
|
731
|
-
|
|
732
|
-
if [ -s high_vulns.json ]; then
|
|
733
|
-
echo "❌ High or critical vulnerabilities found in production dependencies!"
|
|
734
|
-
cat high_vulns.json
|
|
735
|
-
rm high_vulns.json
|
|
736
|
-
exit 1
|
|
737
|
-
fi
|
|
738
|
-
|
|
739
|
-
echo "✅ No high or critical vulnerabilities found in production dependencies (excluding known false positives)"
|
|
740
|
-
rm -f high_vulns.json
|
|
741
|
-
|
|
742
|
-
elif [ "$PACKAGE_MANAGER" = "npm" ]; then
|
|
743
|
-
# Build jq exclusion filter for npm audit GHSA IDs
|
|
744
|
-
NPM_EXCLUDE_FILTER=""
|
|
745
|
-
for _id in $AUDIT_EXCLUSIONS; do
|
|
746
|
-
if [ -n "$NPM_EXCLUDE_FILTER" ]; then
|
|
747
|
-
NPM_EXCLUDE_FILTER="$NPM_EXCLUDE_FILTER or . == \"$_id\""
|
|
748
|
-
else
|
|
749
|
-
NPM_EXCLUDE_FILTER=". == \"$_id\""
|
|
750
|
-
fi
|
|
751
|
-
done
|
|
752
|
-
|
|
753
|
-
AUDIT_JSON=$(npm audit --production --json 2>/dev/null || true)
|
|
754
|
-
if [ -n "$NPM_EXCLUDE_FILTER" ]; then
|
|
755
|
-
UNFIXED_HIGH=$(echo "$AUDIT_JSON" | jq "[.vulnerabilities | to_entries[] | select(.value.severity == \"high\" or .value.severity == \"critical\") | .value.via[] | select(type == \"object\") | .url | ltrimstr(\"https://github.com/advisories/\")] | unique | map(select($NPM_EXCLUDE_FILTER | not)) | length")
|
|
756
|
-
else
|
|
757
|
-
UNFIXED_HIGH=$(echo "$AUDIT_JSON" | jq '[.vulnerabilities | to_entries[] | select(.value.severity == "high" or .value.severity == "critical") | .value.via[] | select(type == "object") | .url | ltrimstr("https://github.com/advisories/")] | unique | length')
|
|
758
|
-
fi
|
|
759
|
-
if [ "$UNFIXED_HIGH" -gt 0 ]; then
|
|
760
|
-
echo "⚠️ Security audit failed. Please fix high/critical vulnerabilities before pushing."
|
|
664
|
+
# npm and yarn use the same canonical transport and scoped matcher as CI.
|
|
665
|
+
if [ "$PACKAGE_MANAGER" = "npm" ] || [ "$PACKAGE_MANAGER" = "yarn" ]; then
|
|
666
|
+
if ! node scripts/lisa-audit.mjs --manager "$PACKAGE_MANAGER"; then
|
|
761
667
|
exit 1
|
|
762
668
|
fi
|
|
763
|
-
echo "✅ No high or critical vulnerabilities found in production dependencies (excluding known false positives)"
|
|
764
|
-
|
|
765
669
|
elif [ "$PACKAGE_MANAGER" = "bun" ]; then
|
|
766
670
|
# NOTE: bun's `--ignore` flag is unreliable when many exclusions are passed
|
|
767
671
|
# (bun <=1.3.x silently stops applying ignores past a small count, leaking
|
|
@@ -921,33 +825,10 @@ else
|
|
|
921
825
|
exit 1
|
|
922
826
|
fi
|
|
923
827
|
rm -f "$AUDIT_OUTPUT" "$AUDIT_STDERR"
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
| [ .[]? | .[]?
|
|
927
|
-
| select(.severity == "high" or .severity == "critical")
|
|
928
|
-
| (.url | sub(".*/"; "")) as $g
|
|
929
|
-
| select(($ex | index($g)) | not)
|
|
930
|
-
| $g ]
|
|
931
|
-
| unique')
|
|
932
|
-
# A count that could not be computed is not a count of zero. The old `|| echo
|
|
933
|
-
# 0` turned a jq filter that errored — an audit whose JSON shape this hook
|
|
934
|
-
# does not understand — into "no vulnerabilities found", which is the same
|
|
935
|
-
# fail-open as the transport hole above, one step further down.
|
|
936
|
-
UNFIXED_COUNT=$(echo "$UNFIXED_HIGH" | jq -r 'length' 2>/dev/null || echo "")
|
|
937
|
-
if [ -z "$UNFIXED_COUNT" ]; then
|
|
938
|
-
echo "❌ Push blocked: the audit payload parsed, but the advisory filter" >&2
|
|
939
|
-
echo " produced no count, so no advisory was evaluated." >&2
|
|
940
|
-
echo " This is NOT a clean result. Re-run 'bun audit --production --json'" >&2
|
|
941
|
-
echo " to see the shape it returned." >&2
|
|
942
|
-
exit 1
|
|
943
|
-
fi
|
|
944
|
-
if [ "$UNFIXED_COUNT" -gt 0 ]; then
|
|
945
|
-
echo "⚠️ Security audit failed. Unresolved high/critical advisories in production dependencies:"
|
|
946
|
-
echo "$UNFIXED_HIGH" | jq -r '.[]'
|
|
947
|
-
echo "Fix them, or add the GHSA id to audit.ignore.local.json with a justification, before pushing."
|
|
828
|
+
# The captured report is evaluated once by the canonical scoped matcher.
|
|
829
|
+
if ! printf '%s\n' "$AUDIT_JSON" | node scripts/lisa-audit.mjs --manager bun --stdin; then
|
|
948
830
|
exit 1
|
|
949
831
|
fi
|
|
950
|
-
echo "✅ No high or critical vulnerabilities found in production dependencies (excluding known false positives)"
|
|
951
832
|
fi
|
|
952
833
|
fi
|
|
953
834
|
|
|
@@ -80,6 +80,7 @@ scripts/check-threshold-ratchet.mjs
|
|
|
80
80
|
scripts/check-verification-coverage.mjs
|
|
81
81
|
scripts/check-workflow-load-failures.mjs
|
|
82
82
|
scripts/classify-maestro-failures.mjs
|
|
83
|
+
scripts/lisa-audit.mjs
|
|
83
84
|
scripts/lisa-command-envelope.mjs
|
|
84
85
|
scripts/lisa-commit-msg-gates.mjs
|
|
85
86
|
scripts/lisa-cross-worktree-guard.mjs
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
{
|
|
10
10
|
"id": "GHSA-8qq5-rm4j-mr97",
|
|
11
|
-
"package": "
|
|
11
|
+
"package": "tar",
|
|
12
12
|
"reason": "Arbitrary file overwrite/symlink poisoning during tar extraction; requires extracting attacker-controlled archives, which no production code path does"
|
|
13
13
|
},
|
|
14
14
|
{
|
|
@@ -53,17 +53,17 @@
|
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
55
|
"id": "GHSA-r6q2-hw4h-h46w",
|
|
56
|
-
"package": "
|
|
56
|
+
"package": "tar",
|
|
57
57
|
"reason": "Race condition during tar extraction on macOS APFS; requires extracting attacker-controlled archives, which no production code path does"
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
"id": "GHSA-34x7-hfp2-rc4v",
|
|
61
|
-
"package": "
|
|
61
|
+
"package": "tar",
|
|
62
62
|
"reason": "Arbitrary file creation via hardlink path traversal during extraction; requires extracting attacker-controlled archives, which no production code path does"
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
65
|
"id": "GHSA-83g3-92jg-28cx",
|
|
66
|
-
"package": "
|
|
66
|
+
"package": "tar",
|
|
67
67
|
"reason": "Arbitrary file read/write via hardlink target escape during extraction; requires extracting attacker-controlled archives, which no production code path does"
|
|
68
68
|
},
|
|
69
69
|
{
|
|
@@ -74,13 +74,13 @@
|
|
|
74
74
|
{
|
|
75
75
|
"id": "GHSA-w532-jxjh-hjhj",
|
|
76
76
|
"cve": "CVE-2025-29907",
|
|
77
|
-
"package": "
|
|
77
|
+
"package": "jspdf",
|
|
78
78
|
"reason": "ReDoS requires attacker-controlled input to `addImage`. Keep this exclusion only if `addImage` is never called with untrusted image paths or buffers sourced from user input."
|
|
79
79
|
},
|
|
80
80
|
{
|
|
81
81
|
"id": "GHSA-8mvj-3j78-4qmw",
|
|
82
82
|
"cve": "CVE-2025-57810",
|
|
83
|
-
"package": "
|
|
83
|
+
"package": "jspdf",
|
|
84
84
|
"reason": "DoS requires attacker-controlled input to `addImage`. Keep this exclusion only if `addImage` is never called with untrusted image paths or buffers sourced from user input."
|
|
85
85
|
},
|
|
86
86
|
{
|
|
@@ -28,7 +28,8 @@
|
|
|
28
28
|
"test:node:lisa": "node scripts/lib/worktree-dependencies.mjs && LISA_TEST_SCRATCH_PREFIXES='[\"node-\"]' lisa-test-run --profile typescript --adapter direct -- node scripts/lisa-test-node.mjs",
|
|
29
29
|
"test:unit:lisa": "node scripts/lib/worktree-dependencies.mjs && lisa-test-run --profile typescript --adapter vitest -- vitest run --exclude='**/integration/**'",
|
|
30
30
|
"test:watch:lisa": "node scripts/lib/worktree-dependencies.mjs && lisa-test-run --profile typescript --adapter vitest -- vitest",
|
|
31
|
-
"typecheck:lisa": "node scripts/lib/worktree-dependencies.mjs && tsc --noEmit"
|
|
31
|
+
"typecheck:lisa": "node scripts/lib/worktree-dependencies.mjs && tsc --noEmit",
|
|
32
|
+
"security:audit:lisa": "node scripts/lisa-audit.mjs"
|
|
32
33
|
},
|
|
33
34
|
"devDependencies": {
|
|
34
35
|
"eslint-plugin-oxlint": "1.62.0",
|
|
@@ -94,7 +95,8 @@
|
|
|
94
95
|
"test:node": "$npm_execpath run test:node:lisa",
|
|
95
96
|
"test:unit": "$npm_execpath run test:unit:lisa",
|
|
96
97
|
"test:watch": "$npm_execpath run test:watch:lisa",
|
|
97
|
-
"typecheck": "$npm_execpath run typecheck:lisa"
|
|
98
|
+
"typecheck": "$npm_execpath run typecheck:lisa",
|
|
99
|
+
"security:audit": "$npm_execpath run security:audit:lisa"
|
|
98
100
|
},
|
|
99
101
|
"engines": {
|
|
100
102
|
"npm": "please-use-bun",
|