VOOZH about

URL: https://thenewstack.io/github-actions-design-flaw-leaves-security-hole-for-remote-code-execution/

⇱ GitHub Actions Design Flaw Leaves Security Hole for Remote Code Execution - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2020-11-10 10:18:43
GitHub Actions Design Flaw Leaves Security Hole for Remote Code Execution
tutorial,
CI/CD / Security

GitHub Actions Design Flaw Leaves Security Hole for Remote Code Execution

According to Google Project Zero researcher Felix Wilhelm, a GitHub Action design flaw can enable hackers to write to your repositories. And, if that wasn't bad enough, it can also be used to reveal encrypted secrets.
Nov 10th, 2020 10:18am by Steven J. Vaughan-Nichols
👁 Featued image for: GitHub Actions Design Flaw Leaves Security Hole for Remote Code Execution

We don’t all use GitHub, but there are certainly a lot of us who use it for managing our Git code repositories. Some of us have also started using GitHub Actions for continuous integration/continuous deployment (CI/CD), but it turns out there’s been a security hole hiding in Actions.

According to Google Project Zero researcher Felix Wilhelm, a GitHub Action design flaw can enable hackers to write to your repositories. And, if that wasn’t bad enough, it can also be used to reveal encrypted secrets.

Whoops!

Wilhelm found that the GitHub Actions workflow command feature acts as a communication channel between the Action Runner and the executed action. So far, so good. But Workflow commands work by parsing STDOUT of all executed actions. One of those commands carried by STDOUT is “set-env.”

You can probably guess where this is going. Yes, that’s right, set-env can define arbitrary environment variables as part of the workflow. This is, as pointed out, “highly vulnerable to injection attacks” Thus, as the runner parses every STDOUT line looking for workflow commands, every Github Action that “prints untrusted content as part of its execution is vulnerable.”

Vulnerable to what you ask? Remote code execution of course.

Wilhelm looked into some popular Github repositories. He discovered almost any project with somewhat complex Github actions is vulnerable. Indeed, “Even Githubs own actions are vulnerable to this issue.”

There may be even more trouble hiding in GitHub Action workflow commands. Wilhelm admitted he didn’t look into the security impact of other workspace commands.

So, what can you do? Wilhelm’s not sure. He thinks, “the way workflow commands are implemented is fundamentally insecure. Deprecating the v1 command syntax and hardening set-env with an allowlist would probably work against the direct RCE [Remote Code Execution] vectors. However, even the ability to overwrite ‘normal’ environment variables used by later steps is probably enough to exploit most complex actions.”

Of course, one way to fix it for once and for all, Wilhelm suggested was to move workflow commands into some out-of-bound channel (e.g a new file descriptor) to avoid parsing STDOUT.” But, there’s one little problem with that: It would “break a lot of existing action code.”

GitHub hasn’t gone that far, but get ready for some of your existing GitHub Action code to break because GitHub’s developers are removing two of the most vulnerable commands from Runner. “The runner will release an update that disables the set-env and add-path workflow commands in the near future.” By the near future, read by the end of November 2020.

In the meantime, GitHub suggests you “should upgrade to @actions/core v1.2.6 or later, and replace any instance of the set-env or add-path commands in their workflows with the new Environment File Syntax.” If you keep using workflows and actions using the old commands or older toolkit versions you’ll first see warnings and eventually, you’ll error out during workflow execution if you keep trying to use the older insecure commands.

So, once more, as is so often the case with security problems, it’s time to get ready to start patching and to clean up your code. A developer’s security work is never done.

Feature image via Pixabay.

TRENDING STORIES
Steven J. Vaughan-Nichols, aka sjvn, has been writing about technology and the business of technology since CP/M-80 was the cutting-edge PC operating system, 300bps was a fast internet connection, WordStar was the state-of-the-art word processor, and we liked it.
Read more from Steven J. Vaughan-Nichols
SHARE THIS STORY
TRENDING STORIES
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.