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
[Security] Code injection via unsanitized issue title/body enables GITHUB_TOKEN theft in issues.yml (CWE-78) #35012
.github/workflows/issues.yml interpolates ${{ github.event.issue.title }}
and ${{ github.event.issue.body }} directly inside a Python script
(shell: python) using triple-quoted string literals, without escaping.
An attacker can open a public issue with a crafted title/body containing """ to break out of the string literal and inject arbitrary Python
(hence arbitrary shell/OS commands) into the workflow run.
actions/checkout@main runs earlier in the same job with its default persist-credentials: true, which writes the job's GITHUB_TOKEN into
the local git config (http.<url>.extraheader) of the checked-out repo.
Injected code in the "Check Issues" step can read that token directly
from the filesystem (e.g. git config --get-all http.https://github.com/.extraheader)
with no additional secret required. The same workflow file uses secrets.GITHUB_TOKEN explicitly elsewhere (release/commit steps),
indicating it has write permissions in this repository — meaning a stolen
token could be used to push to the repo (this is a boot-loader project
for Synology NAS devices with 8.4k+ stars; unauthorized pushes would be a
real supply-chain risk for its users).
Scope caveat: this workflow declares no explicit permissions:
block, so the exact scope of GITHUB_TOKEN depends on the repository's
default "Workflow permissions" setting, which isn't visible without
admin access.
Severity confirmation: the "Init Env" step (which runs before the injection point, same job) successfully executes sudo timedatectl set-timezone with no password prompt — confirming
passwordless sudo is available to the runner user from the very start
of the job.
Pass github.event.issue.title/body through env: and read them as
Python's os.environ, instead of splicing into the script text. Also
consider persist-credentials: false on the checkout step if the job
doesn't need to push, and add an explicit least-privilege permissions:
block to the workflow.
Activity