fix: community fix wave — 9 PRs, 8 contributors (v0.6.1)#38
Merged
fix: community fix wave — 9 PRs, 8 contributors (v0.6.1)#38
Conversation
…traversal Changed regex from /\.\./ to /(^|\/)\.\.($|\/)/ so filenames with "..." (like YouTube transcripts, TED talks, podcast titles) are no longer falsely rejected. The old regex matched ".." anywhere as a substring. The new one only matches ".." as a complete path component (e.g., ../foo, foo/../bar, bare ..). Fixes 1.2% silent data loss on real-world import corpora. Co-Authored-By: orendi84 <orendi84@users.noreply.github.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…rts .mdx Three improvements to the file walker: - Skip node_modules directories (prevents crashes importing JS/TS projects) - try/catch around statSync for broken symlinks (warns and continues) - Accept .mdx files alongside .md (extends to slugifyPath and isSyncable) Co-Authored-By: mattbratos <mattbratos@users.noreply.github.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Three init improvements: - process.stdin.pause() after reading URL input (prevents event loop hang) - Auto-run CREATE EXTENSION IF NOT EXISTS vector with fallback message - Update Supabase session pooler navigation hint to match current dashboard UI Co-Authored-By: changergosum <changergosum@users.noreply.github.com> Co-Authored-By: eric-hth <eric-hth@users.noreply.github.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Run keyword search concurrently with the embed+vector pipeline instead of sequentially. Keyword search has no embedding dependency so it can overlap with the OpenAI API call, saving ~200-500ms per search. Co-Authored-By: irresi <irresi@users.noreply.github.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: howardpen9 <howardpen9@users.noreply.github.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Documents the fix wave workflow: categorize, deduplicate, collector branch, test, close with context, ship as one PR with attribution. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Community fix wave: 9 PRs re-implemented with full test coverage. 6 bug fixes, 1 perf improvement, 2 feature additions, 8 contributors. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove vendored .claude/skills/gstack/ from git tracking. The global install at ~/.claude/skills/gstack/ is the source of truth. Each developer runs `cd ~/.claude/skills/gstack && ./setup` to set up symlink stubs locally. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
These are generated locally by gstack's ./setup script. Not project code. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
openclaw.com is a parked page. openclaw.ai is the real product. Co-Authored-By: joshua-morris <joshua-morris@users.noreply.github.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This was referenced Apr 11, 2026
garagon
added a commit
to garagon/gbrain
that referenced
this pull request
Apr 11, 2026
The recursive markdown walker in `src/commands/import.ts` used statSync, which follows symlinks. Combined with the `.md` extension filter, that lets a contributor to a shared brain plant a symlink at `notes/innocent.md` pointing at `~/.gbrain/config.json`, `~/.aws/credentials`, `/etc/passwd`, `~/.zshrc`, `.env`, or any other file the importing user can read. On the next `gbrain import`, the walker treats the symlink as a regular file, `readFileSync` follows the link to its target, and the secret ends up chunked, embedded via OpenAI, and indexed in Postgres — at which point a bearer-token holder can exfiltrate it via `search` / `get_page`. Circular symlinks are a separate variant of the same bug: walking into a symlinked directory that ultimately points back into the brain root causes unbounded recursion and an OOM crash during import. PR garrytan#26 / garrytan#38 already added `node_modules` skipping and a try/catch around `statSync` so broken symlinks wouldn't crash the walker, but left the symlink-following behavior intact — a valid symlink was still silently read. Fix: - Replace `statSync` with `lstatSync`. `lstatSync` describes the link itself, not the target, so we can identify symlinks before we commit to following them. - Add an explicit `stat.isSymbolicLink()` branch that logs a skip warning and continues. No realpath containment, no depth cap, no visited-set — skipping all symlinks entirely is the simplest defense and is strictly stronger than any of those alternatives. Hard links are out of scope (a hard link is indistinguishable from the original file; any fix would break legitimate use). - Export `collectMarkdownFiles` so it can be unit-tested in isolation instead of being reachable only through `runImport`. Tests added in `test/import-walker.test.ts`: - `includes real markdown files inside the root` — baseline: a normal brain dir with a top-level and a nested .md file produces both paths. - `skips a symlink file pointing outside the brain root` — the core security test. Plants a symlink at `innocent.md` pointing at a secret in a sibling tmpdir, asserts the walker output contains neither the symlink nor the canonical secret path. - `does not descend into a symlinked directory` — ensures the fix also blocks the directory-symlink variant, which is what lets circular symlinks become a DoS primitive. - `skips broken symlinks without crashing` — pins the invariant that PR garrytan#26 / garrytan#38 already established (dangling symlinks don't throw), so that regression can't reappear. `lstatSync` actually succeeds on a dangling link since it stats the link inode, so we reach the `isSymbolicLink()` branch and skip cleanly. Refs: report/evidence/poc-l002-symlink-import.ts
4 tasks
1 task
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.
Summary
Community fix wave: re-implemented 9 community PR fixes on a collector branch with full test coverage.
Bug Fixes:
...(1.2% silent data loss on real corpora) — PR fix: validateSlug should only reject..as a path component #31 by @orendi84node_modulesor broken symlinks — PR fix: skip node_modules and handle broken symlinks in import walker #26 by @mattbratosgbrain init --supabaseno longer hangs after completion — PR Fix gbrain init --supabase not exiting after completion #17 by @changergosumCREATE EXTENSION IF NOT EXISTS vectorruns automatically during init — PR Auto create vector extension #18 by @changergosumImprovements:
.mdxfiles now importable alongside.md(walker + sync + slugify) — PR feat: mdx support and scan/import progress indicators #27 by @mattbratosProcess:
Test Coverage
70 unit tests pass (slug validation + sync tests), including:
Reviews
Test plan
bun test— 264 pass, 0 fail (with deps installed)🤖 Generated with Claude Code