Skip to content

wenxian: Command Injection in GitHub Actions Workflow via `issue_comment.body`

Critical severity GitHub Reviewed Published Mar 27, 2026 in njzjz/wenxian • Updated Mar 31, 2026

Package

actions njzjz/wenxian (GitHub Actions)

Affected versions

<= 0.3.1

Patched versions

None

Description

Summary

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.

Details

The workflow is triggered by issue_comment, which can be controlled by external users.
In the following step:

echo identifiers=$(echo "${{ github.event.comment.body }}" | grep -oE '@njzjz-bot .*' | head -n1 | cut -c12- | xargs) >> $GITHUB_OUTPUT

the value of github.event.comment.body is directly interpolated into a shell command inside run:.

Since GitHub Actions evaluates ${{ }} before execution, attacker-controlled input is injected into the shell context without sanitization. This creates a command injection risk.

Additionally, the extracted value is later reused in another step that constructs output using backticks:

echo '@${{ github.event.comment.user.login }} Here is the BibTeX entry for `${{ steps.extract-identifiers.outputs.identifiers }}`:'

which may further propagate unsafe content.

PoC

  1. Go to an issue in the repository
  2. Post a comment such as:

@njzjz-bot paper123" ) ; whoami ; #

  1. Observe whether the command is executed or reflected in logs/output

poc

The injected payload successfully breaks out of the quoted context and executes arbitrary shell commands.

As shown in the workflow logs, the injected whoami command is executed, and the output (runner) is printed. This confirms that attacker-controlled input from github.event.comment.body is interpreted as shell commands.

This demonstrates a clear command injection vulnerability in the workflow.

Impact

  • Remote attackers can inject arbitrary shell commands via issue comments

  • Potential impacts:

    • Execution of arbitrary commands in GitHub Actions runner
    • Access to GITHUB_TOKEN
    • Exfiltration of repository data
    • CI/CD pipeline compromise

This issue affects all current versions of the repository as the vulnerable workflow is present in the main branch.

Suggested Fix

Avoid directly interpolating untrusted user input into shell commands.

Instead, pass github.event.comment.body through an environment variable and reference it safely within the script:

- name: Extract identifiers
  id: extract-identifiers
  env:
    COMMENT_BODY: ${{ github.event.comment.body }}
  run: |
    identifiers=$(echo "$COMMENT_BODY" | grep -oE '@njzjz-bot .*' | head -n1 | cut -c12- | xargs)
    echo "identifiers=$identifiers" >> $GITHUB_OUTPUT
### References
- https://github.com/njzjz/wenxian/security/advisories/GHSA-r4fj-r33x-8v88
- https://nvd.nist.gov/vuln/detail/CVE-2026-34243
@njzjz njzjz published to njzjz/wenxian Mar 27, 2026
Published to the GitHub Advisory Database Mar 29, 2026
Reviewed Mar 29, 2026
Published by the National Vulnerability Database Mar 31, 2026
Last updated Mar 31, 2026

Severity

Critical

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

EPSS score

Weaknesses

Improper Input Validation

The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. Learn more on MITRE.

Improper Neutralization of Special Elements used in a Command ('Command Injection')

The product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component. Learn more on MITRE.

Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')

The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component. Learn more on MITRE.

CVE ID

CVE-2026-34243

GHSA ID

GHSA-r4fj-r33x-8v88

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.