Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

@iworkjs/dsh-plugin-api

Latest version: v0.1.0

Overview

Last scanned
25 Nov 2026
Published
25 Nov 2026
npm package Publisher: ifxc
2 Versions

Scan summary

@iworkjs/dsh-plugin-api was last scanned on 25 Nov 2026 at version 0.1.0. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 2 versions, all published on 25 Nov 2026.
  • Findings: No rules fired in version 0.1.0.

Versions

2 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.1.0 LATEST 25 Nov 2026 No rules fired
0.0.0-stage 25 Nov 2026 Not shown

No rules fired in 0.1.0

Findings

Findings for v0.1.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.1.0; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

@iwork/dsh-plugin-api

DeepSeek Harness 插件:以 iWork 的 OpenAPI 文档(/api/v1/openapi.json)为唯一真源,把 iWork REST API 自动转换为 Harness 可调用的 DshTool,并提供带认证的请求传输层与一个 iwork-api 内置 skill。

项目结构

src/
├── index.ts       # apply:拉取 OpenAPI、注册工具/skill/网关
├── openapi.ts     # JSON Schema → zod 与 DshTool 生成
├── gateway.ts     # 同源网关转发
├── dsh-env.d.ts   # 宿主模块最小类型声明
└── *.test.ts      # 生成、网关与入口测试

功能

  • 启动时从 iWork 服务端拉取 OpenAPI 文档,将每个 operation 生成为一个 iwork_api_* 工具注册到 Harness。
  • 由 Zod 从 JSON Schema 推导入参/响应校验(支持 $ref、enum、oneOf/anyOf、nullable、default)。
  • 工具入参统一为 { path, query, body } 结构,路由参数自动做 URL 编码,禁止跨源请求。
  • 内置 iwork-api skill,仅列出已注册工具,防止模型编造端点或凭据。
  • 认证:经 createCtxTokenTransport 从 dsh ctx 惰性读取 token 服务(IWORK_TOKEN_SERVICE,由 ui-account host 提供);服务缺失或没有 token 时不发 Authorization——刻意不回退静态 token(如 DSH_API_TOKEN),裸发请求由服务端以 401 呈现。
  • 注册 Harness 同源网关(/api/iwork),把浏览器侧 API 请求透明转发到 iWork。

实现

插件入口

apply(ctx) 依赖 tools、skills、connection 服务,执行流程:

  1. 读取 APP_SERVER_URL / BETTER_AUTH_BASE_URL(兜底 http://127.0.0.1:8787),构造 /api/v1/ 基础地址。
  2. fetch 拉取 openapi.json,非 2xx 直接抛错。
  3. 创建 createCtxTokenTransport(ctx, { serviceKey: IWORK_TOKEN_SERVICE }) 惰性认证传输。
  4. createOpenApiTools(document, baseUrl, fetch, { transport, uiAdapter }) 生成工具列表。
  5. 逐工具通过 defineTool 注册到 ctx.tools,入参为 { path, query, body }、输出为 { type: 'json' }。
  6. 注册名为 iwork-api 的内置 skill,内容只列出已注册工具。
  7. registerIworkGateway 挂载同源网关前缀路由。
src/openapi.ts
  • schemaToZod(value, root):将 OpenAPI JSON Schema 递归转换为 zod 类型,处理 $ref 解析(仅允许站内引用)、枚举、oneOf/anyOf 联合、object(required/additionalProperties)、array、标量类型、nullable 与 default。
  • createOpenApiTools(document, baseUrl, fetcher, options):遍历 paths 下 get/post/put/patch/delete/head/options 操作,为每个 operation 生成 ApiTool:
    • name:iwork_api_<operationId>,无 operationId 时回退为 iwork_api_<method>_<path>。
    • input:z.object({ path, query, body }),path/query 参数按 JSON Schema 校验,body 仅接受 application/json。
    • execute:替换路径参数、拼接 Query、发起请求,解析 JSON 响应并按响应 schema 校验;非 2xx 抛错;校验 url.origin === base.origin 防止跨源。
认证与凭据
  • 认证传输来自共享库 @iwork/dsh-plugin-auth:LazyTokenTransport 在请求发生时经 ctx.get(IWORK_TOKEN_SERVICE, false) 惰性读取 token;服务缺失或没有 token 时不发 Authorization,由服务端 401 呈现——刻意不回退静态 token。
  • 凭据的写入与存储由 ui-account host 插件统一负责:登录捕获的 bearer token 经 CREDENTIAL_ROUTE(/api/iwork-credential)写入其内存 store,并经 IWORK_TOKEN_SERVICE 服务供给各消费插件。本插件不再自建 strategy/store,也不注册该路由。
  • CREDENTIAL_ROUTE 路径刻意避开网关前缀 /api/iwork,防止被代理转发到 iWork(见 packages/shared/src/constants/routes.ts 注释与 gateway.test.ts 的 502 防御用例)。
src/gateway.ts
  • buildUpstreamUrl:剥离网关前缀后拼接上游地址,拒绝越出目标 origin。
  • createIworkGatewayHandler:透明转发 handler,剥除并覆盖 x-iwork-gateway 打标头。
  • registerIworkGateway:注册前缀路由 + __IWORK_CLIENT_CONFIG__ 全局注入。

开发指南

pnpm --filter @iwork/dsh-plugin-api typecheck
pnpm --filter @iwork/dsh-plugin-api test
pnpm --filter @iwork/dsh-plugin-api build

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm @iworkjs/dsh-plugin-api

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

PolinRider Returns
Research

PolinRider Returns: Hijacked npm Packages Use Ethereum Blockchain to Conceal Malware Infrastructure

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Vulnerability Insights

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?

Cry2Wolf: How to Tell a Real Bug from a Nothingburger
AI & VibeSec

Cry2Wolf: Not Every Branded Bug Deserves a Fire Drill

Frame 2085668439 (1)
Group 1261154229