Skip to content

Commit 370ca48

Browse files
committed
Test action scanning with vulnerable workflow
1 parent a7b3060 commit 370ca48

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: 'Vulnerable Workflow'
2+
3+
on:
4+
# 'pull_request_target' runs in the context of the base repo (privileged)
5+
pull_request_target:
6+
types: ['opened', 'synchronize']
7+
8+
jobs:
9+
test:
10+
runs-on: 'ubuntu-latest'
11+
steps:
12+
# VULNERABILITY: Explicitly checking out the untrusted PR code
13+
# while running in a privileged workflow context.
14+
- name: 'Checkout PR Code'
15+
uses: 'actions/checkout@v4'
16+
with:
17+
ref: '${{ github.event.pull_request.head.sha }}'
18+
19+
# This executes code controlled by the attacker (e.g. malicious npm scripts)
20+
# with access to the repository secrets.
21+
- name: 'Run Tests'
22+
run: 'npm install && npm test'
23+
env:
24+
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'

0 commit comments

Comments
 (0)