mcp-rubber-duck 1.20.1 → 1.20.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/dependabot.yml +16 -9
- package/.github/workflows/security.yml +53 -12
- package/.github/workflows/semantic-release.yml +62 -25
- package/.trivyignore +19 -13
- package/CHANGELOG.md +15 -0
- package/audit-ci.json +24 -1
- package/package.json +16 -6
- package/tests/function-bridge.test.ts +124 -0
package/.github/dependabot.yml
CHANGED
|
@@ -4,15 +4,22 @@
|
|
|
4
4
|
# repo's existing posture: it relies on GitHub's repo-level Dependabot *security*
|
|
5
5
|
# updates plus the audit-ci CI gate (audit-ci.json), not scheduled version bumps.
|
|
6
6
|
#
|
|
7
|
-
# `undici` is ignored
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
#
|
|
13
|
-
# The
|
|
14
|
-
#
|
|
15
|
-
#
|
|
7
|
+
# `undici` is ignored because its resolution is fully governed by the `overrides`
|
|
8
|
+
# block in package.json (`undici@6.x` and `undici@7.x`), which Dependabot does not
|
|
9
|
+
# edit. There are three copies in the tree:
|
|
10
|
+
# node_modules/undici 6.28.0 <- @actions/http-client ^6.23.0
|
|
11
|
+
# node_modules/semantic-release/node_modules/undici 7.29.0 <- @semantic-release/github ^7.0.0
|
|
12
|
+
# node_modules/npm/node_modules/undici 6.27.0 <- bundled in the npm CLI tarball
|
|
13
|
+
# The first two are already at the head of their major lines and are raised by
|
|
14
|
+
# bumping the override floor, not by a Dependabot PR. The third is bundled inside
|
|
15
|
+
# npm's own tarball and cannot be lifted by overrides at all. So every Dependabot
|
|
16
|
+
# security-update attempt here is either a no-op or fails by construction — which
|
|
17
|
+
# is what it did historically (see the closed PRs #84 and #85).
|
|
18
|
+
#
|
|
19
|
+
# audit-ci is the real gate and tracks these independently: audit-ci.json
|
|
20
|
+
# allowlists the three bundled-npm undici advisories with re-check triggers.
|
|
21
|
+
# Remove this ignore if undici ever becomes a direct dependency, or if the
|
|
22
|
+
# overrides are dropped.
|
|
16
23
|
version: 2
|
|
17
24
|
updates:
|
|
18
25
|
- package-ecosystem: "npm"
|
|
@@ -9,22 +9,33 @@ on:
|
|
|
9
9
|
# Run weekly security scans
|
|
10
10
|
- cron: '0 6 * * 1'
|
|
11
11
|
|
|
12
|
+
# Least privilege by default; jobs opt into more only where they need it.
|
|
12
13
|
permissions:
|
|
13
14
|
contents: read
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
|
|
16
|
+
# Supersede in-flight runs for the same ref — these are checks, not releases.
|
|
17
|
+
concurrency:
|
|
18
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
19
|
+
cancel-in-progress: true
|
|
16
20
|
|
|
17
21
|
jobs:
|
|
18
22
|
security-scan:
|
|
19
23
|
name: 🔍 Security Scan
|
|
20
24
|
runs-on: ubuntu-latest
|
|
25
|
+
timeout-minutes: 20
|
|
26
|
+
permissions:
|
|
27
|
+
contents: read
|
|
28
|
+
security-events: write
|
|
21
29
|
|
|
22
30
|
steps:
|
|
23
31
|
- name: 📥 Checkout
|
|
24
|
-
uses: actions/checkout@
|
|
32
|
+
uses: actions/checkout@v7
|
|
33
|
+
with:
|
|
34
|
+
persist-credentials: false
|
|
25
35
|
|
|
26
36
|
- name: 🔒 Run Trivy vulnerability scanner
|
|
27
|
-
|
|
37
|
+
# Pinned to the v0.36.0 tag commit — @master is a mutable ref.
|
|
38
|
+
uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0
|
|
28
39
|
with:
|
|
29
40
|
scan-type: 'fs'
|
|
30
41
|
scan-ref: '.'
|
|
@@ -46,7 +57,7 @@ jobs:
|
|
|
46
57
|
|
|
47
58
|
- name: 🔒 Run Trivy on Docker image
|
|
48
59
|
if: github.event_name != 'schedule'
|
|
49
|
-
uses: aquasecurity/trivy-action@
|
|
60
|
+
uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0
|
|
50
61
|
with:
|
|
51
62
|
image-ref: 'security-scan-image'
|
|
52
63
|
format: 'sarif'
|
|
@@ -63,13 +74,18 @@ jobs:
|
|
|
63
74
|
dependency-check:
|
|
64
75
|
name: 📦 Dependency Check
|
|
65
76
|
runs-on: ubuntu-latest
|
|
77
|
+
timeout-minutes: 15
|
|
78
|
+
permissions:
|
|
79
|
+
contents: read
|
|
66
80
|
|
|
67
81
|
steps:
|
|
68
82
|
- name: 📥 Checkout
|
|
69
|
-
uses: actions/checkout@
|
|
83
|
+
uses: actions/checkout@v7
|
|
84
|
+
with:
|
|
85
|
+
persist-credentials: false
|
|
70
86
|
|
|
71
87
|
- name: 📦 Setup Node.js
|
|
72
|
-
uses: actions/setup-node@
|
|
88
|
+
uses: actions/setup-node@v7
|
|
73
89
|
with:
|
|
74
90
|
node-version: '22'
|
|
75
91
|
cache: 'npm'
|
|
@@ -85,16 +101,25 @@ jobs:
|
|
|
85
101
|
run: npm outdated || true
|
|
86
102
|
|
|
87
103
|
- name: 🔒 Check for known vulnerabilities
|
|
88
|
-
# audit-ci respects allowlist in audit-ci.json
|
|
89
|
-
|
|
104
|
+
# audit-ci respects the allowlist in audit-ci.json — advisories with no
|
|
105
|
+
# reachable fix (bundled/unpatched transitive dev deps). Each entry carries
|
|
106
|
+
# a rationale + re-check trigger in $allowlist-rationale.
|
|
107
|
+
# Version-pinned so the gate itself cannot shift under us.
|
|
108
|
+
run: npx --yes audit-ci@7.1.0 --config audit-ci.json
|
|
90
109
|
|
|
91
110
|
dockerfile-lint:
|
|
92
111
|
name: 🐳 Dockerfile Lint
|
|
93
112
|
runs-on: ubuntu-latest
|
|
113
|
+
timeout-minutes: 10
|
|
114
|
+
permissions:
|
|
115
|
+
contents: read
|
|
116
|
+
security-events: write
|
|
94
117
|
|
|
95
118
|
steps:
|
|
96
119
|
- name: 📥 Checkout
|
|
97
|
-
uses: actions/checkout@
|
|
120
|
+
uses: actions/checkout@v7
|
|
121
|
+
with:
|
|
122
|
+
persist-credentials: false
|
|
98
123
|
|
|
99
124
|
- name: 🔍 Lint Dockerfile
|
|
100
125
|
uses: hadolint/hadolint-action@v3.1.0
|
|
@@ -114,13 +139,18 @@ jobs:
|
|
|
114
139
|
test:
|
|
115
140
|
name: 🧪 Test Suite
|
|
116
141
|
runs-on: ubuntu-latest
|
|
142
|
+
timeout-minutes: 20
|
|
143
|
+
permissions:
|
|
144
|
+
contents: read
|
|
117
145
|
|
|
118
146
|
steps:
|
|
119
147
|
- name: 📥 Checkout
|
|
120
|
-
uses: actions/checkout@
|
|
148
|
+
uses: actions/checkout@v7
|
|
149
|
+
with:
|
|
150
|
+
persist-credentials: false
|
|
121
151
|
|
|
122
152
|
- name: 📦 Setup Node.js
|
|
123
|
-
uses: actions/setup-node@
|
|
153
|
+
uses: actions/setup-node@v7
|
|
124
154
|
with:
|
|
125
155
|
node-version: '22'
|
|
126
156
|
cache: 'npm'
|
|
@@ -143,8 +173,11 @@ jobs:
|
|
|
143
173
|
quality-gates:
|
|
144
174
|
name: 🚀 Quality Gates
|
|
145
175
|
runs-on: ubuntu-latest
|
|
176
|
+
timeout-minutes: 5
|
|
146
177
|
needs: [security-scan, dependency-check, dockerfile-lint, test]
|
|
147
178
|
if: always()
|
|
179
|
+
permissions:
|
|
180
|
+
contents: read
|
|
148
181
|
|
|
149
182
|
steps:
|
|
150
183
|
- name: 📊 Quality Gate Summary
|
|
@@ -178,3 +211,11 @@ jobs:
|
|
|
178
211
|
|
|
179
212
|
echo "" >> $GITHUB_STEP_SUMMARY
|
|
180
213
|
echo "📋 **View detailed results in the Security tab**" >> $GITHUB_STEP_SUMMARY
|
|
214
|
+
|
|
215
|
+
- name: 🚦 Enforce quality gates
|
|
216
|
+
# Without this the job is summary-only and always green, so a red
|
|
217
|
+
# dependency check or test suite would not fail this check.
|
|
218
|
+
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
|
|
219
|
+
run: |
|
|
220
|
+
echo "::error::One or more quality gates failed — see the job summary above"
|
|
221
|
+
exit 1
|
|
@@ -11,25 +11,30 @@ env:
|
|
|
11
11
|
REGISTRY: ghcr.io
|
|
12
12
|
IMAGE_NAME: ${{ github.repository }}
|
|
13
13
|
|
|
14
|
+
# Least privilege by default; jobs opt into more only where they need it.
|
|
14
15
|
permissions:
|
|
15
|
-
contents:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
id-token: write
|
|
16
|
+
contents: read
|
|
17
|
+
|
|
18
|
+
# Never cancel an in-flight release; queue instead.
|
|
19
|
+
concurrency:
|
|
20
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
21
|
+
cancel-in-progress: false
|
|
22
22
|
|
|
23
23
|
jobs:
|
|
24
24
|
test:
|
|
25
25
|
name: 🧪 Test Before Release
|
|
26
26
|
runs-on: ubuntu-latest
|
|
27
|
+
timeout-minutes: 20
|
|
28
|
+
permissions:
|
|
29
|
+
contents: read
|
|
27
30
|
steps:
|
|
28
31
|
- name: 📥 Checkout
|
|
29
|
-
uses: actions/checkout@
|
|
32
|
+
uses: actions/checkout@v7
|
|
33
|
+
with:
|
|
34
|
+
persist-credentials: false
|
|
30
35
|
|
|
31
36
|
- name: 📦 Setup Node.js
|
|
32
|
-
uses: actions/setup-node@
|
|
37
|
+
uses: actions/setup-node@v7
|
|
33
38
|
with:
|
|
34
39
|
node-version: '22'
|
|
35
40
|
cache: 'npm'
|
|
@@ -52,13 +57,20 @@ jobs:
|
|
|
52
57
|
security-scan:
|
|
53
58
|
name: 🔍 Security Scan
|
|
54
59
|
runs-on: ubuntu-latest
|
|
60
|
+
timeout-minutes: 20
|
|
61
|
+
permissions:
|
|
62
|
+
contents: read
|
|
63
|
+
security-events: write
|
|
55
64
|
|
|
56
65
|
steps:
|
|
57
66
|
- name: 📥 Checkout
|
|
58
|
-
uses: actions/checkout@
|
|
67
|
+
uses: actions/checkout@v7
|
|
68
|
+
with:
|
|
69
|
+
persist-credentials: false
|
|
59
70
|
|
|
60
71
|
- name: 🔒 Run Trivy vulnerability scanner
|
|
61
|
-
|
|
72
|
+
# Pinned to the v0.36.0 tag commit — @master is a mutable ref.
|
|
73
|
+
uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0
|
|
62
74
|
with:
|
|
63
75
|
scan-type: 'fs'
|
|
64
76
|
scan-ref: '.'
|
|
@@ -77,7 +89,8 @@ jobs:
|
|
|
77
89
|
docker build -t security-scan-image .
|
|
78
90
|
|
|
79
91
|
- name: 🔒 Run Trivy on Docker image
|
|
80
|
-
|
|
92
|
+
# Pinned to the v0.36.0 tag commit — @master is a mutable ref.
|
|
93
|
+
uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0
|
|
81
94
|
with:
|
|
82
95
|
image-ref: 'security-scan-image'
|
|
83
96
|
format: 'sarif'
|
|
@@ -93,13 +106,18 @@ jobs:
|
|
|
93
106
|
dependency-check:
|
|
94
107
|
name: 📦 Dependency Check
|
|
95
108
|
runs-on: ubuntu-latest
|
|
109
|
+
timeout-minutes: 15
|
|
110
|
+
permissions:
|
|
111
|
+
contents: read
|
|
96
112
|
|
|
97
113
|
steps:
|
|
98
114
|
- name: 📥 Checkout
|
|
99
|
-
uses: actions/checkout@
|
|
115
|
+
uses: actions/checkout@v7
|
|
116
|
+
with:
|
|
117
|
+
persist-credentials: false
|
|
100
118
|
|
|
101
119
|
- name: 📦 Setup Node.js
|
|
102
|
-
uses: actions/setup-node@
|
|
120
|
+
uses: actions/setup-node@v7
|
|
103
121
|
with:
|
|
104
122
|
node-version: '22'
|
|
105
123
|
cache: 'npm'
|
|
@@ -115,16 +133,25 @@ jobs:
|
|
|
115
133
|
run: npm outdated || true
|
|
116
134
|
|
|
117
135
|
- name: 🔒 Check for known vulnerabilities
|
|
118
|
-
# audit-ci respects allowlist in audit-ci.json
|
|
119
|
-
|
|
136
|
+
# audit-ci respects the allowlist in audit-ci.json — advisories with no
|
|
137
|
+
# reachable fix (bundled/unpatched transitive dev deps). Each entry carries
|
|
138
|
+
# a rationale + re-check trigger in $allowlist-rationale.
|
|
139
|
+
# Version-pinned so the gate itself cannot shift under us.
|
|
140
|
+
run: npx --yes audit-ci@7.1.0 --config audit-ci.json
|
|
120
141
|
|
|
121
142
|
dockerfile-lint:
|
|
122
143
|
name: 🐳 Dockerfile Lint
|
|
123
144
|
runs-on: ubuntu-latest
|
|
145
|
+
timeout-minutes: 10
|
|
146
|
+
permissions:
|
|
147
|
+
contents: read
|
|
148
|
+
security-events: write
|
|
124
149
|
|
|
125
150
|
steps:
|
|
126
151
|
- name: 📥 Checkout
|
|
127
|
-
uses: actions/checkout@
|
|
152
|
+
uses: actions/checkout@v7
|
|
153
|
+
with:
|
|
154
|
+
persist-credentials: false
|
|
128
155
|
|
|
129
156
|
- name: 🔍 Lint Dockerfile
|
|
130
157
|
uses: hadolint/hadolint-action@v3.1.0
|
|
@@ -145,19 +172,25 @@ jobs:
|
|
|
145
172
|
name: 📦 Release
|
|
146
173
|
needs: [test, security-scan, dependency-check, dockerfile-lint]
|
|
147
174
|
runs-on: ubuntu-latest
|
|
175
|
+
timeout-minutes: 30
|
|
176
|
+
permissions:
|
|
177
|
+
contents: write
|
|
178
|
+
issues: write
|
|
179
|
+
pull-requests: write
|
|
180
|
+
id-token: write
|
|
148
181
|
outputs:
|
|
149
182
|
release-version: ${{ steps.get-version.outputs.version }}
|
|
150
183
|
new-release-published: ${{ steps.check-release.outputs.released }}
|
|
151
184
|
|
|
152
185
|
steps:
|
|
153
186
|
- name: 📥 Checkout
|
|
154
|
-
uses: actions/checkout@
|
|
187
|
+
uses: actions/checkout@v7
|
|
155
188
|
with:
|
|
156
189
|
fetch-depth: 0
|
|
157
190
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
158
191
|
|
|
159
192
|
- name: 📦 Setup Node.js
|
|
160
|
-
uses: actions/setup-node@
|
|
193
|
+
uses: actions/setup-node@v7
|
|
161
194
|
with:
|
|
162
195
|
node-version: '22'
|
|
163
196
|
cache: 'npm'
|
|
@@ -243,23 +276,27 @@ jobs:
|
|
|
243
276
|
name: 🐳 Build & Push Docker Images
|
|
244
277
|
needs: release
|
|
245
278
|
runs-on: ubuntu-latest
|
|
279
|
+
timeout-minutes: 90
|
|
280
|
+
permissions:
|
|
281
|
+
contents: read
|
|
282
|
+
packages: write
|
|
246
283
|
if: needs.release.outputs.new-release-published == 'true'
|
|
247
284
|
|
|
248
285
|
steps:
|
|
249
286
|
- name: 📥 Checkout release tag
|
|
250
|
-
uses: actions/checkout@
|
|
287
|
+
uses: actions/checkout@v7
|
|
251
288
|
with:
|
|
252
289
|
ref: v${{ needs.release.outputs.release-version }}
|
|
253
290
|
fetch-depth: 0
|
|
254
291
|
|
|
255
292
|
- name: 🛠️ Set up QEMU
|
|
256
|
-
uses: docker/setup-qemu-action@
|
|
293
|
+
uses: docker/setup-qemu-action@v4
|
|
257
294
|
|
|
258
295
|
- name: 🛠️ Set up Docker Buildx
|
|
259
|
-
uses: docker/setup-buildx-action@
|
|
296
|
+
uses: docker/setup-buildx-action@v4
|
|
260
297
|
|
|
261
298
|
- name: 🔑 Login to Container Registry
|
|
262
|
-
uses: docker/login-action@
|
|
299
|
+
uses: docker/login-action@v4
|
|
263
300
|
with:
|
|
264
301
|
registry: ${{ env.REGISTRY }}
|
|
265
302
|
username: ${{ github.actor }}
|
|
@@ -267,7 +304,7 @@ jobs:
|
|
|
267
304
|
|
|
268
305
|
- name: 🏷️ Extract metadata
|
|
269
306
|
id: meta
|
|
270
|
-
uses: docker/metadata-action@
|
|
307
|
+
uses: docker/metadata-action@v6
|
|
271
308
|
with:
|
|
272
309
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
273
310
|
tags: |
|
|
@@ -282,7 +319,7 @@ jobs:
|
|
|
282
319
|
|
|
283
320
|
- name: 🐳 Build and push Docker image
|
|
284
321
|
id: build
|
|
285
|
-
uses: docker/build-push-action@
|
|
322
|
+
uses: docker/build-push-action@v7
|
|
286
323
|
with:
|
|
287
324
|
context: .
|
|
288
325
|
platforms: linux/amd64,linux/arm64
|
package/.trivyignore
CHANGED
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
# Trivy ignore file.
|
|
2
2
|
#
|
|
3
|
-
#
|
|
4
|
-
# tarball (npm -> node-gyp -> undici). It reaches package-lock.json only via the
|
|
5
|
-
# dev/release-only semantic-release toolchain and is NOT in the runtime Docker
|
|
6
|
-
# image (the production stage removes the npm CLI entirely). The bundled copy
|
|
7
|
-
# cannot be lifted by package overrides and no patched npm release exists yet
|
|
8
|
-
# (node-gyp still requires undici ^6.25.0).
|
|
3
|
+
# Currently empty — no suppressions are needed.
|
|
9
4
|
#
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
#
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
5
|
+
# This file previously suppressed four undici advisories (CVE-2026-12151,
|
|
6
|
+
# CVE-2026-9679, CVE-2026-11525, CVE-2026-6733). All four are fixed in undici
|
|
7
|
+
# 6.27.0 / 7.28.0 / 8.5.0, and every undici copy in the tree now meets that bar
|
|
8
|
+
# (node_modules/undici 6.28.0, semantic-release's 7.29.0, and npm's bundled
|
|
9
|
+
# 6.27.0), so the lines matched nothing and were removed.
|
|
10
|
+
#
|
|
11
|
+
# Their stated removal trigger was also unreachable: the comment said to drop
|
|
12
|
+
# them "once the orphaned undici 6.21.0 lock entry is gone", but no such entry
|
|
13
|
+
# has ever existed in this repo's lock. The 6.21.0 in package-lock.json is
|
|
14
|
+
# `undici-types` — a types-only package with no runtime code.
|
|
15
|
+
#
|
|
16
|
+
# Note that npm's *bundled* copies of undici, tar, brace-expansion and
|
|
17
|
+
# ip-address do still carry live advisories. Those are tracked deliberately in
|
|
18
|
+
# audit-ci.json's allowlist (with per-advisory rationale and re-check triggers)
|
|
19
|
+
# and are stripped from the runtime Docker image, which removes the npm CLI
|
|
20
|
+
# entirely (see Dockerfile). If Trivy starts reporting them against
|
|
21
|
+
# package-lock.json, mirror the audit-ci.json entries here rather than
|
|
22
|
+
# re-adding the undici CVEs above.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
## [1.20.3](https://github.com/nesquikm/mcp-rubber-duck/compare/v1.20.2...v1.20.3) (2026-08-10)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **deps:** clear every override-reachable audit-ci advisory ([6aa7a4d](https://github.com/nesquikm/mcp-rubber-duck/commit/6aa7a4d57b0911e7a94da53b7c78b4bdc50dc337))
|
|
7
|
+
* **security:** scope audit-ci allowlist to the bundled-npm paths ([ab9c654](https://github.com/nesquikm/mcp-rubber-duck/commit/ab9c654f1ba7747fde6ff8d827a06c1b987bc1b8))
|
|
8
|
+
|
|
9
|
+
## [1.20.2](https://github.com/nesquikm/mcp-rubber-duck/compare/v1.20.1...v1.20.2) (2026-07-27)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* **deps:** clear audit-ci CVEs (hono, @hono/node-server, fast-uri, postcss) ([a71ffac](https://github.com/nesquikm/mcp-rubber-duck/commit/a71ffac26951d23bdb8095457833028b35bf0e80)), closes [#132](https://github.com/nesquikm/mcp-rubber-duck/issues/132)
|
|
15
|
+
|
|
1
16
|
## [1.20.1](https://github.com/nesquikm/mcp-rubber-duck/compare/v1.20.0...v1.20.1) (2026-07-21)
|
|
2
17
|
|
|
3
18
|
|
package/audit-ci.json
CHANGED
|
@@ -4,5 +4,28 @@
|
|
|
4
4
|
"high": true,
|
|
5
5
|
"critical": true,
|
|
6
6
|
"report-type": "summary",
|
|
7
|
-
"allowlist":
|
|
7
|
+
"$allowlist-rationale": {
|
|
8
|
+
"$root-cause": "Every entry below resolves to a dependency BUNDLED INSIDE THE npm CLI TARBALL (node_modules/npm/node_modules/*). npm publishes those via bundleDependencies, so `overrides` in package.json cannot reach them — verified: the undici/ip-address/brace-expansion overrides added on 2026-08-10 lifted every other copy in the tree but left npm's bundled ones untouched. The npm CLI is dev/release-only (devDependencies -> semantic-release -> @semantic-release/npm -> npm) and is stripped from the runtime Docker image. Checked on 2026-08-10 that npm 11.18.0, 11.19.0 AND 12.0.2 all bundle the SAME stale set: undici 6.27.0, tar 7.5.19, brace-expansion 5.0.7, ip-address 10.2.0, minimatch 10.2.5 — so bumping the `npm` override clears nothing today. Note @semantic-release/npm@13.1.5 declares `npm: ^11.6.2`, so a fix landing only in npm 12.x would additionally need the `npm` override raised past ^11.16.0.",
|
|
9
|
+
"$scoping": "Entries are path-scoped (`GHSA-ID|path`) rather than bare advisory IDs so a REACHABLE reintroduction of the same advisory still fails CI. This works for ip-address: the bundled copy renders as `ip-address` while the reachable one renders as `express-rate-limit>ip-address` (the path that was failing before this fix). It does NOT discriminate for undici and brace-expansion — audit-ci renders both the bundled and a hypothetical direct copy as the bare package name — so those two remain the weak spot; re-check them by hand when the tree changes. Path-scoped entries fail CLOSED: if npm audit's graph shifts, the string stops matching and CI goes red, which is the intended prompt to revisit this file.",
|
|
10
|
+
"GHSA-mh99-v99m-4gvg": "brace-expansion DoS (unbounded expansion length). Patched in 5.0.8. Only npm's bundled 5.0.7 is still affected. The previous rationale here claimed the 1.x/2.x lines had no backport — that is now STALE: 1.1.18 and 2.1.4 shipped, and the `brace-expansion@1.x`/`@2.x` overrides pin them, clearing the eslint/jest (minimatch 3) and typescript-eslint (minimatch 9) paths. Re-check when npm rebundles brace-expansion >= 5.0.9.",
|
|
11
|
+
"GHSA-rgw5-rvv9-x895": "brace-expansion DoS (unbounded intermediate arrays, bypasses the CVE-2026-14257 mitigation). Same bundled 5.0.7 as above; patched in 5.0.9. Same re-check trigger.",
|
|
12
|
+
"GHSA-mwp4-54f8-5fhr": "ip-address: leading-zero octets decoded as decimal (SSRF / trust-boundary bypass). Patched in 10.3.1. Reachable path (express-rate-limit -> ip-address) is fixed by the `ip-address` override at ^10.3.1; only npm's bundled 10.2.0 (via its vendored socks) remains. Re-check when npm rebundles ip-address >= 10.3.1.",
|
|
13
|
+
"GHSA-4xrf-jv44-h6hh": "ip-address: a CIDR suffix suppresses special-use classification (SSRF / trust-boundary bypass). Patched in 10.2.2. Same bundled-only path and re-check trigger as GHSA-mwp4-54f8-5fhr.",
|
|
14
|
+
"GHSA-22jq-vg5j-6vgg": "ip-address: IPv4-mapped/NAT64 IPv6 misclassification (SSRF / trust-boundary bypass). Patched in 10.2.1. Same bundled-only path and re-check trigger as GHSA-mwp4-54f8-5fhr.",
|
|
15
|
+
"GHSA-8xcm-r25x-g524": "undici: downstream response desynchronization via the retry interceptor. Patched in 6.28.0 / 7.29.0. The two reachable copies (@actions/http-client -> undici ^6.23.0, and @semantic-release/github -> undici ^7.0.0) are lifted by the `undici@6.x`/`@7.x` overrides; only npm's bundled 6.27.0 (via its vendored node-gyp) remains. Re-check when npm rebundles undici >= 6.28.0.",
|
|
16
|
+
"GHSA-m8rv-5g2x-5cg5": "undici: CRLF injection via a blob-like body `type` property. Patched in 6.28.0 / 7.29.0. Same bundled-only path and re-check trigger as GHSA-8xcm-r25x-g524.",
|
|
17
|
+
"GHSA-v3r7-h72x-cjcm": "undici: cookie attribute injection via unsanitized domain and unparsed setCookie fields. Patched in 6.28.0 / 7.29.0. Same bundled-only path and re-check trigger as GHSA-8xcm-r25x-g524.",
|
|
18
|
+
"GHSA-r292-9mhp-454m": "node-tar DoS (uncontrolled recursion in mapHas/filesFilter). Patched in tar 7.5.21 (latest 7.5.22); npm 12.0.2 still bundles 7.5.19. Re-check when npm rebundles tar >= 7.5.21 — and note the `npm: ^11.16.0` override caveat in $root-cause if the fix lands only in npm 12.x."
|
|
19
|
+
},
|
|
20
|
+
"allowlist": [
|
|
21
|
+
"GHSA-mh99-v99m-4gvg|brace-expansion",
|
|
22
|
+
"GHSA-rgw5-rvv9-x895|brace-expansion",
|
|
23
|
+
"GHSA-mwp4-54f8-5fhr|ip-address",
|
|
24
|
+
"GHSA-4xrf-jv44-h6hh|ip-address",
|
|
25
|
+
"GHSA-22jq-vg5j-6vgg|ip-address",
|
|
26
|
+
"GHSA-8xcm-r25x-g524|undici",
|
|
27
|
+
"GHSA-m8rv-5g2x-5cg5|undici",
|
|
28
|
+
"GHSA-v3r7-h72x-cjcm|undici",
|
|
29
|
+
"GHSA-r292-9mhp-454m|semantic-release>@semantic-release/npm>npm>tar"
|
|
30
|
+
]
|
|
8
31
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-rubber-duck",
|
|
3
|
-
"version": "1.20.
|
|
3
|
+
"version": "1.20.3",
|
|
4
4
|
"description": "An MCP server that bridges to multiple OpenAI-compatible LLMs - your AI rubber duck debugging panel",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -70,15 +70,25 @@
|
|
|
70
70
|
"vite": "^8.0.16",
|
|
71
71
|
"vite-plugin-singlefile": "^2.3.0"
|
|
72
72
|
},
|
|
73
|
+
"$overrides-rationale": {
|
|
74
|
+
"@hono/node-server": "Major-version override (2.x) against the MCP SDK's declared ^1.19.9 — GHSA-frvp-7c67-39w9 is patched only in 2.0.5 and the 1.x line has no fix. Safe here: the SDK pulls @hono/node-server in for its server-side streamableHttp transport, which this project never imports (we use StreamableHTTPClientTransport, the client side, in src/services/mcp-client-manager.ts). v2 keeps the same serve/getRequestListener API. Revisit if this project ever serves MCP over HTTP, or drop the override once the SDK moves to ^2."
|
|
75
|
+
},
|
|
73
76
|
"overrides": {
|
|
74
|
-
"js-yaml": "^4.
|
|
77
|
+
"js-yaml": "^4.3.1",
|
|
75
78
|
"lodash": "^4.17.23",
|
|
76
79
|
"lodash-es": "^4.17.23",
|
|
77
|
-
"hono": "^4.
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
+
"hono": "^4.13.1",
|
|
81
|
+
"@hono/node-server": "^2.0.5",
|
|
82
|
+
"fast-uri": "^3.1.5",
|
|
83
|
+
"postcss": "^8.5.18",
|
|
84
|
+
"ip-address": "^10.3.1",
|
|
85
|
+
"express-rate-limit": "^8.6.2",
|
|
80
86
|
"qs": "^6.15.2",
|
|
81
87
|
"npm": "^11.16.0",
|
|
82
|
-
"
|
|
88
|
+
"nanoid@3.x": "^3.3.17",
|
|
89
|
+
"undici@6.x": "^6.28.0",
|
|
90
|
+
"undici@7.x": "^7.29.0",
|
|
91
|
+
"brace-expansion@1.x": "^1.1.18",
|
|
92
|
+
"brace-expansion@2.x": "^2.1.4"
|
|
83
93
|
}
|
|
84
94
|
}
|
|
@@ -193,3 +193,127 @@ describe('ApprovalService.consumeApproval (AC-R5S9MH.1)', () => {
|
|
|
193
193
|
expect(service.consumeApproval(request.id)).toBe(false);
|
|
194
194
|
});
|
|
195
195
|
});
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Tool-argument schema validation (FunctionBridge.validateToolArguments).
|
|
199
|
+
*
|
|
200
|
+
* Exercised through the public surface: getFunctionDefinitions() caches each
|
|
201
|
+
* MCP tool's inputSchema, then handleFunctionCall() validates the cleaned args
|
|
202
|
+
* against it before dispatching to the MCP server.
|
|
203
|
+
*
|
|
204
|
+
* This is the project's only Ajv surface, and Ajv resolves `$ref` URIs through
|
|
205
|
+
* fast-uri — so these tests also pin the behaviour that the `fast-uri` override
|
|
206
|
+
* in package.json governs. Approval mode is 'never' so every call reaches the
|
|
207
|
+
* validation branch without an approval round-trip.
|
|
208
|
+
*/
|
|
209
|
+
describe('FunctionBridge tool-argument validation', () => {
|
|
210
|
+
let approvalService: ApprovalService;
|
|
211
|
+
let mcpManager: MCPClientManager;
|
|
212
|
+
let functionBridge: FunctionBridge;
|
|
213
|
+
|
|
214
|
+
const toolWithRefSchema = {
|
|
215
|
+
serverName: 'files',
|
|
216
|
+
name: 'read_file',
|
|
217
|
+
description: 'Read a file',
|
|
218
|
+
inputSchema: {
|
|
219
|
+
type: 'object',
|
|
220
|
+
properties: {
|
|
221
|
+
path: { $ref: '#/$defs/nonEmptyString' },
|
|
222
|
+
maxBytes: { type: 'integer', minimum: 1 },
|
|
223
|
+
},
|
|
224
|
+
required: ['path'],
|
|
225
|
+
$defs: {
|
|
226
|
+
nonEmptyString: { type: 'string', minLength: 1 },
|
|
227
|
+
},
|
|
228
|
+
},
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
beforeEach(async () => {
|
|
232
|
+
approvalService = new ApprovalService(300);
|
|
233
|
+
mcpManager = new MCPClientManager([]);
|
|
234
|
+
functionBridge = new FunctionBridge(mcpManager, approvalService, [], 'never');
|
|
235
|
+
|
|
236
|
+
jest.spyOn(mcpManager, 'listAllTools').mockResolvedValue([toolWithRefSchema]);
|
|
237
|
+
// Populates the internal schema cache keyed by `${serverName}:${name}`
|
|
238
|
+
await functionBridge.getFunctionDefinitions();
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
afterEach(() => {
|
|
242
|
+
approvalService.shutdown();
|
|
243
|
+
jest.restoreAllMocks();
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
it('compiles a $ref/$defs schema and accepts valid arguments', async () => {
|
|
247
|
+
const callToolSpy = jest.spyOn(mcpManager, 'callTool').mockResolvedValue({ ok: true });
|
|
248
|
+
|
|
249
|
+
const result = await functionBridge.handleFunctionCall('duckA', 'mcp__files__read_file', {
|
|
250
|
+
path: '/etc/hosts',
|
|
251
|
+
maxBytes: 1024,
|
|
252
|
+
_mcp_server: 'files',
|
|
253
|
+
_mcp_tool: 'read_file',
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
expect(result.success).toBe(true);
|
|
257
|
+
expect(callToolSpy).toHaveBeenCalledWith('files', 'read_file', {
|
|
258
|
+
path: '/etc/hosts',
|
|
259
|
+
maxBytes: 1024,
|
|
260
|
+
});
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
it('rejects arguments that violate the schema and does not call the tool', async () => {
|
|
264
|
+
const callToolSpy = jest.spyOn(mcpManager, 'callTool').mockResolvedValue({ ok: true });
|
|
265
|
+
|
|
266
|
+
// `path` resolves through $ref to { minLength: 1 } — an empty string fails
|
|
267
|
+
const result = await functionBridge.handleFunctionCall('duckA', 'mcp__files__read_file', {
|
|
268
|
+
path: '',
|
|
269
|
+
_mcp_server: 'files',
|
|
270
|
+
_mcp_tool: 'read_file',
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
expect(result.success).toBe(false);
|
|
274
|
+
expect(result.error).toContain('Invalid arguments for files:read_file');
|
|
275
|
+
expect(callToolSpy).not.toHaveBeenCalled();
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
it('rejects a missing required property', async () => {
|
|
279
|
+
const callToolSpy = jest.spyOn(mcpManager, 'callTool').mockResolvedValue({ ok: true });
|
|
280
|
+
|
|
281
|
+
const result = await functionBridge.handleFunctionCall('duckA', 'mcp__files__read_file', {
|
|
282
|
+
maxBytes: 10,
|
|
283
|
+
_mcp_server: 'files',
|
|
284
|
+
_mcp_tool: 'read_file',
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
expect(result.success).toBe(false);
|
|
288
|
+
expect(result.error).toContain('Invalid arguments for files:read_file');
|
|
289
|
+
expect(callToolSpy).not.toHaveBeenCalled();
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
it("strips unknown properties before dispatch (Ajv removeAdditional: 'all')", async () => {
|
|
293
|
+
const callToolSpy = jest.spyOn(mcpManager, 'callTool').mockResolvedValue({ ok: true });
|
|
294
|
+
|
|
295
|
+
const result = await functionBridge.handleFunctionCall('duckA', 'mcp__files__read_file', {
|
|
296
|
+
path: '/etc/hosts',
|
|
297
|
+
smuggled: 'should-not-reach-the-server',
|
|
298
|
+
_mcp_server: 'files',
|
|
299
|
+
_mcp_tool: 'read_file',
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
expect(result.success).toBe(true);
|
|
303
|
+
expect(callToolSpy).toHaveBeenCalledWith('files', 'read_file', { path: '/etc/hosts' });
|
|
304
|
+
});
|
|
305
|
+
|
|
306
|
+
it('skips validation when no schema is cached for the tool', async () => {
|
|
307
|
+
const callToolSpy = jest.spyOn(mcpManager, 'callTool').mockResolvedValue({ ok: true });
|
|
308
|
+
|
|
309
|
+
// `files:write_file` was never returned by listAllTools, so no schema exists
|
|
310
|
+
const result = await functionBridge.handleFunctionCall('duckA', 'mcp__files__write_file', {
|
|
311
|
+
anything: 123,
|
|
312
|
+
_mcp_server: 'files',
|
|
313
|
+
_mcp_tool: 'write_file',
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
expect(result.success).toBe(true);
|
|
317
|
+
expect(callToolSpy).toHaveBeenCalledWith('files', 'write_file', { anything: 123 });
|
|
318
|
+
});
|
|
319
|
+
});
|