@lhhzmz229/dsh-api-runner avatar

@lhhzmz229/dsh-api-runner

DSH 插件:按 YAML 配置调用后端接口、启停/接管本地 Java 服务、按字节偏移增量读日志并等待日志特征,让模型改完代码自己验证

PluginDeveloperNetworkTerminal / ShellFile
Verification
L5 · Run tested
Verified
Risk
LowRisk
Health
Active
Trust
Gold

Install verification: runtime verified (L5) · tested on dsh 0.2.1-rc.2 · last checked Install verification details →

Install verification badge dsh 0.2.1-rc.2

What it doesAI

Lets the model call YAML-configured backend APIs, start/stop local Java services, and tail logs by byte offset to self-verify code changes.

  • Call YAML-configured HTTP APIs with login, token save and one-click test
  • Start, stop and take over running local Java / Spring Boot services
  • Byte-offset incremental log reading with wait-for-log-pattern support
developerAIterminalAIfileAI

Capability tags are AI-inferred or rule-extracted from the README (see badge) — vocabulary-limited, not install-verified. AI = inferred; README = literal keyword from the readme.

Installation

dsh plugin --profile web add dsh-api-runner
verified 0.2.0

Install method: npm · runtime verified (L5)

Verification & Compatibility

Grouped by plugin version: each card lists the dsh versions actually tested against that artifact version and their install verdicts (L5 wins). Untested combinations are omitted — absence means untested, never assumed compatible. L1–L3 are a plugin-level static archive (independent of the dsh version — the same verdict on every dsh row): they sit in each row's level grid next to L4/L5, marked "static", while their evidence is stored once per plugin inside that row's "checks & evidence" instead of being duplicated per version.

External credentials (plugin-level): none detected

Declared DSH compatibilityfrom package.json · peerDependencies
package manifest not collected

package manifest not collected — the declared range is unknown.

Install compatibility matrix (rows = plugin versions〔latest 5〕, columns = dsh versions〔latest 5〕)
At-a-glance → evidence in the cards below
plugin \ dshdsh 0.2.1-rc.2
current
0.2.0✓
Install compatibility (by plugin version, dsh versions within)
Legend:✓ L5 runtime verified○ ecosystem plugin◼ ecosystem app✗ failed
0.2.0npm✓ 1 runtime-verified2026-10-22

dsh-api-runner

✓dsh 0.2.1-rc.2current2026-10-22L5 · runtime verified
Environment & artifact
  • • Node.js: v24.14.0
  • • DSH: 0.2.1-rc.2
  • • Plugin artifact: npm · dsh-api-runner@0.2.0
Levels (L1–L3 plugin-level static archive · L4/L5 newest real verdicts for this combination)
L1 static
Passed
L2 static
Passed
L3 static
Passed
L4 sandbox
Passed
L5 runtime
Passed
Install + runtime smoke verified in the dsh sandbox — installs and runs
L5 · runtime verified · valid for dsh 0.2.1-rc.2

ID: dsh-api-runner@0.2.0@dsh0.2.1-rc.2 · profile: l4-sandbox

Issued: 2026-10-22 · expires: 2026-10-29

View checks & evidence
L1 · Found✓ Passed

↳ carried from earlier record dsh-api-runner@cbef50@dsh0.2.1-rc.2 (l3-fullscan)

Defaulted from L3✓ Passed
defaulted to passed — L3 install spec passed (full-registry L3 sweep policy)
L2 · Structured✓ Passed

↳ carried from earlier record dsh-api-runner@cbef50@dsh0.2.1-rc.2 (l3-fullscan)

Defaulted from L3✓ Passed
defaulted to passed — L3 install spec passed (full-registry L3 sweep policy)
L3 · Install spec✓ Passed

↳ carried from earlier record dsh-api-runner@cbef50@dsh0.2.1-rc.2 (l3-fullscan)

