Skip to content

[Bug]: Local path, shell, channel, plugin, and update checks use the wrong target #612

Open

Description

@Coff0xc

Summary

External pull requests are not accepted from this account. A reviewed fix branch is ready for the local boundary checks below. Reproduction steps are omitted from this public issue; SECURITY.md asks that vulnerability reproduction stay private. The branch contains the offline regression tests.

Searched existing issues first. #525 and #526 are symlink bugs in turn-diff and the desktop read/write/edit tools. This report is the permission auto-allow path, plus shell-wrapper, channel, team, plugin, and update checks.

Product or interface

CLI, including the interactive TUI update path and the local runtime. Source build.

Version

Source main at 3c21163 (chore(sdk-python): release 0.1.1). Node.js v24.19.0. pnpm 9.12.0.

Platform

Windows 11 Pro, build 26200.

Issue area

Tool call / permission / sandbox, and file / workspace / path.

Corrected behavior

The branch changes these checks:

  • Workspace auto-allow uses the canonical path, so a symlink inside the workspace is judged by its target.
  • bash -c, cmd /c, and powershell -c payloads are unwrapped when extra flags or a glued quote hide the inline command.
  • A WeChat webhook is rejected when the binding has no token.
  • A Feishu card action is accepted only when its chat id matches the pending request. This does not add Lark request signing.
  • Reading a team plan or its deliverable requires that plan's owner session. The plan list is unchanged, and from_session remains the caller-supplied session id.
  • An imported plugin directory name must be a single path segment inside the plugins root.
  • A prefix update deletes a staging directory only when it sits beside the active install and matches the staging name.

No new authentication layer is added to the localhost control plane.

Branch

https://github.com/Coff0xc/minimax-code/tree/security/boundary-fixes

Head e1fcc71. Commits from ce13135 through e1fcc71, based on 3c21163.

Validation

Windows, Node.js v24.19.0, Vitest 4.1.11:

npx --yes pnpm@9.12.0 exec vitest run --config vitest.oss.config.mjs on e1fcc71.

  • Six new files passed, 16 tests: bash-wrapper unwrap 4, prefix staging 2, team plan access 3, WeChat webhook token 3, Feishu card chat 2, plugin directory name 2.
  • fs-permission-runtime-read.test.ts -t "workspace symlink": 1 passed, 28 skipped. The passing case reads a regular file under the home directory. The two cases that deny a symlink out of the workspace did not run, because this account cannot create symlinks.

NOT RUN: pnpm verify, Linux and macOS CI, and live WeChat or Feishu callbacks.

Checklist

  • I have searched existing issues.
  • I have included the version and removed sensitive information. No credentials, account data, or reproduction steps are included.

