Skip to content

Commit bb6d430

Browse files
committed
Clear the dependency advisories and gate them in CI
The full-workspace audit returned 88 advisory records across 78 unique advisories. The lockfile now resolves clean at every severity. Runtime: ws to 8.21.3, protobufjs, React Router to 7.18.2, find-my-way, ip-address, and fast-uri move to patched floors. tar is dropped outright — nothing has imported it since the hosted ripgrep bootstrap was removed. Browser: Mermaid to 11.17.0 and DOMPurify to a patched release. Monaco has no release carrying the fix, so patches/monaco-editor@0.55.1.patch pins its bundled DOMPurify. That patch has to reach the Nix build too, so flake.nix adds ./patches to the fileset alongside the refreshed pnpmDeps hash — without it the Nix build installs an unpatched Monaco while every other build path gets the patched one. Tooling: Vite to 6.4.3, plus esbuild, PostCSS, nanoid, brace-expansion, js-yaml, linkify-it, qs, and body-parser. Fixing the versions once is not the same as keeping them fixed, so this also adds the guards: dependabot for the update stream, CodeQL for source analysis, and security.yml, which packs the CLI tarball and the VSIX and audits what those artifacts actually ship — a clean lockfile says nothing about what ends up inside a published package. check-artifacts.mjs asserts the Monaco patch survived install rather than trusting that it did. docs/security/dependency-remediation-2026-08.md records the evidence and the ownership split behind each floor.
1 parent 535b2a9 commit bb6d430

242 files changed

Lines changed: 7374 additions & 5008 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/dependabot.yml

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,11 @@ updates:
44
directory: "/"
55
schedule:
66
interval: "weekly"
7-
# Scheduled version-update PRs are disabled on purpose: this workspace's
8-
# engines.node (>=24.15.0 <25) exceeds the Node.js version Dependabot's own
9-
# updater sandbox ships, so ANY `pnpm install`/update it attempts hard-fails
10-
# with ERR_PNPM_UNSUPPORTED_ENGINE (root .npmrc sets engine-strict=true).
11-
# See dependabot/dependabot-core#7426, #4072, #12976 — there is no
12-
# dependabot.yml-level fix; the real fix is lowering engines.node or
13-
# disabling engine-strict in .npmrc, both out of scope here. This entry
14-
# exists only so the `ignore` rules below apply to security-update PRs,
15-
# which open-pull-requests-limit: 0 does not suppress.
7+
# Scheduled version updates remain disabled because Dependabot's updater
8+
# does not satisfy this workspace's strict Node 24.15 engine requirement.
9+
# Security updates remain enabled and no dependency is ignored.
1610
open-pull-requests-limit: 0
17-
ignore:
18-
# Both advisories are on vite/esbuild resolved transitively through
19-
# docs/package.json's vitepress@1.6.4 (vite@5.4.21 in pnpm-lock.yaml),
20-
# a dev-only docs-site dependency. vitepress@1.6.4 pins `vite: 5.4.21`
21-
# as a hard (non-peer) dependency, so pnpm cannot resolve a fix without
22-
# vitepress 2 (alpha only as of 2026-08) — every attempt reopens the
23-
# same failing PR. Unscoped by version on purpose: Dependabot's actual
24-
# target version for this resolution is unverifiable (no open
25-
# Dependabot PRs exist in this repo to read a target off of, and the
26-
# target is not necessarily the advisory's first-patched version), so a
27-
# version-scoped rule can silently fail to match and let the PR back
28-
# in. Cost: this also suppresses vite/esbuild security-update PRs for
29-
# apps/*, which today sit at patched vite@6.4.3+ directly — revisit if
30-
# that changes. Drop both rules once docs/package.json moves to
31-
# vitepress 2 stable.
32-
- dependency-name: "vite"
33-
- dependency-name: "esbuild"
11+
- package-ecosystem: "github-actions"
12+
directory: "/"
13+
schedule:
14+
interval: "weekly"

