Action does not validate that the `SLACK_WEBHOOK_URL` is a valid Slack webhook URL
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- github-actions, javascript
Research direction
Start in src/config.js at the SLACK_WEBHOOK_URL handling and follow the value into src/webhook.js, where the request is sent. Confirm the action rejects URLs unless they use the https://hooks.slack.com/* format, while preserving valid webhook behavior; verify this with the repository's existing checks.
Written by the indexing model from the issue text.
Description
The GitHub action does not validate that the passed Slack webhook URL is a valid Slack webhook URL. Thus, an attacker can pass URLs that do not have the format https://hooks.slack.com/*.
If an attacker attacks a GitHub workflow which uses the Slack GitHub action and manages to set the SLACK_WEBHOOK_URL environment variable, they can make the Slack GitHub action send requests to any arbitrary URL (incl. servers on internal networks, or ports on the same machine). That's classic SSRF.
The Slack GitHub action should validate that the passed webhook URL is a valid webhook URL, i.e., has the format https://hooks.slack.com/*.
This is where the environment variable is being read: https://github.com/slackapi/slack-github-action/blob/9a2e0ee8deeff80fa9eb79bec773084babe367a5/src/config.js#L121
This is where the request is being sent, with no validation of the webhook URL: https://github.com/slackapi/slack-github-action/blob/9a2e0ee8deeff80fa9eb79bec773084babe367a5/src/webhook.js#L26
I tried reporting this vulnerability responsibly through Slack's HackerOne program, but was told that this was not a security vulnerability. I still believe it should be fixed. Hence, this GitHub issue.
As an aside, similar attacks might (or might not) be possible for the API URL or the HTTPS proxy (I haven't had time to look into those): https://github.com/slackapi/slack-github-action/blob/9a2e0ee8deeff80fa9eb79bec773084babe367a5/src/config.js#L106-L117
- Dominant language
- JavaScript
- Stars
- 1.3k
- Forks
- 200
- Avg merge
- 2h 59m
- Merged PRs (30d)
- 6
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from slackapi/slack-github-action
-
docs
Difficulty 1/5 Under an hour Newbie friendliness 82/100
slackapi/slack-github-action#667 ·
-
dependencies question
slackapi/slack-github-action#671 · 2 comments · 1 assignee ·
-
needs info question
Difficulty 3/5 1-2 days Newbie friendliness 55/100
slackapi/slack-github-action#654 · 7 comments · 5 reactions ·
-
question
Difficulty 5/5 Over a week Newbie friendliness 20/100
slackapi/slack-github-action#520 · 1 comment ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
slackapi/slack-github-action#511 · 2 comments · 3 reactions ·
All issues in slackapi/slack-github-action
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sugarlabs/musicblocks#8847 ·
-
client-controller-update ta-bot-triage team-money-movement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
MetaMask/metamask-mobile#36594 ·