Repository navigation
feat: add Plugin Listing Workbench (submission-workbench) — 插件上架材料工作台 - #145
zhuyankarl wants to merge 2 commits into
Conversation
|
The asset-delete and bundle-download endpoints accept IDs that can escape their intended directories. At In isolated temporary-directory tests against the Node server, Please validate IDs against the server-generated UUID format and check that resolved paths remain inside the asset and bundle directories before deleting or reading files. Add regression tests for valid IDs and traversal inputs. These directory-traversal issues need to be fixed before merging. |
评审指出 `DELETE /api/assets` 与 `GET /api/package/download` 直接把查询参数拼进文件路径, `../../canary` 可以越出 dataDir 删除或读出上级的 `.bin` / `.zip` 文件。 - `store.mjs` 新增 `resolveInside()`:id 必须匹配服务端 `randomUUID()` 生成的 v4 UUID 格式, 且解析后的路径必须仍落在素材目录 / 材料包目录内,两道检查都过才允许读写。 `saveAsset` / `readAssetBytes` / `deleteAsset` / `savePackage` / `readPackageBytes` / `deletePackage` 六个入口全部改走它。 - `server.mjs` 把 `InvalidIdError` 映射成 400 `invalid_id`,非法 id 不再是 500。 - 新增 `tests/path-traversal.mjs`:在 dataDir 上一级放 canary 文件,覆盖 13 组穿越输入 (正斜杠、反斜杠、`%2f` 编码、绝对路径、UUID 后缀拼接、NUL 等)× store 层与 HTTP 层, 并验证合法 UUID 的删除与下载仍然可用。175 passed, 0 failed。 - 版本 1.1.0 → 1.1.1;README 的 Data & access 与自测清单同步更新。 包内自测:selftest 49、client-harness 46、server-harness 32、path-traversal 175,全绿。 上游 `npm run validate`:`plugins/zhuyankarl/submission-workbench: OK`、`repository: OK`。 上游 `npm test` 的 2 个 symlink 用例仍失败,原因是本机 Windows 账户无 symlink 权限(EPERM), 与本包无关,改动前后一致。
|
Thanks — confirmed on our side, and fixed in What was wrongEvery id in the store is produced by await rm(join(this.assetsDir, `${id}.bin`), { force: true }); // deleteAsset
return await readFile(join(this.packagesDir, `${id}.zip`)); // readPackageBytesSo The fix
function resolveInside(directory, id, suffix) {
if (typeof id !== 'string' || !UUID_PATTERN.test(id)) {
throw new InvalidIdError('id 不是服务端生成的 UUID。');
}
const base = resolve(directory);
const target = resolve(base, `${id}${suffix}`);
const inside = relative(base, target);
if (inside === '' || inside.startsWith('..') || isAbsolute(inside)) {
throw new InvalidIdError('id 指向了目录之外。');
}
return target;
}Two independent checks, as asked: the id must match the canonical v4 UUID format All six entry points now use it —
Regression testsNew file
The test was falsified before shipping: with the two checks in Test resultsUnverified behaviour
Version 1.1.1 is a patch bump on 1.1.0; the plugin ID, the declared access and the minimum client version are unchanged. |
feat: add Plugin Listing Workbench (submission-workbench) — 插件上架材料工作台
A Mini App that prepares a MiniMax Plugin submission: paste the plugin manifest and the listing
fields, get every required field and cross-file inconsistency checked item by item, and download
a reviewable listing package that names what is missing. A bundled
listing-checkSkill handsthe same checklist to the Agent.
What it does
.minimax-plugin/plugin.json, then set the marketname, target category, summary, documentation (written into the package
README.md) and up to3 example queries.
email, submitting Feishu account, target region (CN/US) and enabled clients
(desktop/cloud). Region and enabled clients are two independent dimensions managed by the
Marketplace catalog; they are not written into
plugin.json.Skill/MCP/App files.
this machine can reach, and the downloadable listing package.
listing-checkgives the Agent the same checklist: required manifestfields, the fixed categories, the "at least one capability" rule, the version-bump rule, the
package limits and the two official intake channels.
It never submits anything. The official intake channels are a Feishu form (a human submits it in
a logged-in browser) and a public GitHub repository, so the app only produces materials you can
review — and it says exactly that in its own report.
Update (2026-11-19) — the review found that the two id-taking routes built their file paths
from the query string without validation, so
../../canarycould delete or read a file one levelabove the data directory. Fixed in
803ac0f(v1.1.1): every id must be a server-generated UUID andthe resolved path must stay inside the asset or package directory; regression tests live in
tests/path-traversal.mjs. Details and evidence are in the comment below.Tested environment
dependencies and no build step).
Test results
npm run validatein this repository reportsplugins/zhuyankarl/submission-workbench: OKand
repository: OK— 0 errors and 0 warnings for this package.node tests/selftest.mjs→ 49 passed, 0 failed;node tests/client-harness.mjs→ 46 passed, 0 failed;node tests/server-harness.mjs→ 32 passed, 0 failed;node tests/path-traversal.mjs→ 175 passed, 0 failed.0 warnings and 0 missing items, and the listing package downloads as a ZIP whose root contains
.minimax-plugin/plugin.json.e013a525694917ed5d8acaf7c1ea39612a99b8272a2744cddc985d52a4398379.Unverified behaviour
cloud client is not enabled.
npm testin this repository has two failing tests —files: a symlink inside the package is an errorandfiles: a package root that is itself a symlink is rejected before walking. Theyfail because
fs.symlinkreturnsEPERMon this Windows account without symlink privileges,and they fail independently of this package.
Package layout
Data & access
under the writable data directory the Host provides for this plugin
(
<dataDir>/v2/plugin-data/liveboards/submission-workbench/). It never writes into the pluginpackage itself. Every asset and package id is a UUID this server generates; an id that is not one
is refused before it can name a file, and the resolved path is checked to stay inside the asset
and package directories.
GETrequeststo see whether the documented intake channels are reachable — the submission guide on
code.minimax.cnand two Feishu form URLs onvrfi1sk8a0.feishu.cn. There is no otheroutbound traffic. The Node service listens on the loopback port the Host assigns it.
miniapp/miniapp.jsondeclares noagentAccess).toolAccess).hostAccess).Where else this package lives
The same package is published in the author's own repository and can be installed from there:
https://github.com/zhuyankarl/mcode-plugins/tree/main/plugins/submission-workbench
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.