Install command parsed✓ Passed
Source: registry verification · Method: install spec parse · Captured 2026-10-22
DSH version declared✓ Passed
Source: registry verification · Method: DSH version declaration · Captured 2026-10-22
L4 · Install tested✓ Passed
Install executed in confined sandbox✓ Passed
Source: Windows ACL sandbox · Method: sandbox install run · Captured 2026-10-22
spec dsh-api-runner · channel npm package · outcome ran · exit 0
check took: 6.0s
Install succeeded✓ Passed
Source: Windows ACL sandbox · Method: sandbox install run · Captured 2026-10-22
spec dsh-api-runner · channel npm package · outcome ran · exit 0
check took: 6.0s
Installed artifact confirmed✓ Passed
Source: Windows ACL sandbox · Method: sandbox install run · Captured 2026-10-22
spec dsh-api-runner · channel npm package · outcome ran · exit 0
check took: 6.0s
Resolved version recorded✓ Passed
Source: Windows ACL sandbox · Method: sandbox install run · Captured 2026-10-22
spec dsh-api-runner · channel npm package · outcome ran · exit 0
check took: 6.0s
L5 · Run tested✓ Passed

active in loader tree (150 entries)

Sandbox install passed✓ Passed
Source: Windows ACL sandbox · Method: sandbox install run · Captured 2026-10-22
spec dsh-api-runner · install mode reused L4 scratch
check took: 399ms
Web boot ready✓ Passed
Source: DSH runtime · Method: web boot · Captured 2026-10-22
ready line dsh web: http://127.0.0.1:49873/?token=…
HTTP endpoint served✓ Passed
Source: DSH runtime · Method: HTTP request · Captured 2026-10-22
path / · HTTP 200 · took 399ms
Plugin active in inventory✓ Passed
Source: DSH runtime · Method: plugin inventory query · Captured 2026-10-22
verdict active · entries 150
match: include:api-runner · dsh-api-runner · phase active
phases: active 122 · null 28

L1–L3 are plugin-level static conclusions (baseline, identical across dsh versions): evidence is stored once per plugin.

Only the latest 3 published versions are shown; source-snapshot (commit hash) groups, unstated groups and older versions are omitted — the full archive stays in the data layer (snapshot/unstated groups appear only when a plugin has no published version).

Author badges

Embed the official badges in your README to showcase security & install-test status:

dsh.so risk
`[![dsh.so risk](https://www.dsh.so/badge/dsh-api-runner.svg)](https://www.dsh.so/artifact/dsh-api-runner/)`
dsh 0.2.1-rc.2 install verified
`[![dsh.so install · dsh 0.2.1-rc.2](https://www.dsh.so/badge/install/dsh-api-runner@0.2.1-rc.2.svg)](https://www.dsh.so/artifact/dsh-api-runner/)`

Security Report

Two automated layers, neither a manual review: a static scan (per-plugin rule checks) and a model-driven dynamic security audit that covers only the subset static-flagged at warn or above and never executes plugin code.

dsh-api-runnerAutomated review · daily

Static low, dynamic medium — stricter wins → overall medium.

static low→dynamic medium→overall medium
0 critical·0 high
mediumoverall · medium
1static scan · vet primaryvet AST static analysis (npm artifact or git source)
plugin versionv0.2.0dsh manifest
scanned version0.2.0npm2026-10-22
current version0.2.0same version
vet verdictclean · npm

Vet is an AST static scan (npm artifact or git source).

