Repository navigation
fix(deps): update follow-redirects to 1.16.1 - #35
Merged
Merged
Conversation
Update the transitive follow-redirects dependency (via axios@1.20.0, range ^1.16.0) from 1.16.0 to 1.16.1 in package-lock.json only, to clear the high-severity advisories GHSA-q3jh-wrc6-jgq8 and GHSA-8r9p-f939-6h3c reported by the production npm audit gate. Only the version, resolved and integrity fields of that one entry change. package.json, overrides and every other locked package are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Node 22 test runner (v22.23.3) reads the 4 bytes after a consumed v8 frame as the next frame length without re-checking for the frame header (nodejs/node#64061). The fix, nodejs/node#64706, is in v24+ but has not been backported to v22.x (nodejs/node#65934). server.js prints its startup line starting with an emoji. When that stdout line lands in the same pipe read right after a frame, Node 22 computes a negative length and fails the whole lifecycle test file with "Unable to deserialize cloned data due to invalid or unsupported version", even though every subtest passed. In the real-HTTP lifecycle tests only, prefix that one startup line with "[server] " so it starts with ASCII. Every other console.log call passes through unchanged, and afterEach restores the original console.log. No production code, assertion, CI matrix or concurrency setting changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
The
deploy.ymlCI gate is currently blocking PRs againstmain, including #34. This PR has two independent commits, one for each blocker:1dc789efix(deps): patch follow-redirects security advisoriespackage-lock.json+3/−3npm audit --omit=dev --audit-level=highf533d6dtest(node22): avoid startup log deserialization failuretest/ai-conversation-lifecycle.test.mjs+15/−0Neither commit changes production code,
package.json, the CI workflow, the Node 22/24 matrix, test concurrency or any test assertion.1. follow-redirects 1.16.1 security update (
1dc789e)follow-redirects@1.16.0is flagged by:The upstream fix is
1.16.1.version,resolvedandintegrityfields ofnode_modules/follow-redirectschange. The integrity value matches the npm registry's1.16.1dist. A field-by-field compare of all 122 lockfile entries shows this is the only one that changed.package.jsonis untouched:follow-redirectsis transitive only. Its single dependent is the production dependencyaxios@1.20.0, which declares^1.16.0, so1.16.1is in range.overrides(there are none) and the audit gate. No advisories are ignored.escapeRegex. Load-time behaviour is the same./api/ai-conversationand/api/ai-chatuse theopenaiSDK, which has no lockfile dependencies and does not go throughfollow-redirects. axios is used by the SSRF guard and media fetch, both withmaxRedirects: 0and manual hop validation, and by the vision OCR POST with default redirect handling.2. Node 22 test-runner compatibility (
f533d6d)On this PR, the
test (22)job failed twice (original run and one re-run). Both times the error was intest/ai-conversation-lifecycle.test.mjs:The file has two tests. The first reported
ok; the runner crashed before it could read the second test's result. No assertion failed. Node 24 passed every step.Root cause. The Node v22.23.3 parent runner (
FileTest#processRawBuffer) finishes one v8 frame and then reads the next 4 bytes as a length, without checking for the frame header first. This is nodejs/node#64061. If those bytes are test stdout whose 3rd byte is ≥0x80, the length comes out negative and the runner deserializes garbage. nodejs/node#64706 fixed this with>>> 0, and the fix is in v24 and v26. It has not been backported to v22.x; see nodejs/node#65934. The trigger here is theserver.jsstartup line,🍳 Kitchen Manager 全栈服务已启动,端口 0, which begins with the bytesf0 9f 8d b3. Only the lifecycle tests reallylisten()and print it. Whether it crashes depends on that line landing in the same pipe read as the preceding frame, which explains the intermittent CI history.Change. Inside
startRealServeronly,console.logis wrapped so that a line starting with🍳 Kitchen Managergets a[server]prefix, which is ASCII. All other output passes through unchanged. The wrapper is installed beforerequire(server.js), because the line is printed later from thelistencallback.afterEachrestores the originalconsole.log, before the server-closeawait.Local evidence. These were run on Node v26.12.0. Node 22 is not installed locally, so this is not a real Node 22 run.
npm test: 1999/1999 pass, same test count as before. The lifecycle file passed 5 runs in a row.Captured the lifecycle file's raw child-v8 stdout before and after the change:
Replayed both captures through a line-for-line transcription of the v22.23.3
parseMessage/#processRawBuffer:A temporary failure-injection copy of the file, since deleted, confirmed that
console.logis restored after a failing test and after a failure beforelisten.Residual risk.
Test plan
npm teston Node v26.12.0: 1999/1999npm audit --omit=dev --audit-level=highandnpm audit: 0 vulnerabilities (before: exit 1 with the two advisories)validate:recipe-packs/validate:recipe-pack-datapassmaxRedirects: 0does not followAuthorizationis stripped on a cross-host redirecttest (22): full suite, recipe validation and production audit on real Node 22test (24): full suite, recipe validation and production auditNotes
main, re-running fix(server): diagnose Kitchen AI provider failures #34's CI should pick it up through the PR merge ref, with no rebase needed.maintriggers a Render auto-deploy. That needs a separate approval.🤖 Generated with Claude Code