Skip to content

Commit 3b4c60f

Browse files
committed
fix(deps): update fast-uri security patches
1 parent 7504a3b commit 3b4c60f

5 files changed

Lines changed: 66 additions & 10 deletions

File tree

‎.github/release/vercel-cli/package-lock.json‎

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎pnpm-lock.yaml‎

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎pnpm-workspace.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ overrides:
3232
"@aws-sdk/xml-builder": 3.972.40
3333
"@hono/node-server": 2.1.1
3434
axios: 1.19.0
35-
fast-uri: 4.1.2
35+
fast-uri: 4.1.3
3636
follow-redirects: 1.16.0
3737
defu: 6.1.7
3838
fast-xml-parser: 5.11.0

‎scripts/materialize-vercel-cli.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ github_output="${3:-}"
88

99
package_json="${source_root}/package.json"
1010
package_lock="${source_root}/package-lock.json"
11-
expected_lock_sha256="85e611c2d409f9ce91f2f85bdfbdf02fdaaead2e2e4ba7dfaaac9c7220d6b021"
11+
expected_lock_sha256="baa314f7f353aa4146efc0c2ab1b31f37a3941ed2f8aacaf50ba0ed248ac8e7f"
1212
expected_vercel_integrity="sha512-Bj/SN1qln/9guMcIz4gEGn+Ij+amGtkT2kqxwUAFgrLU2Hr0zYk4kX4QfxmZEs6WhheAaMlblVw2VUF2JFP5fA=="
1313
test -f "${package_json}"
1414
test -f "${package_lock}"

‎src/agents/mcp-tool-metadata.test.ts‎

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,62 @@ function tool(name: string, overrides: Partial<Tool> = {}): Tool {
88
}
99

1010
describe("normalizeMcpToolCatalog", () => {
11+
it.each([
12+
["IDN hosts", "https://bücher.example/value", "https://xn--bcher-kva.example/value"],
13+
["relative references", "child", "./child"],
14+
["local fragments", "#value", "#value"],
15+
["reserved path escapes", "a%3Ab", "a%3Ab"],
16+
])("validates tool output schemas with %s", (_label, id, ref) => {
17+
const normalized = normalizeMcpToolCatalog(
18+
[
19+
tool("referenced", {
20+
outputSchema: {
21+
$id: "https://schema.example/root",
22+
type: "object",
23+
definitions: { value: { $id: id, type: "string" } },
24+
properties: { value: { $ref: ref } },
25+
required: ["value"],
26+
},
27+
}),
28+
],
29+
createMcpJsonSchemaValidator(),
30+
);
31+
const validate = normalized.metadata.validatorForCall("referenced")!;
32+
33+
expect(() => validate({ content: [], structuredContent: { value: "ok" } })).not.toThrow();
34+
expect(() => validate({ content: [], structuredContent: { value: 1 } })).toThrow(
35+
"Structured content does not match the tool's output schema",
36+
);
37+
});
38+
39+
it("keeps nested hostname escapes distinct when resolving tool output schemas", () => {
40+
const validate = createMcpJsonSchemaValidator().getValidator({
41+
$id: "https://schema.example/root",
42+
definitions: {
43+
encoded: { $id: "https://127%252e0%252e0%252e1/value", const: "encoded" },
44+
plain: { $id: "https://127.0.0.1/value", const: "plain" },
45+
},
46+
$ref: "https://127%252e0%252e0%252e1/value",
47+
});
48+
49+
expect(validate("encoded").valid).toBe(true);
50+
expect(validate("plain").valid).toBe(false);
51+
});
52+
53+
it.each([
54+
["encoded scheme delimiters", "%2f%2fschema.example:/value", "URI scheme is malformed"],
55+
["invalid IPv6", "https://[1:2:3::4::5]/value", "URI host is malformed"],
56+
["malformed percent escapes", "https://schema.example/%ZZ", "malformed percent-encoding"],
57+
])("rejects %s in tool output schema references", (_label, ref, error) => {
58+
expect(() =>
59+
createMcpJsonSchemaValidator().getValidator({
60+
$id: "https://schema.example/root",
61+
definitions: { value: { $id: ref, type: "string" } },
62+
$ref: ref,
63+
}),
64+
).toThrow(error);
65+
});
66+
1167
it.each([
1268
{
1369
label: "trim-equivalent names",

0 commit comments

Comments
 (0)