The ‘Pwn Request’ Vulnerability in Stripe’s Repo: Insights into the Security Flaw Exposed

pwn request

Due to a misconfiguration in Github action workflows, a security researcher was able to discover and exploit a ‘pwn request’ vulnerability in a public Stripe repository. This allowed the researcher to merge unauthorized commits into the main branch and exfiltrate the GitHub token used in the workflow to an endpoint they controlled.

Core Insights:

  1. GitHub Actions Workflow Vulnerability:

    • GitHub Actions workflows are automated scripts that run various tasks in a development pipeline.
    • A misconfigured workflow likely allowed unauthorized actions, potentially leading to the exploitation of the “pwn request” vulnerability.
  2. “Pwn Request” Vulnerability:

    • This vulnerability may relate to manipulating or injecting malicious requests into the pipeline, exploiting the workflows to gain unauthorized access or execute malicious code.
  3. CI/CD Pipeline Security:

    • The incident highlights the importance of securing CI/CD pipelines. Such pipelines are a target for attackers due to their critical role in building, testing, and deploying code.
  4. Best Practices for Security:

    • Strict Workflow Configurations: Ensuring only authorized entities can trigger workflows.
    • Token Security: Limiting the scope and lifespan of tokens used in workflows to reduce exposure.
    • Branch Protection Policies: Enforcing policies to prevent unauthorized changes to critical branches.

Classic Pwn Request Vulnerability in the Workflow

risky workflow trigger
Risky Trigger -pull_request_target

Multiple workflows in the repository were vulnerable to a Pwn Request attack. Below is the breakdown of one such workflow’s misconfiguration:

  1. Risky Trigger – pull_request_target:

    • The workflow was configured to run on the pull_request_target event.
    • This trigger executes workflows in the context of the base repository, rather than the fork, and grants elevated privileges, including access to sensitive secrets such as the GitHub token.
    • While useful for certain use cases, it introduces significant risks when used improperly.
  2. Explicit Ref Checkout:

    • The vulnerable workflow included a job that checked out the code using an explicit ref of the pull request.
    • If the pull request originates from an untrusted fork, malicious actors can craft a pull request containing malicious code. This code gets executed with the elevated privileges provided by the pull_request_target trigger.
explicit-ref-checkout
-explicit ref checkout

Structured Breakdown of The Attack

1. Initial Pull Request and Exploit Execution

  • The security researcher submitted a pull request to the repository:
    PR #2719.
  • The pull request exploited the vulnerable pull_request_target trigger in the GitHub Actions workflow.
  • Exploit Code:
    • The exploit retrieved the GITHUB_TOKEN from the Git configuration.
    • Using the token, the attacker was able to merge the pull request into the main branch, bypassing authorization checks.
exploit code exporting github token
-exploit code retreiving the github token
merging pull request into the main branch
-merging pull request into the main branch

2. Exfiltration of GitHub Token

  • After the initial exploit, the researcher created another pull request to exfiltrate the GitHub token:
    PR #2723.
  • How the Exfiltration Worked:
    • The malicious code used wget to send the GITHUB_TOKEN to a researcher-controlled endpoint.
    • This exfiltration demonstrated the potential misuse of sensitive secrets exposed by the vulnerable workflow.
exfiltration of the token using wget
exfiltration of the token using wget

Key Attack Mechanisms:

  • Privilege Escalation:
    • By exploiting the pull_request_target trigger, the attacker gained elevated privileges within the workflow environment.
  • Token Abuse:
    • The GitHub token was used for unauthorized actions, including merging a pull request and leaking sensitive credentials.
  • Untrusted Code Execution:
    • The workflow executed untrusted pull request code, enabling the attacker to manipulate the repository.

Lessons Learned:

