mcp-shadow 0.1.3 → 0.1.4
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/README.md +2 -2
- package/dist/cli.js +11 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -256,10 +256,10 @@ shadow list # List available scenarios
|
|
|
256
256
|
Show your users your agent has been tested. Add this to your README:
|
|
257
257
|
|
|
258
258
|
```markdown
|
|
259
|
-
[](https://github.com/shadow-mcp/shadow-mcp)
|
|
260
260
|
```
|
|
261
261
|
|
|
262
|
-
[](https://github.com/shadow-mcp/shadow-mcp)
|
|
263
263
|
|
|
264
264
|
## License
|
|
265
265
|
|
package/dist/cli.js
CHANGED
|
@@ -10335,7 +10335,7 @@ var {
|
|
|
10335
10335
|
import { spawn } from "child_process";
|
|
10336
10336
|
import { resolve, dirname, extname } from "path";
|
|
10337
10337
|
import { fileURLToPath } from "url";
|
|
10338
|
-
import { readFileSync, existsSync } from "fs";
|
|
10338
|
+
import { readFileSync, existsSync, realpathSync } from "fs";
|
|
10339
10339
|
import { createServer } from "http";
|
|
10340
10340
|
|
|
10341
10341
|
// packages/core/dist/state-engine.js
|
|
@@ -11002,10 +11002,19 @@ program2.command("demo").description("Run a scripted demo \u2014 no API key requ
|
|
|
11002
11002
|
".woff": "font/woff",
|
|
11003
11003
|
".woff2": "font/woff2"
|
|
11004
11004
|
};
|
|
11005
|
+
const realConsoleDist = realpathSync(consoleDist);
|
|
11005
11006
|
const server = createServer((req, res) => {
|
|
11006
11007
|
const urlPath = req.url?.split("?")[0] || "/";
|
|
11007
11008
|
let filePath = resolve(consoleDist, urlPath === "/" ? "index.html" : urlPath.slice(1));
|
|
11008
|
-
|
|
11009
|
+
try {
|
|
11010
|
+
const realFilePath = realpathSync(filePath);
|
|
11011
|
+
if (!realFilePath.startsWith(realConsoleDist)) {
|
|
11012
|
+
res.writeHead(403);
|
|
11013
|
+
res.end("Forbidden");
|
|
11014
|
+
return;
|
|
11015
|
+
}
|
|
11016
|
+
filePath = realFilePath;
|
|
11017
|
+
} catch {
|
|
11009
11018
|
filePath = resolve(consoleDist, "index.html");
|
|
11010
11019
|
}
|
|
11011
11020
|
try {
|