show static findings (12)
  • warningfsWrite · filessrc/java-runner.js:123

    fs.writeFileSync(tmp, JSON.stringify(doc, null, 2), 'utf8');

  • warningfsWrite · filessrc/java-runner.js:317

    fs.appendFileSync(logPath, `\n==== ${new Date().toISOString()} ${reason} ====\n`, 'utf8');

  • warningshellExec · shellsrc/java.js:21

    execFile(file, args, { timeout: timeoutMs, windowsHide: true, maxBuffer: 8 * 1024 * 1024 }, (error, stdout) => {

  • warningshellExec · shellsrc/java.js:527

    execFile(file, args, { timeout: timeoutMs, windowsHide: true, maxBuffer: 8 * 1024 * 1024 }, (error, stdout, stderr) => {

  • warningnetIp · networksrc/main.js:430

    const url = new URL(req.url || '/', 'http://127.0.0.1');

  • warningnetIp · networksrc/ops.js:574

    baseUrl: item.httpPort ? `http://127.0.0.1:${item.httpPort}` : '',

  • warningnetIp · networksrc/ops.js:966

    baseUrl: httpPort ? `http://127.0.0.1:${httpPort}` : '',

  • warningfsWrite · filessrc/project-store.js:73

    fs.writeFileSync(tmp, JSON.stringify(doc, null, 2), 'utf8');

  • warningchildProcess · code-execsrc/restart.js:462

    child = spawn(exe, argv, {

  • warningshellExec · shellsrc/restart.js:117

    execFile(cmd, args, { timeout: 6000, windowsHide: true }, (error, stdout) => resolve(error ? '' : String(stdout || '')));

  • warningshellExec · shellsrc/restart.js:159

    execFile(isWindows ? 'where' : 'which', ['mvn'], { timeout: 5000, windowsHide: true }, (error, stdout) => {

  • warningshellExec · shellsrc/restart.js:342

    const child = execFile(

2model reads redacted source context · never executes plugin code
highest grademedium
merged intooverall medium
audited at2026-10-22
findings0 critical·0 high2 medium / 2 low hidden
show 4 audit findings
  • mediumAuth fence on /dsh-api-runner/api is applied conditionally and fails opensrc/main.js:265

    The comment states host authentication does not cover plugin prefix routes, so this optional call is the only gate. If requestRejection is not a function on the deployed host, rejection is undefined and every route runs unauthenticated: java/start|stop|restart (process kill/spawn), settings POST (arbitrary dataDir/mavenHome), project config read and outbound API calls. Any local process, or a DNS-rebinding page reaching the local web server, could then drive process control.

  • mediumjava start kills whatever pid it is given, with no project or ownership checksrc/java-runner.js:259

    The only precondition is a successful jcmd snapshot (any JVM on the machine). Callers are the unauthenticated-by-design HTTP route `java/start` (body.pid) and the ApiRunner tool (model-supplied pid). The plugin then terminates the whole process tree of that JVM and relaunches it from the snapshot. The model path is reachable indirectly because log files and HTTP response bodies are returned verbatim into the model context, so planted text can steer it to kill an unrelated service.

  • lowClient-supplied absolute path is accepted as project key, allowing cross-project config read/writesrc/main.js

    pickCwd/pickProject honour an absolute path from the request body or query string, so a caller who can reach the route (or bypass the fence) can make the plugin parse `<dir>/.dsh/api-runner.yml` for any directory and return its api ids/urls/service commands/log paths, and write project buckets under that key.

  • lowLog id sanitizer keeps dots, so an id of ".." writes outside the java-logs directorysrc/java-runner.js:172

    `[^\w.-]` allows '.', so an id of '..' (attacker-influenced via java_action=start id / HTTP body.id, which is passed to logPathOf and _ensureLogHeader) resolves to <dataDir>/<timestamp>.log, creating or appending a file one level above the intended per-service directory. The filename is a fixed timestamp, so impact is limited to stray file creation outside the managed tree.

No critical issue, but the plugin's HTTP prefix route applies its auth fence conditionally (fail-open), and java start can kill any JVM by pid with no ownership check.

Rule: the dynamic audit can only raise risk, never lower it (raise-only, never an exemption); a wrong raise is withdrawn by human review and the tier falls back to the static verdict. Overall verdict = the stricter of the two layers.

Disclaimer: the static scan and the dynamic security audit are both automated analysis, not a security guarantee. Always review what you install.

Activity

Last commit 2026-10-22 · activity: Active

• Repo created: 2026-10-21

• Stars: ★ 1 · Forks: 0

• Health: Active — committed within last 30 days

Source

GitHub: github.com/lhhzmz229/dsh-api-runner

Was this page helpful?