Skip to content

armgit / rea

Public Imported from GitHub
0

Reverse engineer anything with agents, from app behavior down to native binaries.

fix(environment): refuse UNC pathname in file:// URI before fileURLToPath (#6272)

ithis0623-pngaff5e23ecf83
diff --git a/src/server/environment/stateIntake.ts b/src/server/environment/stateIntake.ts
index f1302a847..f5ffeb8d3 100644
--- a/src/server/environment/stateIntake.ts
+++ b/src/server/environment/stateIntake.ts
@@ -299,6 +299,7 @@ const UNC_PATH = /^[\\/]{2}/u;
/** The local path a `file://` uri names; another host or a UNC path would open a network share, so neither is opened. */
const localFilePath = (url: URL): Result<string, RpcError> => {
if (url.host !== "" && url.host !== "localhost") return err(NETWORK_SHARE);
+ if (UNC_PATH.test(url.pathname)) return err(NETWORK_SHARE);
let path: string;
try {
path = fileURLToPath(url);