For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/security/code_security/iac_security/iac_rules/cicd-github-unsecured-commands.md.
A documentation index is available at /llms.txt.
Enabling the deprecated set-env and add-path commands by setting ACTIONS_ALLOW_UNSECURE_COMMANDS=true allows workflows or steps to modify the runner environment and PATH, which can be abused to run unintended or attacker-controlled commands and lead to arbitrary code execution. Check GitHub Actions workflow documents for the ACTIONS_ALLOW_UNSECURE_COMMANDS environment variable at the workflow top-level, per-job, and per-step scopes; the variable must be absent or set to false. Any occurrence of ACTIONS_ALLOW_UNSECURE_COMMANDS=true at workflow, job, or step level will be flagged; remediate by removing the variable or explicitly setting it to false.
Secure example (do not enable insecure commands):
env:# No ACTIONS_ALLOW_UNSECURE_COMMANDS set herejobs:build:env:ACTIONS_ALLOW_UNSECURE_COMMANDS:"false"steps:- name:Checkoutuses:actions/checkout@v3