From e6cf826fd8a9882e62d70cfe1108758152cf4480 Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Fri, 20 Mar 2026 12:12:49 +0000 Subject: [PATCH] fix: patch flatted CVE-2026-32141 unbounded recursion DoS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add pnpm override for flatted >=3.4.0 to resolve Dependabot alert #78. The vulnerability allows a crafted payload to crash Node.js via unbounded recursion in flatted.parse(). The transitive dependency chain is: eslint → file-entry-cache → flat-cache → flatted. flat-cache@4.0.1 declares flatted@^3.2.9, which is semver-compatible with the patched 3.4.0+, so the override safely forces resolution to the fixed version (3.4.2) without breaking the dependency contract. --- AGENTS.md | 9 --------- package.json | 3 ++- pnpm-lock.yaml | 9 +++++---- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 4dc8385..5dbee80 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -3,15 +3,6 @@ ### Gotcha - -* **AGENTS.md must be excluded from markdown linters**: AGENTS.md is auto-managed by lore and uses \`\*\` list markers and long lines that violate typical remark-lint rules (unordered-list-marker-style, maximum-line-length). When a project uses remark with \`--frail\` (warnings become errors), AGENTS.md will fail CI. Fix: add \`AGENTS.md\` to \`.remarkignore\`. This applies to any lore-managed project with markdown linting. - - -* **Consola prompt cancel returns truthy Symbol, not false**: When a user cancels a \`consola\` / \`@clack/prompts\` confirmation prompt (Ctrl+C), the return value is \`Symbol(clack:cancel)\`, not \`false\`. Since Symbols are truthy in JavaScript, checking \`!confirmed\` will be \`false\` and the code falls through as if the user confirmed. Fix: use \`confirmed !== true\` (strict equality) instead of \`!confirmed\` to correctly handle cancel, false, and any other non-true values. - * **Craft v2 GitHub App must be installed per-repo**: The Craft v2 release/publish workflows use \`actions/create-github-app-token@v1\` which requires the GitHub App to be installed on the specific repository. If the app is configured for "Only select repositories", adding a new repo to the Craft pipeline requires manually adding it at GitHub Settings → Installations → \[App] → Configure. The \`APP\_ID\` variable and \`APP\_PRIVATE\_KEY\` secret are set in the \`production\` environment, not at repo level. Symptom: 404 on \`GET /repos/{owner}/{repo}/installation\`. - - -* **Zod z.coerce.number() converts null to 0 silently**: Zod gotchas in this codebase: (1) \`z.coerce.number()\` passes input through \`Number()\`, so \`null\` silently becomes \`0\`. Be aware if \`null\` vs \`0\` distinction matters. (2) Zod v4 \`.default({})\` short-circuits — it returns the default value without parsing through inner schema defaults. So \`.object({ enabled: z.boolean().default(true) }).default({})\` returns \`{}\`, not \`{ enabled: true }\`. Fix: provide fully-populated default objects. This affected nested config sections in src/config.ts during the v3→v4 upgrade. diff --git a/package.json b/package.json index 6753c05..692f982 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,8 @@ "pnpm": { "overrides": { "serialize-javascript": ">=7.0.3", - "diff": ">=8.0.3" + "diff": ">=8.0.3", + "flatted": ">=3.4.0" } }, "devDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index effbae3..ac57b33 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7,6 +7,7 @@ settings: overrides: serialize-javascript: '>=7.0.3' diff: '>=8.0.3' + flatted: '>=3.4.0' importers: @@ -608,8 +609,8 @@ packages: resolution: {integrity: sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==} hasBin: true - flatted@3.3.4: - resolution: {integrity: sha512-3+mMldrTAPdta5kjX2G2J7iX4zxtnwpdA8Tr2ZSjkyPSanvbZAcy6flmtnXbEybHrDcU9641lxrMfFuUxVz9vA==} + flatted@3.4.2: + resolution: {integrity: sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==} foreground-child@3.3.1: resolution: {integrity: sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==} @@ -2055,12 +2056,12 @@ snapshots: flat-cache@4.0.1: dependencies: - flatted: 3.3.4 + flatted: 3.4.2 keyv: 4.5.4 flat@5.0.2: {} - flatted@3.3.4: {} + flatted@3.4.2: {} foreground-child@3.3.1: dependencies: