fix(contracts): reject OS-invalid local paths in binary and artifact tools (#1925)
* fix(contracts): reject OS-invalid local paths in binary and artifact tools Enforce localPathStringSchema across inspect_pe_resources, inspect_binary_layout, inspect_recorded_crash, inspect_wasm_artifact, and inspect_evm_interface input schemas to reject embedded NUL bytes at the contract boundary instead of failing later during filesystem operations. Add corresponding acceptance test cases to the advertised MCP contracts matrix in localToolContracts.test.ts. Signed-off-by: Vinícius DS Andrade <95101505+viniciusdsandrade@users.noreply.github.com> * style(contracts): wrap pe resources path description under print width Wrap the inspectPeResourcesInputSchema path property description to keep lines within the 80-column oxfmt limit. Signed-off-by: Vinícius DS Andrade <95101505+viniciusdsandrade@users.noreply.github.com> --------- Signed-off-by: Vinícius DS Andrade <95101505+viniciusdsandrade@users.noreply.github.com>
This commit is contained in:
@@ -1,14 +1,15 @@
|
||||
import { z } from "zod";
|
||||
|
||||
import { localPathStringSchema } from "../localPath.js";
|
||||
|
||||
const byteOffset = z.number().int().nonnegative();
|
||||
const sha256 = z.string().regex(/^[a-f0-9]{64}$/);
|
||||
|
||||
/** Select the carrier representation explicitly; no RPC or deployed-contract lookup is implied. */
|
||||
export const inspectEvmInterfaceInputSchema = z.strictObject({
|
||||
path: z
|
||||
.string()
|
||||
.min(1)
|
||||
.describe("Absolute path to caller-selected local bytecode carrier"),
|
||||
path: localPathStringSchema.describe(
|
||||
"Absolute path to caller-selected local bytecode carrier",
|
||||
),
|
||||
encoding: z
|
||||
.enum(["raw", "hex"])
|
||||
.describe(
|
||||
|
||||
Reference in New Issue
Block a user