Skip to content

[bug] __RUBASH_FUNCTION_STDIN 环境预置劫持子 shell 的 stdin(read 与外部命令同中) #2135

Closed

Description

@caomengxuan666

现象(env 标记同类猎杀 F4,探针坐实)

环境里预置 __RUBASH_FUNCTION_STDIN=<文本> 后启动的子 shell,stdin 被劫持:

__RUBASH_FUNCTION_STDIN='伪造文本' rubash -c 'read x; echo $x' <<< '真实输入'
# => 读到伪造文本;外部命令 cat 同样吃到伪造文本而非真实管道

该标记本是函数 stdin 镜像的执行期暂存状态,却在进程导入时被无条件采信。同仓已有正确先例:CURRENT_FUNCTION / IN_SOURCE 在 import 时被剥离——本标记应同例(执行作用域暂存状态不入 import)。

证据:~/workspace/hunt-env-markers/REPORT.md F4 节。

Activity

  1. added
    bug
    P2-medium
    area:fd
    on Oct 29, 2026
  2. added this to the 1.5.0 milestone on Oct 29, 2026
  3. added a commit that references this issue on Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

P2-mediumarea:fdbug

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions