diff --git a/src/extension/networkInspector/certificateProvider.ts b/src/extension/networkInspector/certificateProvider.ts index 7bcfc4737..5377cb916 100644 --- a/src/extension/networkInspector/certificateProvider.ts +++ b/src/extension/networkInspector/certificateProvider.ts @@ -332,7 +332,7 @@ export class CertificateProvider { } private validateDestinationPath(destination: string, os: ClientOS): void { - if (destination.split(/[\\/]+/).includes("..")) { + if (destination.split(path.sep).includes("..")) { throw new Error(`Path traversal not allowed in destination: ${destination}`); } diff --git a/test/extension/commands/installPods.test.ts b/test/extension/commands/installPods.test.ts index 5687aa165..e3913046f 100644 --- a/test/extension/commands/installPods.test.ts +++ b/test/extension/commands/installPods.test.ts @@ -328,6 +328,9 @@ suite("installPodsCommand", function () { suite("Enhanced environment", function () { test("should inject Ruby and CocoaPods paths and default shell and locale values", function () { + if (process.platform !== "darwin") { + this.skip(); + } const homeDir = "/Users/test-user"; const originalEnv = { PATH: process.env.PATH,