github / github/platform-samples

block_file_extensions.sh can be circumvented with fork + PR

未关闭
#165 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Shell
星标
2.2k
派生
1.9k
平均合并
7 天 19 小时
30 天内合并 PR
1

描述

The `block_file_extensions.sh` pre-receive-hook can be circumvented by:

1. Fork the repository
2. Add a file with the blocked exension
3. Submit a pull request
4. Merge pull request

We've done a little research and suspect that this is due to the:
```
excludeExisting="--not --all"
```

I guess we could mitigate, e.g. by adding `block_self_merge_prs.sh`, but this could still be circumvented if 2 users with write privileges colluded.

Any thoughts?

贡献指南

打开贡献指南

调研方向

Start by reviewing block_file_extensions.sh, especially the excludeExisting="--not --all" behavior, and trace how forked pull requests are evaluated. The issue does not name a test or a concrete fix; done would require an agreed mitigation that prevents the reported bypass while addressing the stated collusion concern.

由索引模型根据 Issue 内容生成。

评估

技术栈
shell
领域
security
Issue 类型
缺陷
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。