{"id":"GHSA-c3xh-98xp-6qhf","summary":"githubtoplanguages: Command Injection via Issue Title in Discord Notification Workflow","details":"### Summary\n\nA GitHub Actions workflow is vulnerable to command injection through the issue title.\n\nThe workflow is triggered when an issue is opened or closed, and it directly inserts `github.event.issue.title` into a Bash variable assignment. If an issue title contains command substitution syntax, Bash evaluates it during the workflow run.\n\n\n### Details\n\nThe vulnerable workflow is:\n\n`.github/workflows/discord-issue.yml`\n\nThe issue title is directly interpolated into a Bash script:\n\n```bash\nISSUE_TITLE=\"${{ github.event.issue.title || github.event.pull_request.title }}\"\n```\n\nBecause GitHub Actions expressions are expanded before Bash executes the script, an attacker-controlled issue title containing command substitution syntax can be evaluated by the shell.\n\nIn the original workflow, the resulting value is then included in a Discord notification payload:\n\n```bash\ncurl -H \"Content-Type: application/json\" \\\n  -X POST \\\n  -d \"{\\\"username\\\": \\\"GitHub Bot\\\", \\\"content\\\": \\\"${STATUS} created by **${AUTHOR}**: **${ISSUE_TITLE}**\\n🔗 ${ISSUE_URL}\\\"}\" \\\n  \"$DISCORD_WEBHOOK\"\n```\n\n### PoC\n\nFor safety, I reproduced this only in my fork. I did not trigger the original repository’s Discord webhook.\n\nI kept the vulnerable Bash assignment unchanged and replaced the Discord webhook request with `echo` statements to observe the result safely.\n\nTest issue title:\n\n```text\ntitle: $(whoami)\n```\n\nObserved workflow log:\n\n```text\nISSUE_TITLE=title: runner\n```\n\nThis confirms that `$(whoami)` was executed on the GitHub Actions runner before the value would be sent to Discord.\n\n### Impact\n\nAny user who can open an issue may be able to execute shell commands on the GitHub Actions runner.\n\nIn practice, this means an attacker could create an issue with a crafted title, cause the workflow to execute a shell command, and have the command output included in the Discord notification content. This can be used to manipulate Discord notifications, spoof trusted GitHub bot messages, or repeatedly trigger unwanted notifications.\n\nMore importantly, the command runs in a workflow environment where a Discord webhook secret is configured. Depending on repository settings and workflow permissions, this may put workflow secrets or other environment data at risk.\n\n### Suggested Fix\n\nDo not insert issue titles directly into Bash scripts.\n\nPass the title through an environment variable instead:\n\n```yaml\nenv:\n  ISSUE_TITLE: ${{ github.event.issue.title }}\nrun: |\n  issue_title=\"$ISSUE_TITLE\"\n```\n\nAlso avoid `eval`, unquoted variable expansion, or shell execution patterns involving user-controlled issue content.","modified":"2026-06-19T22:15:16.412088017Z","published":"2026-06-19T22:10:31Z","database_specific":{"github_reviewed_at":"2026-06-19T22:10:31Z","nvd_published_at":null,"cwe_ids":["CWE-78"],"severity":"HIGH","github_reviewed":true},"references":[{"type":"WEB","url":"https://github.com/gouef/githubtoplanguages/security/advisories/GHSA-c3xh-98xp-6qhf"},{"type":"WEB","url":"https://github.com/gouef/githubtoplanguages/commit/157840482e592bd4f8e0617539e73cdbef26f1ac"},{"type":"PACKAGE","url":"https://github.com/gouef/githubtoplanguages"}],"affected":[{"package":{"name":"gouef/githubtoplanguages","ecosystem":"GitHub Actions"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.1.4"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/06/GHSA-c3xh-98xp-6qhf/GHSA-c3xh-98xp-6qhf.json"}}],"schema_version":"1.7.5","severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N"}]}