Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

security(nodes): GATE/CAPTURE/AGENTRUN 子进程继承宿主全量 env——code 节点已修的 env 白名单未推广,capture stdout 零截断

Closed
#30 8 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
backend, security

Research direction

Start with the allowlist implementation in code.py:500-508, then inspect gate.py:68, capture.py:72 and :95-96, and agent_run.py:101 and :324. Done means the affected subprocess paths use an explicit environment policy, capture output is bounded, and multi-tenant agent execution follows the stated fail-closed behavior.

Written by the indexing model from the issue text.

Description

场景 gap 单(okguitar 提报)· 优先级 P1 · 依赖:无

基线 HEAD = ddcedae。

Summary

code 节点 2026-09 已修 env 白名单(code.py:500-508,注释自认历史实现「等于把 API key/云凭证交给沙箱内代码」),但同类敏感操作节点没跟上:

  • plaita-nodes/src/plaita_nodes/gate.py:68:env = os.environ.copy()——worker 进程 env(含 PLAITA_CREDENTIALS_KEY、DB/Redis URL、provider token)全量进入门禁命令;
  • capture.py:72:同样 os.environ.copy(),且输出 {"stdout": stdout or ""} 零截断(:95-96)——全量进节点输出 → checkpoint → console 执行页/事件流,viewer 角色可见;
  • AGENTRUN 直跑路径经 agentproc Python SDK,其 runner executor 路径同样是全量 env 透传(agentproc 仓配套单);agent_run.py:101 还硬编码 --permission-mode auto 在宿主免审批执行,沙箱(workspace)是可选项(:324)而非默认。

影响

与 recursive #89(默认档 printenv 泄露)同构:worker 宿主上任何被门禁/capture 执行的命令、agent CLI 及其子进程都能读全部平台凭据;capture 输出把敏感内容直接带进可见状态。

建议

把 code 节点的 SUBPROCESS_ENV_ALLOWLIST 思路抽到公共层,gate/capture/agent 直跑统一白名单 + 显式 extra_env;capture stdout 加截断;多租户模式下 agent 直跑默认拒绝(fail-closed 到 workspace 沙箱)。

Dominant language
Python
Stars
0
Forks
1
Avg merge
2h 22m
Merged PRs (30d)
8

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from jeffkit/plaita

All issues in jeffkit/plaita

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.