Repository navigation
Conversation
…nd fix the typecheck Dependencies (lockfile regenerated with --before so no version is younger than the Aikido safe-chain cooldown): - @langchain/core 0.3 -> 1.5.0 and @langchain/textsplitters 0.1 -> 1.0.2. This is the bump from #58, redone on current main: langsmith moves 0.3.87 -> 0.13.1 (critical CVE-2026-40190, high CVE-2026-45134) and the nested uuid 10 and zod 3 copies under @langchain/core go away. The only API the app uses is RecursiveCharacterTextSplitter.splitText, which is unchanged. #58 showed a new critical only because its base predates the lodash 4.18.1 bump on main. - js-yaml 4.1.1 -> 4.3.2 (three high advisories). @mdxeditor/editor 3.x pins 4.1.1 exactly, so an override scoped to it moves it to the patched 4.x. - In-range updates: browserslist 4.29.6 (high), @babel/core 7.29.13, pg 8.23.1 and pg-connection-string 2.14.1, jose 6.2.18, react-hook-form 7.92.0, picomatch 2.3.2 / 4.0.7, tar-fs 2.1.5, ajv 6.15.0 / 8.20.0, highlight.js 11.12.0, enhanced-resolve 5.27.0, @ungap/structured-clone 1.4.0. Typecheck: `tsc --noEmit` failed with 13 errors on main, hidden by `typescript.ignoreBuildErrors`. src/types/jsx.d.ts redeclared parts of the react and antd modules, which shadowed their real exports; it now only maps the global JSX namespace that an older react-markdown inside @llamaindex/chat-ui still references. The build type-checks again and a `typecheck` script is added. Logs: account ID prefixes are no longer logged (cubic review on #24). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd document routes Findings from a Codex security review of the app, each reproduced in code: - Account routes trusted IDs from the browser. delete-account and connect-session now only act on StackOne accounts linked to the caller, connect sessions always use the caller as origin owner, and registering an integration checks the account's origin_owner_id with StackOne first. The upsert no longer updates (or returns) another user's row. - Chat, document processing and agent_integrations only resolve integrations the caller owns, so a foreign integration UUID cannot lend its tools or files to someone else's agent. - DELETE /api/documents/ingest only removes the caller's chunks. - The webhook rejected nothing when STACKONE_WEBHOOK_SECRET was unset; it now returns 503 until the secret is configured, and compares signatures in constant time. - Login redirectTo is reduced to a same-origin path; the hub postMessage listener matches origins exactly instead of by prefix. - StackOne IDs are encoded as single URL path segments. - /api/health requires a session, since each call spends an embeddings request. - Saving an agent only processes files for the integrations still selected. - Config: compose binds Postgres to 127.0.0.1, env.example no longer ships a usable NEXTAUTH_SECRET, and the schema enables row-level security (the app connects as table owner, so only other roles such as Supabase's Data API are denied). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
…ter dot-segment resolution The origin check alone passed "/.//evil.com": the URL parser keeps the origin but resolves the path to "//evil.com", which a browser then treats as another host. sameOriginPath now rejects a leading "//" or "/\" both in the raw input and in the resolved pathname. It moves to its own module with node:test unit tests (`npm test`). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vercel runs the install inside the app directory, where npm resolves the monorepo workspace root. That root has no lockfile, so every deploy resolved fresh versions and ignored the app lockfile, its overrides and the security pins in it. On the rag app this pulled @stackone/ai 2.10.0 instead of the locked 2.3.0. 2.10.0 has no Tools.utilityTools, which failed the now-enabled type check and on main silently disabled the StackOne tools at runtime. `npm ci --prefix .` installs from the app lockfile. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-pass-rag apps/rag-knowledge-agent/package-lock.json: took main's lockfile, regenerated with npm install --package-lock-only, then npm update on the transitive packages this PR had bumped (ajv, pg*, picomatch, jose, tar-fs and others) so the audit result matches the PR head (0 critical, 3 high) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Guillaume Lebedel <10488548+glebedel@users.noreply.github.com>
Contributor
|
Merged main into this branch to clear conflicts in
CI on the new head 12120ab: all 4 checks pass. |
This branch was previously 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.
Summary
Security and critical-error pass on
apps/rag-knowledge-agent. Two commits: dependencies + typecheck, then the ownership fixes from a Codex security review. Supersedes #58 (and the lockfile changes in #55 and #60).Dependencies
@langchain/core0.3 → 1.5.0,@langchain/textsplitters0.1 → 1.0.2, which brings langsmith 0.13.1. Same bump as #58, regenerated on current main@mdxeditor/editor, which pins 4.1.1 exactly in every 3.x release#58: its Aikido check showed one new critical,
lodash4.17.23. That came from the PR's stale base (it branched before lodash 4.18.1 landed on main), not from the bump itself. Rebuilt on main, a local Aikido dependency scan of this lockfile finds no critical issues.Every version was resolved with
npm --before=2026-11-21, to stay clear of the safe-chain quarantine on fresh releases.The Aikido issue list for this repo still shows Next.js 16.1.6. That data is stale: main has had 16.4.6 since #61.
Broken on main
tsc --noEmitfailed with 13 errors, whichtypescript.ignoreBuildErrorshid.src/types/jsx.d.tsredeclared thereactandantdmodules, and those declarations shadowed the real exports (MouseEvent,Statistic,Empty.PRESENTED_IMAGE_SIMPLE). It now maps only the globalJSXnamespace, which an older react-markdown inside@llamaindex/chat-uistill uses. The build type-checks again, and there is a newtypecheckscript.Vercel did not install from the lockfile. Vercel runs the install inside the app directory, where npm walks up to the workspace root. The root has no lockfile, so every deploy resolved fresh versions. The app lockfile, its overrides and the security pins in it were all ignored. Main was deploying
@stackone/ai2.10.0 instead of the locked 2.3.0. 2.10.0 has noTools.utilityTools, sogetStackOneUtilityToolsForAISDKhit its catch and returned no tools, and the StackOne tools were silently off in production. The first deploy of this PR failed the type check on exactly that.vercel.jsonnow sets"installCommand": "npm ci --prefix .", and the deploy passes.Codex security review (25 findings)
Fixed (real):
delete-accountdeleted any StackOne account ID for any signed-in user/api/agents/processandPUT /api/agents/[id]/integrationsresolve only the caller's integrations/api/agents/processimported files through foreign integrationsconnect-sessiontookorigin_owner_idandaccount_idfrom the bodyaccount_idmust be linked to the callerPOST /api/integrationstrusted the browser's account ID, and the upsert updated and returned another user's roworigin_owner_idwith StackOne (GET /accounts/{id}); the upsert only updates the caller's row (409 otherwise)STACKONE_WEBHOOK_SECRETwas unsetDELETE /api/documents/ingestdeleted any document's chunkspostgres) on all interfacesNEXTAUTH_SECRET./..rejectedpostMessageorigin check usedstartsWithredirectTowas an open redirectsameOriginPathkeeps only same-origin paths, rejecting a leading//or/\both before and after URL parsing (closes the/.//evil.comdot-segment bypass the security review bot found in the first version)/api/healthspent an embeddings call per requestLeft open, with reasons:
tool_execute, and tools span the whole connected account. Closing it needs human approval for write actions, or per-file scoping at dispatch. That is a design change.vercel.app, a public suffix, and the NextAuth cookie isSameSite=Lax, so the risk needs a custom domain with a hostile sibling subdomain. Left as is.DEBUG=1.@llamaindex/chat-ui0.6.1, the latest, pins@llamaindex/pdf-viewer1.3.0 → react-pdf 9 → pdfjs 4.8.69). zod 3.25.76 under@llamaindex/openai0.1.x (no 3.x fix; needs@llamaindex/openai0.4). minimatch 9 (dev, needs 11). katex 0.16 and lexical 0.35 (fixes are 0.x-major bumps inside chat-ui's ranges). openai 4.x (medium).Also found:
proxy.tssits at the app root, but the app usessrc/, so Next never compiles it (middleware-manifest.jsonis empty). Every API route checks the session itself, so nothing is exposed. Moving it tosrc/would also need/api/authadded to its public paths, or sign-in breaks. Left for a separate change.Testing (local, Node 22.22.0)
npm ci(lockfile in sync),npm run typecheck(0 errors, was 13),npm run lint(0 errors, 4 existing warnings),npm run build(type-checking now on): all pass.RecursiveCharacterTextSplitter.splitTexton@langchain/textsplitters1.0.2 returns the expected chunks.next startsmoke test:/and/loginreturn 200,/api/auth/csrf200,/api/healthand/api/integrations401 unauthenticated. Webhook with no secret: 503. With a secret: unsigned 401, bad signature 401, valid HMAC 200.npm test(new,node --test):sameOriginPathunit tests pass. They cover//evil.com,/\evil.com,/.//evil.com,/a/..//evil.com,/%2e//evil.com,/\t/evil.com,/%2F%2Fevil.com(kept as a local path),https://evil.comandjavascript:alert(1).npm installreproduces the failed deploy (utilityToolstype errors with @stackone/ai 2.10.0).npm ci --prefix .and thennpm run buildpasses with 2.3.0. The Vercel preview for this PR now deploys.🤖 Generated with Claude Code