<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Njzjz/Wenxian - CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/njzjz/wenxian/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata. Fed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Wed, 03 Jan 2024 17:23:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/njzjz/wenxian/feed.xml" rel="self" type="application/rss+xml"/><item><title>GitHub Actions Workflow Command Injection via Issue Comments</title><link>https://feed.craftedsignal.io/briefs/2024-01-03-github-actions-injection/</link><pubDate>Wed, 03 Jan 2024 17:23:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-03-github-actions-injection/</guid><description>A GitHub Actions workflow uses untrusted user input from `issue_comment.body` directly inside a shell command, allowing potential command injection and arbitrary code execution on the runner.</description><content:encoded><![CDATA[<p>A GitHub Actions workflow in the <code>actions/njzjz/wenxian</code> repository (versions &lt;= 0.3.1) is vulnerable to command injection. The workflow is triggered by <code>issue_comment</code> events, which allows external users to inject arbitrary shell commands. The vulnerability arises because the workflow directly interpolates untrusted user input from <code>github.event.comment.body</code> into a shell command without proper sanitization. This occurs within the <code>run</code> context of a step, where <code>${{ }}</code> expressions are evaluated before execution. Successful exploitation allows remote attackers to execute arbitrary code on the runner, potentially compromising the CI/CD pipeline and exfiltrating sensitive data. This poses a significant risk to the integrity and confidentiality of the affected repository.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker submits a malicious comment to a GitHub issue in the affected repository, crafted to exploit the command injection vulnerability.</li>
<li>The comment contains a payload designed to break out of the intended command context and inject arbitrary shell commands.</li>
<li>The GitHub Actions workflow is triggered by the <code>issue_comment</code> event.</li>
<li>The workflow executes the vulnerable step, which interpolates the attacker-controlled <code>github.event.comment.body</code> into a shell command. Specifically, the command <code>echo identifiers=$(echo &quot;${{ github.event.comment.body }}&quot; | grep -oE '@njzjz-bot .*' | head -n1 | cut -c12- | xargs) &gt;&gt; $GITHUB_OUTPUT</code> is executed.</li>
<li>The attacker's injected commands are executed on the GitHub Actions runner with the privileges of the runner environment.</li>
<li>The attacker could leverage access to the <code>GITHUB_TOKEN</code> to interact with the repository, potentially exfiltrating data or modifying code.</li>
<li>The attacker can use the injected commands to compromise the CI/CD pipeline.</li>
<li>The final objective is arbitrary code execution on the runner, data exfiltration, or CI/CD pipeline compromise.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>This vulnerability allows remote attackers to inject arbitrary shell commands into the GitHub Actions runner by posting malicious comments on issues. Successful exploitation can lead to the execution of arbitrary code within the runner environment. This could provide attackers with access to sensitive information, including the <code>GITHUB_TOKEN</code>, allowing them to exfiltrate repository data or modify code. The compromise of the CI/CD pipeline can lead to supply chain attacks and other severe consequences. The <code>actions/njzjz/wenxian</code> repository (vulnerable: &lt;= 0.3.1) is affected by this vulnerability.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Deploy the &quot;Detect GitHub Actions Command Injection via Issue Comments&quot; Sigma rule to detect exploitation attempts by monitoring process creation events with suspicious command line arguments.</li>
<li>Implement the suggested fix provided in the advisory by passing <code>github.event.comment.body</code> through an environment variable and referencing it safely within the script to mitigate the command injection vulnerability.</li>
<li>Audit all GitHub Actions workflows for similar vulnerabilities where untrusted user input is directly interpolated into shell commands, and apply proper sanitization techniques.</li>
<li>Patch <code>actions/njzjz/wenxian</code> to a version greater than 0.3.1 to remediate CVE-2026-34243.</li>
</ul>
]]></content:encoded><category domain="severity">critical</category><category domain="type">advisory</category><category>github-actions</category><category>command-injection</category><category>ci-cd</category></item></channel></rss>