Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Python Devs Document 'De-fanging Dangerous Triggers In GitHub Actions'

"A handful of GitHub Actions triggers let a stranger on the internet start a workflow that may have access to your secrets," warn two security developers at the Python Software Foundation. Have dangerous triggers caused real incidents? Yes, repeatedly... The maintainers behind these projects weren't careless. These triggers look harmless in a workflow file, and the unsafe version is one line away…

GitHub's Python Software Foundation has issued warnings about "dangerous triggers" in GitHub Actions that could allow unauthorized access to sensitive information. These triggers, which look harmless in workflow files, can be easily converted to their unsafe counterparts with just a line of code. When someone opens a pull request from a fork, the pull_request trigger runs the code with a read-only token and no access to secrets.

However, the pull_request_target trigger, which looks almost identical, runs with a read/write token and full access to the repository and organization secrets. This difference is often overlooked, leading to potential security breaches.

GitHub built the pull_request_target trigger for managing pull requests from forks, where the workflow never interacts with the contributor's code. The issue arises when a workflow checks out the pull request and executes it anyway, granting the attacker control over your credentials. This is known as a "pwn request" and has been linked to multiple supply-chain compromises.

The problem is exacerbated by the issue_comment trigger, which also poses a similar risk when the workflow runs with the repository's token and secrets.

In response, security developers Seth Larson and Mike Fiedler from the Python Software Foundation have taken action to remove these dangerous triggers from their GitHub organizations (psf, python, and pypi). They have also documented the process of implementing these policies in other projects and organizations. On a GitHub Team or Enterprise plan, these policies can be applied organization-wide with a single policy.

For users on a Free plan, they must be applied one repository at a time. By following these steps, users can effectively mitigate the risks associated with these dangerous triggers and enhance the security of their GitHub Actions workflows.

Rewritten by urgent.news; may contain errors — check the original.

Source: it.slashdot.org

Read the original at it.slashdot.org →

Report a problem with this story

More in Tech

More from Sunday 22 November →