Skip to content

[Security PoC] issue_comment触发的CI无权限校验+execSync命令注入(良性验证) - #458

Open
KDMZXY wants to merge 1 commit into
vivoblueos:mainfrom
KDMZXY:poc-ci-rce
Open

[Security PoC] issue_comment触发的CI无权限校验+execSync命令注入(良性验证)#458
KDMZXY wants to merge 1 commit into
vivoblueos:mainfrom
KDMZXY:poc-ci-rce

Conversation

@KDMZXY

@KDMZXY KDMZXY commented Aug 25, 2026

Copy link
Copy Markdown

安全研究PoC声明(vivo SRC漏洞验证)

漏洞: cross_repos_build.yml由 issue_comment 触发,仅检查评论含'build_prs'、无评论者身份/组织权限校验——任何GitHub用户在任意PR评论即可触发特权构建流水线(merge任意fork-PR代码+在携带GITHUB_TOKEN的容器内执行)。

本PR载荷严格良性: 仅一个文件 poc$(id).rs(内容为注释)。文件名中的 $(id) 用于验证 Check-format 作业 execSync 命令注入(双引号内命令替换)——若漏洞存在,格式检查错误信息将包含 id 命令的执行结果(回帖于此PR)。

无数据访问/无网络外带/无secrets读取。验证后将关闭PR并删除fork分支。

报告已提交 vivo SRC (vivosrc.vulbox.com)。

@KDMZXY

KDMZXY commented Aug 25, 2026

Copy link
Copy Markdown
Author

build_prs

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

❌ Job failed. Failed jobs: check_license (failure), build_and_check_boards (failure), see https://github.com/vivoblueos/kernel/actions/runs/32845309151.

@github-actions

Copy link
Copy Markdown

❌ Job failed. Failed jobs: check_license (failure), build_and_check_boards (cancelled), see https://github.com/vivoblueos/kernel/actions/runs/32845309151.

@wangchen-vivo

Copy link
Copy Markdown
Contributor

Thanks for the detailed PoC report! This has been fixed in #463.

han-jiang277 pushed a commit that referenced this pull request Aug 27, 2026
Fixes the command-injection RCE reported in
[#458](#458),
where attacker-controlled PR content was interpolated into `execSync`
shell strings and could execute arbitrary commands in CI.

## Changes

- **Command injection**: run format/license/check commands via
`execFileSync` argument arrays instead of `execSync` string
concatenation, so filenames/repo names are never interpreted by a shell
(`poc$(id).rs` no longer expands).
- **Fail-closed checks**: a format tool that fails to run (file missing,
parse error, tool crash) now fails the job instead of being skipped and
reported as "All modified files pass format check".
- **Least privilege**: format, license, and build jobs run with
`permissions: {}` and a placeholder `github-token: unused`, so injected
code cannot obtain the job's `GITHUB_TOKEN`. Container GHCR login
credentials and `packages: read` were removed because the image is
public.
- **Tokenless sync**: the old `setup` job is split into `resolve_prs`,
which keeps a token to comment and resolve PRs, and `apply_prs`, which
runs repo init, sync, merge, and upload without one. This way `repo
sync` has no `GITHUB_TOKEN`, so a `<repo-hooks>` hook injected via an
attacker-controlled manifests PR cannot execute untrusted code.
- **Input validation**: `build_prs` links must belong to this org; PR
metadata is passed to shell steps via `env` rather than `${{ }}`
interpolation into `run:`, so a value containing shell metacharacters is
treated as data and never evaluated as commands.
- **Resource limits**: `concurrency` is grouped per PR, so a new
`build_prs` comment cancels the in-progress run instead of launching
another set of matrix build jobs.

---------

Co-authored-by: wangchen-vivo <wangchen-vivo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants