You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
gh aw compile generates CodeQL injection alert for GH_AW_DEFAULT_DETECTION_MAX_AI_CREDITS in shell run block #57780
gh aw compile generates lock workflows that interpolate ${{ GH_AW_DEFAULT_DETECTION_MAX_AI_CREDITS }} directly inside an executable shell run: block.
CodeQL flags this as actions/code-injection/medium.
We have several workflows that use on.workflow-call and use a centralized repo ops pattern. The centralized workflow is extremely important to use to maintain workflows in one place.
CodeQL Alert
Potential code injection in ${{ vars.GH_AW_DEFAULT_DETECTION_MAX_AI_CREDITS || '400' }}, which may be controlled by external user.
Observed Context
This appears in generated .lock.yml files produced by gh aw compile.
The source .md workflow files do not contain this shell line. It is introduced by compilation, so manual editing is not durable.
Request
Please move this expression out of the executable shell body and into env, then reference the environment variable from the shell script. Please validate that it is an integer before writing the firewall config.
Impact
We have a centralized workflow with a large number of reusable workflows, so the count of CodeQL alerts is significant.
Activity
kkruel8100 commentedon Sep 1, 2026
Current Code Block
...
env:
...
GH_AW_MAX_AI_CREDITS: ${{ vars.GH_AW_DEFAULT_DETECTION_MAX_AI_CREDITS || '400' }}
....
run:
....
GH_AW_MAX_AI_CREDITS: ${{ vars.GH_AW_DEFAULT_DETECTION_MAX_AI_CREDITS || '400' }}
Update requested
Remove the redundant script since the variable is already set in env
kkruel8100 commentedon Sep 3, 2026
@pelikhan
Would you be able to assign this to copilot as well? This is a different ticket.
Thank you so much. :)