Activity

  1. Ralle1976 commented on Nov 20, 2026

    @Ralle1976
    Contributor

    Two review observations on the branch — and one deliberate omission on my side

    Versionsanker

    Installierte CLI mcode --version → 0.7.8
    Veröffentlicht npm view @minimax-ai/code version → 0.7.8
    Quellstand main @ 3c21163 (package version 0.7.2), Tag v0.7.2 = c6c7f28
    Toolchain Node v24.18.0, pnpm 9.15.0
    Plattform Windows 11 Pro, build 26200, x64

    Was ich bewusst nicht veröffentliche. Sie schreiben, die Reproduktionsschritte seien wegen SECURITY.md weggelassen. Das halte ich für richtig, und deshalb enthält dieser Kommentar keine Reproduktion des von Ihnen beschriebenen Grenzfalls: keine Schritte, kein Fixture, keine Messung, die die Ausnutzbarkeit zeigt. Was ich gemessen habe, betrifft eine Windows-spezifische Alias-Form, die auf einem Standardkonto anlegbar ist — das ist eine Voraussetzung für Ihren Regressionstest, aber zugleich ein Exploit-Detail, und SECURITY.md sagt ausdrücklich: keine Exploit-Details in öffentlichen Issues. Ich habe es deshalb nicht hierher geschrieben und kann es über die private Adresse nennen, falls Sie es für die Testabdeckung brauchen. Die beiden folgenden Punkte sind davon unabhängig und enthalten keine Ausnutzbarkeit.

    1. Die v2-Hälfte der Prüfung ist aus dem veröffentlichten Baum nicht reviewbar. packages/local-runtime-v2/src/service/permission/decision/checkers.ts:14 importiert:

    import { evaluateWindowsPathSafetyCheck } from './windows/path-safety.js';

    und exportiert es weiter (:17). Diese Datei liegt in main @ 3c21163 nicht im Repository — git ls-tree -r findet keinen Pfad mit path-safety im gesamten Baum. Im veröffentlichten Quellbaum läuft der Import also ins Leere, und der v2-Teil der Windows-Pfadprüfung lässt sich von hier aus nicht nachvollziehen. Das betrifft nicht Ihren Fix, aber die Reviewbarkeit: wenn der v2-Zweig mit dem öffentlichen Inventar (release/public-source.json) nicht übereinstimmt, ist unklar, ob die Prüfung überhaupt ausgeliefert wird. Das v1-Pendant (packages/local-runtime/src/permissions/checkers.ts:1022) ist vorhanden — der Unterschied zwischen beiden Hälften ist also sichtbar, aber nur auf der v1-Seite.

    2. Für die Kanonisierung, die Sie planen, existiert im selben Paket bereits die plattformkorrekte Identitätsregel. Sie schreiben, der Workspace-Auto-Allow solle den kanonischen Pfad verwenden, damit ein Symlink im Workspace anhand seines Ziels beurteilt wird. Für die reine Windows-Identitätsfrage (dieselbe Datei, unterschiedliche Schreibweise) liegt im selben Paket bereits eine plattformkorrekte Funktion vor:

    // packages/agent-modules/permission/src/tools/path-identity.ts:4
    export function isSameResolvedPath(left, right, platform = process.platform): boolean {
      const pathApi = platform === 'win32' ? path.win32 : path;
      ...
      return platform === 'win32'
        ? resolvedLeft.toLowerCase() === resolvedRight.toLowerCase()
        : resolvedLeft === resolvedRight;
    }

    Sie wird in packages/agent-modules/permission/src/tools/fs-permission.ts:823 bereits verwendet. Der öffentliche Quellstand enthält daneben zwei unterschiedliche Regeln für dieselbe Frage: pathInWorkingPath (fs-permission.ts:531) vergleicht die aufgelösten Zeichenketten direkt und damit case-sensitiv, während isPathWithin (fs-permission.ts:830) über path.relative geht und unter Windows case-insensitiv vergleicht. Das fällt in die sichere Richtung (ein unnötiger Nachfrage-Dialog, keine Umgehung) — ich nenne es nur, weil es dieselbe Frage betrifft und weil isSameResolvedPath die passende Bausteinfunktion bereits existiert, statt eine neue eingeführt werden muss.

    Was ich nicht geprüft habe. Ob die Alias-Form, um die es hier geht, der einzige Windows-Fall mit dieser Wirkung ist, habe ich nicht getestet. Und die Kanal-/Team-Prüfungen aus Ihrer Liste haben im veröffentlichten Baum keinen Quellcode, weshalb ich dort nichts beitragen kann. Für die Shell-Wrapper-Prüfung habe ich nichts, das Ihre Liste ergänzt.

    Wenn Sie die Windows-spezifische Alias-Form für Ihre Regressionstests brauchen: SECURITY.md nennt die private Adresse, und ich lege die Details dort gerne bei.

    Edit 2026-11-19: zwei Passagen, die die Alias-Frage eingeengt hätten, wurden entfernt, damit dieser Kommentar keinen Hinweis auf die Alias-Form enthält. Eine Zeilenreferenz wurde korrigiert (:16 → :17).

  2. Coff0xc commented on Nov 20, 2026

    @Coff0xc
    Author

    Thank you for keeping that Windows-specific form out of this issue, including the edit that removed the two passages. That matches SECURITY.md. Please do not add the form, a fixture, or a measurement of it here. Anything further on that case belongs at the private address in SECURITY.md. I will not ask for it on this issue.

    On the two points that are independent of that case:

    1. v2 path check. packages/local-runtime-v2/src/service/permission/decision/checkers.ts imports ./windows/path-safety.js, and that file is not in the published tree at 3c21163. The v1 function is present in packages/local-runtime/src/permissions/checkers.ts. The v2 half cannot be reviewed from the public source. security/boundary-fixes at e1fcc71 does not add the missing file.

    2. Identity versus canonical target. Workspace auto-allow on that branch judges a symlink by its canonical target. That is separate from Windows case identity. Exact trusted targets in the same package already use isSameResolvedPath. The branch does not add another comparator. The split you noted is still there: pathInWorkingPath compares resolved strings directly, and isPathWithin goes through path.relative. I agree that difference fails toward an extra prompt.

    I have nothing to add on the channel and team checks from the published tree. I have not treated the omitted case as the only Windows case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions