Repository navigation
fix(deps): Mitigate brace recursion and shared-cache disclosure - #912
Merged
Merged
Conversation
Bound brace and parenthesis AST nesting and prevent max-stale from bypassing cache reuse restrictions. Cover both advisories with behavior regressions and include dependency patches in Docker builds.
Contributor
|
MathurAditya724
marked this pull request as ready for review
October 18, 2026 04:07
Use the workflow token through gh api for latest-release discovery and missing-tag fallback. Keep asset downloads free of authorization headers and exercise all installer branches in regression tests.
Protect the TTL path used by Astro and stale error fallback as well as direct request evaluation. Share the guard with maxAge, handle wildcard Vary values, and preserve public/private freshness behavior with regressions through the actual image loader.
Reject stale-if-error reuse across different URLs, hosts, methods, or Vary variants. Preserve matching variants and HEAD requests, with regressions for each request boundary.
BYK
approved these changes
Oct 19, 2026
8 tasks done
BYK
added a commit
that referenced
this pull request
Oct 23, 2026
…dvisories (#925) Fixes the open npm advisories that `pnpm audit` reports for the root and `docs/` lockfiles. The repo has no published security advisories. I couldn't read the Dependabot alerts list because the GitHub App returned 403 (it lacks `vulnerability_alerts: read`), so `pnpm audit` was the source. ### Root (`pnpm-lock.yaml`) | Package | From → To | How | Advisories | |---|---|---|---| | `follow-redirects` | 1.16.0 → 1.16.1 | new override (`http-proxy@1.18.1` is the latest release and still pins the vulnerable range) | GHSA-q3jh-wrc6-jgq8, GHSA-8r9p-f939-6h3c | | `vite` | 7.3.5 → 7.3.7 | devDep + existing override | GHSA-587h-7wmj-h5pm, GHSA-698v-4r3x-3vcv, GHSA-r825-w8mm-5pxw, GHSA-rq7h-c2jc-7f22, GHSA-9jrq-w75r-8gcw | | `vitest` / `@vitest/mocker` | 4.1.11 → 4.1.12 | devDep | GHSA-qxg6-89mg-rqv8, GHSA-xp26-3454-mjgp | `follow-redirects` comes in through `@vercel/client`, which is a runtime dependency. The others are dev-only. ### Docs (`docs/pnpm-lock.yaml`) | Package | From → To | How | Advisories | |---|---|---|---| | `astro` | 7.2.8 → 7.4.2 | `^7.3.3` range | GHSA-98hj-9722-w3j8, GHSA-mpr7-6m5w-76rw | | `zod` (4.x) | 4.3.6 / 4.6.1 → 4.6.7 | new override | GHSA-mrhx-c7xc-m3w5 | ### CI astro 7.4.2 requires Node `>=22.23.4`. `docs-preview.yml` pinned a bare `'22'`, which resolved to 22.23.3 on the runner and failed the preview build. It now uses `node-version-file: package.json` (Volta, 24.22.1), the same as the `Build Docs` job in `build.yml`. ### Not fixed here - **Root `zod` (GHSA-mrhx-c7xc-m3w5):** only 4.6.6+ has the fix. Craft uses `zod@^3` in `src/schemas`, and `@vercel/python-analysis` pins `zod@3.22.4` exactly. Fixing it means migrating to zod 4, which belongs in its own PR. The issue is memory exhaustion when validating huge collections. Craft only validates its own config files, so exposure is low. - **`braces@3.0.3` (GHSA-vfj7-8cjw-p6xm):** there's no upstream fix. #912 already patches it via `patches/braces@3.0.3.patch`. Dropping the patch would need `@sentry/esbuild-plugin` 2.x → 11.x, which removes the `unplugin@1`/`chokidar@3` chain. That's also a separate PR. ### Verification - `pnpm install --frozen-lockfile` (root and docs) ✅ - `pnpm audit`: root shows only the root zod advisory above; docs shows no known vulnerabilities ✅ - `pnpm lint`, `pnpm typecheck`, `pnpm build`, `./dist/craft --help` ✅ - `cd docs && pnpm build` (includes `node --test`) ✅ - CI: Node 22 and Node 24 test jobs, Build Docs, and Docs Preview all pass ✅ <!-- junior-request-attribution:start --> via **BYK**. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:local%3Aweb%3A98a0eb4fa5564185070025f9 --> -- [View Junior Session in Sentry](https://sentry.sentry.io/explore/conversations/local%3Aweb%3A98a0eb4fa5564185070025f9/?project=4510944073809921) <!-- junior-session-footer:end --> --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: BYK <burak.kaya@sentry.io>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mitigate the two open Dependabot alerts with pnpm dependency patches. Neither advisory currently identifies a fixed upstream release, and
http-cache-semantics@4.3.0still reproduces the reported cache-reuse flaw.braces@3.0.3AST nesting to 100 levels, counting both parentheses and braces. This protects both the runtime Vercel/micromatch dependency and the Sentry build plugin's watcher. Escaped, quoted, and character-class literals retain their behavior.max-stale,stale-while-revalidate, norstale-if-errorcan override non-storable,no-cache, shared-cookie, sharedproxy-revalidate, or wildcardVaryrestrictions.must-revalidateretains its fresh lifetime without stale extensions. Error fallback also checks URL, host, method, andVaryidentity before reusing a response. Ordinary expiry and explicitly public/private-cache cookie behavior remain supported.Add six root regressions and thirty-three docs regressions, including Astro's actual remote-image loader against the actual transitive packages. The docs build runs its regressions, and Docker copies the root patch before its frozen install. Patch provenance and removal criteria are documented in
patches/README.md.Authenticate Changelog Preview release discovery with the workflow token through
gh api, avoiding the unauthenticated 403 that blocked CI. Add three installer regressions covering latest, missing-tag fallback, and explicit tags; asset downloads do not receive authorization headers.Validation: reproduced the unsafe behavior before patching; all 39 security regressions pass afterward. Root and docs frozen installs pass with CI's pnpm 10.27.0. Type checking, lint, formatting, CLI build/
--help, and the 29-page docs build pass. Docs audit reports zero vulnerabilities.Local root-suite baseline (
TZ=UTC pnpm test): 1,561 passed, 3 skipped, 3 failed. The same failures reproduced on unmodified master on macOS: Action testuses the full workspace path in publish request titles, and dry-run E2E testsproduces consistent output format(temporary-path snapshot) andexecutes pre-release command and shows diff of changes(GNU/BSD sed). Docker could not be built locally because no daemon is running; hosted checks cover it.The root audit still reports the locally patched
braces@3.0.3by version. Dependabot may keep #258 open until an upstream fixed release exists; this PR does not suppress or dismiss the alert. These are local mitigations, not a claim that upstream packages or every version-based scan are fixed.