.github/workflows/codeql.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: CodeQL
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
schedule:
8+
- cron: '43 4 * * 1'
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: read
13+
security-events: write
14+
15+
jobs:
16+
analyze:
17+
name: CodeQL
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 30
20+
steps:
21+
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
22+
with:
23+
persist-credentials: false
24+
- uses: github/codeql-action/init@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4
25+
with:
26+
build-mode: none
27+
languages: javascript-typescript
28+
queries: security-extended
29+
- uses: github/codeql-action/analyze@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4
30+
with:
31+
category: /language:javascript-typescript

.github/workflows/security.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Security
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
schedule:
8+
- cron: '17 4 * * *'
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
audit:
16+
name: Security audit
17+
runs-on: ubuntu-latest
18+
timeout-minutes: 10
19+
steps:
20+
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
21+
with:
22+
persist-credentials: false
23+
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
24+
- uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
25+
with:
26+
node-version-file: .nvmrc
27+
- run: pnpm audit --json
28+
29+
dependency-review:
30+
name: Dependency review
31+
if: github.event_name == 'pull_request'
32+
runs-on: ubuntu-latest
33+
timeout-minutes: 10
34+
steps:
35+
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
36+
with:
37+
persist-credentials: false
38+
- uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 # v5.0.0
39+
with:
40+
fail-on-scopes: runtime, development, unknown
41+
fail-on-severity: low
42+
vulnerability-check: true
43+
44+
artifact-security:
45+
name: Artifact security
46+
if: github.event_name != 'schedule'
47+
runs-on: ubuntu-latest
48+
timeout-minutes: 45
49+
steps:
50+
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
51+
with:
52+
persist-credentials: false
53+
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
54+
- uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
55+
with:
56+
node-version-file: .nvmrc
57+
cache: pnpm
58+
- run: pnpm install --frozen-lockfile
59+
- run: pnpm -C apps/desktop run package
60+
- run: pnpm -C docs run build
61+
- run: mkdir -p .tmp/security-artifacts/cli .tmp/security-artifacts/vsix
62+
- run: pnpm --filter @pymodel/pythinker-code pack --pack-destination "${{ github.workspace }}/.tmp/security-artifacts/cli"
63+
- run: pnpm --filter pythinker run package:platform -- --target linux-x64 --out-dir "${{ github.workspace }}/.tmp/security-artifacts/vsix"
64+
- run: pnpm -C apps/pythinker-code run smoke
65+
- run: pnpm run check:security-artifacts

SECURITY.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,17 @@ Alternative channel:
2626

2727
## Our Response
2828

29-
We will acknowledge your report and provide an initial assessment as soon as we can.
29+
We triage Critical and High reports within 24 hours. We target a fix within 72 hours for
30+
Critical and High issues, 7 days for Medium issues, and 30 days for Low issues.
31+
32+
## Dependency Vulnerability Policy
33+
34+
Pull requests cannot add a vulnerability at any severity. The repository uses a full-workspace
35+
audit because build and package steps can ship workspace code declared as a development
36+
dependency. A production-only audit is informational and is not a security gate.
37+
38+
If a vulnerability is disclosed after clean code reaches `main`, the response times above apply.
39+
Dismissed or auto-dismissed alert state does not make a vulnerable dependency acceptable.
3040

3141
## Public Disclosure
3242

apps/desktop/scripts/stage-runtime.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ async function deploy(target: string): Promise<void> {
112112
await run('pnpm', [
113113
'--config.verify-deps-before-run=false', '--filter', deployPackage, 'deploy', '--legacy', '--prod',
114114
'--config.node-linker=hoisted', '--config.auto-install-peers=false', '--config.link-workspace-packages=true',
115+
'--config.allow-unused-patches=true',
115116
deployTargetArgument(repositoryRoot, target),
116117
])
117118
} finally {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"sourceHash": "5fa1f4113f68cc5a0de3b4985ae517b47ca98f832e89e97cf636845fd3a2cd67",
2+
"sourceHash": "6c3eea494011bc65aa88d7fd6e889fd882255b4d60e720cc332566f9b5b58da0",
33
"sourceFileCount": 388
44
}

0 commit comments

Comments
 (0)