This attack underscores the critical need for:

  • Restricting GitHub Token Permissions: Tokens should have the least privileges required for workflows.
  • Careful Use of pull_request_target: This trigger should be used sparingly, with strict security controls.
  • Branch Protection Policies: Enforcing these policies can prevent unauthorized merges into protected branches.
  • Audit and Review Workflows: Regularly review and secure workflows to eliminate exploitable configurations.

This is a clear example of how misconfigured CI/CD workflows can lead to severe repository security breaches.

You might also like to read on the Command injection vulnerability in D-Link NAS devices

References

Why Businesses Trust SecureMyOrg for Comprehensive Network Security

At SecureMyOrg, we uncover and fix all possible security vulnerabilities of mobile and web, while providing solutions to mitigate risks. We are trusted by renowned companies like Yahoo, Gojek and Rippling, and with 100% client satisfaction, you’re in safe hands!

Some of the things people reach out to us for –

  1. Building their cybersecurity program from scratch – setting up cloud security using cost-effective tools, SIEM for alert monitoring, building policies for the company
  2. Vulnerability Assessment and Penetration Testing ( VAPT ) – We have certified professionals, with certifications like OSCP, CREST – CPSA & CRT, CKA and CKS
  3. DevSecOps consulting
  4. Red Teaming activity
  5. Regular security audits, before product release
  6. Full time security engineers.

Relevant Posts

Cloud-based malware sandboxing

How Cloud-Based Malware Sandboxes Are Changing Cybersecurity

Cloud-based malware sandboxes are revolutionizing cybersecurity by providing scalable, real-time threat analysis without the limitations of on-premise solutions. By leveraging AI, automation, and global threat intelligence, these sandboxes enhance malware detection, incident response, and enterprise security.

Read More »
Open-source vs Commercial malware sand boxes

Open-Source vs. Commercial Malware Sandboxes: Pros and Cons

Choosing between open-source and commercial malware sandboxes is crucial for cybersecurity teams. While open-source solutions like Cuckoo Sandbox offer flexibility and cost savings, commercial options such as Palo Alto WildFire provide advanced threat detection and enterprise support. This guide explores the pros and cons of each, helping you decide which fits your security needs.

Read More »
Detecting Advanced persistent threats

Detecting Advanced Persistent Threats (APTs) with Malware Sandboxing

Advanced Persistent Threats (APTs) are stealthy, targeted cyberattacks designed to infiltrate networks and remain undetected for long periods. Traditional security measures often fail to catch these sophisticated threats. Malware sandboxing provides a powerful solution by analyzing suspicious files in a controlled environment, detecting evasive malware, and enhancing threat intelligence. Learn how sandboxing technology helps identify and mitigate APTs effectively.

Read More »
automation in malware sandboxes

Automating Threat Intelligence with Malware Sandbox Solutions

As cyber threats become more sophisticated, manual threat analysis is no longer sufficient. Automated malware sandbox solutions offer real-time detection, seamless integration with threat intelligence platforms, and enhanced incident response. By leveraging AI and behavioral analysis, these solutions help organizations stay ahead of evolving cyber threats.

Read More »
setting up a malware sandbox for effective threat analysis

How to Set Up a Malware Sandbox for Effective Threat Analysis

Setting up a malware sandbox is essential for analyzing and mitigating cyber threats in a secure environment. This guide walks you through the step-by-step process of creating an effective sandbox, from choosing the right virtualization platform to configuring security tools and evasion resistance techniques.

Read More »
malware sandbox

Best Malware Sandboxes in 2025: Top Tools for Security Analysts

Malware sandboxes play a crucial role in cybersecurity by providing a safe environment for analyzing malicious software. In 2025, several top-tier malware sandboxes, including Cisco Threat Grid, FireEye AX, VMRay Analyzer, and Cuckoo Sandbox, offer powerful detection, evasion resistance, and automation capabilities. This blog explores the best malware sandboxes of 2025, highlighting their key features and helping security analysts choose the right tool for effective threat analysis.

Read More »

Subscribe to our newsletter !

Please fill the form for a prompt response!