Skip to content

Commit 3ed17fe

Browse files
olivrgcursoragent
andcommitted
fix(ci): unblock audit and test gates
Patch vulnerable dependency paths (vitest, axios override, and react-router) and update Vitest 4 test mocks/assertions so lint, test, and audit checks pass in CI. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 478b07c commit 3ed17fe

12 files changed

Lines changed: 171 additions & 200 deletions

File tree

DEPENDENCIES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,7 @@ Action versions are pinned to major version tags (e.g., `@v4`). Dependabot propo
7676
### pnpm overrides
7777

7878
The `pnpm-workspace.yaml` file includes overrides to patch known vulnerabilities in transitive dependencies when upstream packages haven't released fixes yet.
79+
80+
Current security-patch overrides include `axios` pinned at `1.17.0` to address NO_PROXY bypass and proxy gadget advisories inherited via `@slack/web-api`.
81+
82+
Vitest is pinned at `4.1.8` across JS workspaces to stay above the `GHSA-5xrq-8626-4rwp` floor, and dashboard `react-router` is pinned at `7.16.0` to stay above current `GHSA-49rj-9fvp-4h2h` / `GHSA-8x6r-g9mw-2r78` fixes.

docs/deployment-sidecar.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ keep the upstream server off the network your dev container is attached to.
162162
"dockerComposeFile": "../compose.yaml",
163163
"service": "agent", // VS Code attaches to the agent service above
164164
"workspaceFolder": "/workspace",
165-
"forwardPorts": [3100] // dashboard only; do not forward the upstream MCP port
165+
"forwardPorts": [3100], // dashboard only; do not forward the upstream MCP port
166166
}
167167
```
168168

packages/dashboard/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"dependencies": {
2525
"react": "19.2.4",
2626
"react-dom": "19.2.4",
27-
"react-router": "7.13.2",
27+
"react-router": "7.16.0",
2828
"recharts": "3.8.1"
2929
},
3030
"devDependencies": {
@@ -38,6 +38,6 @@
3838
"tailwindcss": "4.2.2",
3939
"typescript": "5.9.3",
4040
"vite": "6.4.2",
41-
"vitest": "3.2.4"
41+
"vitest": "4.1.8"
4242
}
4343
}

packages/dashboard/src/components/ErrorBoundary.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ beforeEach(() => {
99
})
1010

1111
afterEach(() => {
12-
consoleErrorSpy.mockRestore()
1312
vi.restoreAllMocks()
1413
})
1514

packages/proxy/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"@types/picomatch": "4.0.2",
5454
"tsup": "8.5.1",
5555
"tsx": "4.21.0",
56-
"vitest": "3.2.4"
56+
"vitest": "4.1.8"
5757
},
5858
"dependencies": {
5959
"@hono/node-server": "1.19.13",

packages/proxy/src/approval/channels.test.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ import { WebhookChannel } from './webhook.js'
44
import { SlackChannel } from './slack.js'
55

66
vi.mock('@slack/web-api', () => ({
7-
WebClient: vi.fn().mockImplementation(() => ({
8-
chat: { postMessage: vi.fn(), update: vi.fn() },
9-
})),
7+
WebClient: vi.fn(function MockWebClient() {
8+
return {
9+
chat: { postMessage: vi.fn(), update: vi.fn() },
10+
}
11+
}),
1012
}))
1113

1214
describe('createChannels', () => {

packages/proxy/src/approval/slack-actions.test.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,17 @@ import type { ApprovalChannel } from './types.js'
1111
// Mock @slack/web-api
1212
// ---------------------------------------------------------------------------
1313

14-
const mockPostMessage = vi.fn().mockResolvedValue({ ok: true, ts: '1234.5678' })
15-
const mockUpdate = vi.fn().mockResolvedValue({ ok: true })
14+
const { mockPostMessage, mockUpdate } = vi.hoisted(() => ({
15+
mockPostMessage: vi.fn().mockResolvedValue({ ok: true, ts: '1234.5678' }),
16+
mockUpdate: vi.fn().mockResolvedValue({ ok: true }),
17+
}))
1618

1719
vi.mock('@slack/web-api', () => ({
18-
WebClient: vi.fn().mockImplementation(() => ({
19-
chat: { postMessage: mockPostMessage, update: mockUpdate },
20-
})),
20+
WebClient: vi.fn(function MockWebClient() {
21+
return {
22+
chat: { postMessage: mockPostMessage, update: mockUpdate },
23+
}
24+
}),
2125
}))
2226

2327
// ---------------------------------------------------------------------------

packages/proxy/src/approval/slack.test.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,17 @@ import type { ApprovalChannel, ApprovalTicket } from './types.js'
99
// Mock @slack/web-api
1010
// ---------------------------------------------------------------------------
1111

12-
const mockPostMessage = vi.fn()
13-
const mockUpdate = vi.fn()
12+
const { mockPostMessage, mockUpdate } = vi.hoisted(() => ({
13+
mockPostMessage: vi.fn(),
14+
mockUpdate: vi.fn(),
15+
}))
1416

1517
vi.mock('@slack/web-api', () => ({
16-
WebClient: vi.fn().mockImplementation(() => ({
17-
chat: { postMessage: mockPostMessage, update: mockUpdate },
18-
})),
18+
WebClient: vi.fn(function MockWebClient() {
19+
return {
20+
chat: { postMessage: mockPostMessage, update: mockUpdate },
21+
}
22+
}),
1923
}))
2024

2125
// ---------------------------------------------------------------------------

packages/proxy/src/audit/store.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ CREATE TABLE IF NOT EXISTS audit_records (
164164
includeResponses: true,
165165
cleanupIntervalMs: 0,
166166
}),
167-
).toThrowError(
167+
).toThrow(
168168
/Audit DB schema mismatch: missing required columns .*"block_reason".*Delete ".*audit\.db".*then restart Helio\./,
169169
)
170170
} finally {
@@ -217,7 +217,7 @@ CREATE TABLE IF NOT EXISTS audit_records (
217217
includeResponses: true,
218218
cleanupIntervalMs: 0,
219219
}),
220-
).toThrowError(
220+
).toThrow(
221221
/Audit DB schema mismatch: missing required columns .*"upstream_http_status".*Delete ".*audit\.db".*then restart Helio\./,
222222
)
223223
} finally {

packages/proxy/src/upstream/sse-forwarder.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,9 @@ describe('SseUpstreamForwarder', () => {
267267

268268
const originalFetch = globalThis.fetch
269269
globalThis.fetch = (input: string | URL | Request, init?: RequestInit): Promise<Response> => {
270-
const method = (init?.method ?? (input instanceof Request ? input.method : 'GET')).toUpperCase()
270+
const method = (
271+
init?.method ?? (input instanceof Request ? input.method : 'GET')
272+
).toUpperCase()
271273
if (method === 'POST') {
272274
return Promise.reject(fetchFailed('ECONNREFUSED'))
273275
}
@@ -292,7 +294,9 @@ describe('SseUpstreamForwarder', () => {
292294

293295
const originalFetch = globalThis.fetch
294296
globalThis.fetch = (input: string | URL | Request, init?: RequestInit): Promise<Response> => {
295-
const method = (init?.method ?? (input instanceof Request ? input.method : 'GET')).toUpperCase()
297+
const method = (
298+
init?.method ?? (input instanceof Request ? input.method : 'GET')
299+
).toUpperCase()
296300
if (method === 'POST') {
297301
return Promise.reject(fetchFailed('ECONNREFUSED'))
298302
}

0 commit comments

Comments
 (0)