@extenshi/mcp
Version:
Extenshi MCP server — bring the extension catalog (search, security, market research) and pre-publish scanning into your AI tools
23 lines • 1.03 kB
TypeScript
/**
* Workspace confinement for tool-supplied file paths.
*
* MCP tool arguments are model-controlled, and the "data, not
* instructions" boundary breaks the moment a prompt-injected agent can
* name an arbitrary absolute path: scan_extension would upload any
* .zip/.crx on the disk, publish_extension would ship any build it can
* point at, under the user's own credentials. project-media.ts already
* confines its reads to the workspace for exactly this reason; this is
* the same gate for artifact paths.
*
* The check runs on realpaths, so `../` segments and symlink hops out of
* the workspace are refused, not just literal absolute paths.
*/
export declare class WorkspacePathError extends Error {
constructor(message: string);
}
/**
* Resolve `filePath` against `root` (default: cwd) and require the real
* path to stay inside it. Returns the resolved real path.
*/
export declare function assertInsideWorkspace(filePath: string, root?: string): string;
//# sourceMappingURL=workspace-path.d.ts.map