Tensorflow Supply Chain Compromise via Self-Hosted Runner Attack

Let's say TensorFlow wants to run a set of tests when a GitHub user submits a pull request.
TensorFlow can define these tests in a yaml workflow file, used by GitHub Actions, and configure the workflow to run on the `pull request` trigger.
One type is GitHub's hosted runners, which GitHub maintains and hosts in their own environment.
Self-hosted runners are build agents hosted by end users running the Actions runner agent on their own infrastructure.
By default, when a self-hosted runner is attached to a repository or an organization runner group that a public repository has access to, any workflow running in that repository's context can use that runner.
The problem is that this also applies to workflows from fork pull requests - this default setting allows any contributor to execute code on the self-hosted runner by submitting a malicious PR. If the self-hosted runner is configured using the default steps, it will be a non-ephemeral self-hosted runner.
We provide explicit steps to compromise the self-hosted runner below, but first, let's understand Tensorflow's use of GitHub Actions to determine the access an attacker would have if they compromised the self-hosted runner.
This meant the runner was non-ephemeral, so an attacker could persist on the runner even after their PR job finished by forking off their own process.
This particular runner was one of a handful of self-hosted runners in a TensorFlow runner group named `Default`.
An attacker could use the malicious pull request to compromise any runner in this group or all at once using the `runs-on: matrix` strategy.
The impact of runner compromise typically depends on the permission levels of the `GITHUB TOKEN` assigned to subsequent builds, branch protection settings in place for the repository, network positioning of the build machine, and repository secrets.
The important aspect is that if a workflow executes on a self-hosted runner and uses a `GITHUB TOKEN`, then that token will be on the runner for the duration of that build.
There are techniques to extend the build length once you are on the runner.
The TensorFlow repository used GitHub secrets to allow the runners to access sensitive systems during the automated release process.
Yml` workflow, we noticed that it used the `AWS PYPI ACCOUNT TOKEN` to authenticate to PyPi before uploading TensorFlow pip wheels and that this workflow ran on the self-hosted runner.
An attacker could compromise one additional secret even though it was not used within workflows that ran on the self-hosted runners by leveraging the GITHUB TOKEN's permissions.
Our bash script, stored in a GitHub gist, could be any Command-and-Control system, but one that we've had success with is installing our own self-hosted GitHub runner on the runner and then using a C2 repository with a simple workflow to execute commands.
TensorFlow changed the `GITHUB TOKEN` permissions to read-only for workflows that ran on self-hosted runners.
The impact of self-hosted runner compromise would be limited because they couldn't use the `GITHUB TOKEN` to perform any write operations.
Move the self-hosted runner group from the repository to an organization group, and configuring the group to only run on specific workflows that have already been committed to a protected branch, then reference that workflow as a reusable workflow.


This Cyber News was published on securityboulevard.com. Publication date: Sun, 14 Jan 2024 14:43:06 +0000


Cyber News related to Tensorflow Supply Chain Compromise via Self-Hosted Runner Attack

Tensorflow Supply Chain Compromise via Self-Hosted Runner Attack - Let's say TensorFlow wants to run a set of tests when a GitHub user submits a pull request. TensorFlow can define these tests in a yaml workflow file, used by GitHub Actions, and configure the workflow to run on the `pull request` trigger. One type ...
5 months ago Securityboulevard.com
Software Supply Chain Security Checklist - In the ever-evolving landscape of digital innovation, the integrity of software supply chains has become a pivotal cornerstone for organizational security. Software supply chain security is not just about protecting code - it's about safeguarding the ...
5 months ago Feeds.dzone.com
GitHub, PyTorch and More Organizations Found Vulnerable to Self-Hosted Runner Attacks - Last July, we published an article exploring the dangers of vulnerable self-hosted runners and how they can lead to severe software supply chain attacks. GitHub itself was found vulnerable, as well as various notable organizations, such as PyTorch, ...
5 months ago Securityboulevard.com
New Class of CI/CD Attacks Could Have Led to PyTorch Supply Chain Compromise - A newly disclosed class of CI/CD attacks could have allowed attackers to inject malicious code into the PyTorch repository, leading to massive supply chain compromise, Praetorian security researcher John Stawinski says. Initially detailed in December ...
5 months ago Securityweek.com
New "MITRE ATT&CK-like" framework outlines software supply chain attack TTPs - A new open framework seeks to outline a comprehensive and actionable way for businesses and security teams to understand attacker behaviors and techniques specifically impacting the software supply chain. The Open Software Supply Chain Attack ...
1 year ago Csoonline.com
CVE-2021-29614 - TensorFlow is an end-to-end open source platform for machine learning. The implementation of `tf.io.decode_raw` produces incorrect results and crashes the Python interpreter when combining `fixed_length` and wider datatypes. The implementation of the ...
2 years ago
CISA Announces Renewal of the Information and Communications Technology Supply Chain Risk Management Task Force - The Task Force, chaired by CISA's National Risk Management Center and the Information Technology and Communications Sector Coordinating Councils, is a public-private partnership composed of a diverse range of representatives from public and private ...
4 months ago Cisa.gov
Playbooks on-prem - To address this challenge, Sekoia.io has recently released Playbooks on-prem. In this way, Playbooks on-prem may appeal to companies seeking to synchronize cloud actions with those executed on-premises. At its core, Playbooks on-prem revolve around a ...
4 months ago Blog.sekoia.io
CVE-2021-29531 - TensorFlow is an end-to-end open source platform for machine learning. An attacker can trigger a `CHECK` fail in PNG encoding by providing an empty input tensor as the pixel data. This is because the ...
3 years ago
UK, ROK sound alarm over North Korean supply chain attacks The Register - The national cybersecurity organizations of the UK and the Republic of Korea have issued a joint advisory warning of an increased volume and sophistication of North Korean software supply chain attacks. "In an increasingly digital and interconnected ...
7 months ago Theregister.com
CVE-2021-29523 - TensorFlow is an end-to-end open source platform for machine learning. An attacker can trigger a denial of service via a `CHECK`-fail in `tf.raw_ops.AddManySparseToTensorsMap`. This is because the ...
3 years ago
CVE-2021-29584 - TensorFlow is an end-to-end open source platform for machine learning. An attacker can trigger a denial of service via a `CHECK`-fail in caused by an integer overflow in constructing a new tensor shape. This is because the ...
3 years ago
CVE-2021-29550 - TensorFlow is an end-to-end open source platform for machine learning. An attacker can cause a runtime division by zero error and denial of service in `tf.raw_ops.FractionalAvgPool`. This is because the ...
2 years ago
CVE-2021-29534 - TensorFlow is an end-to-end open source platform for machine learning. An attacker can trigger a denial of service via a `CHECK`-fail in `tf.raw_ops.SparseConcat`. This is because the ...
2 years ago
CVE-2021-37681 - TensorFlow is an end-to-end open source platform for machine learning. In affected versions the implementation of SVDF in TFLite is [vulnerable to a null pointer ...
2 years ago
SCS 9001 2.0 reveals enhanced controls for global supply chains - In this Help Net Security interview, Mike Regan, VP of Business Performance at TIA, discusses SCS 9001 Release 2.0, a certifiable standard crafted to assist organizations in operationalizing the NIST and other government guidelines and frameworks. ...
6 months ago Helpnetsecurity.com
Developer Accounts Compromised Due to Credential Reuse in WordPress.org Supply Chain Attack - On June 24th, 2024, the Wordfence Threat Intelligence Team became aware of a WordPress plugin, Social Warfare, that was infected with malware through the WordPress repository. We immediately notified the WordPress Plugin's Team and they removed the ...
6 days ago Wordfence.com
Securing the Supply Chain - Before a supply chain can be improved, it must be understood. Rather than attacking one target, it is more effective to manipulate the supply chain to gain access to multiple targets. The 2013 Target breach was an example of a supply chain attack, as ...
1 year ago Securityweek.com
How AI could bolster software supply chain security - SAN FRANCISCO - While supply chain risks remain prevalent across enterprises of all sizes, Synopsys' Tim Mackey said AI tools will enable developers more than attackers - at least for now. Supply chain security was a significant topic that speakers ...
1 month ago Techtarget.com
Polyfill.io, BootCDN, Bootcss, Staticfile attack traced to 1 operator - The recent large scale supply chain attack conducted via multiple CDNs, namely Polyfill.io, BootCDN, Bootcss, and Staticfile that affected anywhere from 100,000 to tens of millions of websites has been traced to a common operator, according to ...
1 day ago Bleepingcomputer.com
Synopsys Introduces Latest Solution for Comprehensive Security Across Software Supply Chains - Synopsys has introduced Black Duck® Supply Chain Edition, a novel software composition analysis solution. This offering aids organisations in mitigating upstream risks within their software supply chains. Black Duck® Supply Chain Edition ...
2 months ago Itsecurityguru.org
Synopsys Introduces Latest Solution for Comprehensive Security Across Software Supply Chains - Synopsys has introduced Black Duck® Supply Chain Edition, a novel software composition analysis solution. This offering aids organisations in mitigating upstream risks within their software supply chains. Black Duck® Supply Chain Edition ...
2 months ago Itsecurityguru.org
Synopsys Introduces Latest Solution for Comprehensive Security Across Software Supply Chains - Synopsys has introduced Black Duck® Supply Chain Edition, a novel software composition analysis solution. This offering aids organisations in mitigating upstream risks within their software supply chains. Black Duck® Supply Chain Edition ...
2 months ago Itsecurityguru.org
Synopsys Introduces Latest Solution for Comprehensive Security Across Software Supply Chains - Synopsys has introduced Black Duck® Supply Chain Edition, a novel software composition analysis solution. This offering aids organisations in mitigating upstream risks within their software supply chains. Black Duck® Supply Chain Edition ...
2 months ago Itsecurityguru.org
Synopsys Introduces Latest Solution for Comprehensive Security Across Software Supply Chains - Synopsys has introduced Black Duck® Supply Chain Edition, a novel software composition analysis solution. This offering aids organisations in mitigating upstream risks within their software supply chains. Black Duck® Supply Chain Edition ...
2 months ago Itsecurityguru.org

Latest Cyber News


Cyber Trends (last 7 days)


Trending Cyber News (last 7 days)