Skip to content

[bug] respawn 来源链可伪造:__RUBASH_SHELL_PID 冒充 $$ 并开门放行伪造位置参数 #2136

Closed

Description

@caomengxuan666

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

respawn 来源链可由环境伪造:

__RUBASH_SHELL_PID=424242 rubash -c 'echo $$'   # => 424242(不存在此进程)

子进程把伪造值当作自身 $$;且该标记正是 respawn 门的钥匙——门开后,伪造的 __RUBASH_POSITIONAL_PARAMS 被采信为 $1/$2 种子。另有 __RUBASH_SUBSHELL_DEPTH=7 → 子进程 $BASH_SUBSHELL 直接为 7。

门本身的对照面是好的(无来源标记时伪造的位置参数被忽略),问题在钥匙本身是环境里的一串字符。修法方向:来源证明走不可伪造通道(argv 结构/管道交接),环境副本不作裁定依据。

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

Activity

  1. added
    bug
    P2-medium
    area:carrier
    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:carrierbug

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions