super-opencode 1.1.1 → 1.1.2

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.
Files changed (2) hide show
  1. package/dist/cli.js +6 -3
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -21,8 +21,11 @@ const FALLBACK_FILENAME = "mcp_settings.json";
21
21
  function resolveSafePath(baseDir, targetPath) {
22
22
  const resolvedBase = path.resolve(baseDir);
23
23
  const resolvedTarget = path.resolve(targetPath);
24
- if (!resolvedTarget.startsWith(resolvedBase + path.sep) &&
25
- resolvedTarget !== resolvedBase) {
24
+ // Normalize paths for cross-platform comparison
25
+ const normalizedBase = path.normalize(resolvedBase).toLowerCase();
26
+ const normalizedTarget = path.normalize(resolvedTarget).toLowerCase();
27
+ if (!normalizedTarget.startsWith(normalizedBase + path.sep) &&
28
+ normalizedTarget !== normalizedBase) {
26
29
  throw new Error(`Path traversal detected: ${resolvedTarget} is outside ${resolvedBase}`);
27
30
  }
28
31
  return resolvedTarget;
@@ -275,7 +278,7 @@ async function collectMcpServerConfigs(selectedServers, targetDir) {
275
278
  async function writeMcpConfiguration(mcpServers, scope, targetDir) {
276
279
  const configPath = scope === "global"
277
280
  ? path.join(os.homedir(), ".config", "opencode", CONFIG_FILENAME)
278
- : path.join(process.cwd(), CONFIG_FILENAME);
281
+ : path.join(targetDir, CONFIG_FILENAME);
279
282
  let finalSettings = {};
280
283
  let writeTarget = configPath;
281
284
  if (scope === "global") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "super-opencode",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "Super-OpenCode Framework Installer",
5
5
  "type": "module",
6
6
  "main": "dist/cli.js",