-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add support for Pushover notifications #3591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "html": 1, | ||
| "priority": {{ if eq .Task.Status "error" }}1{{ else }}0{{ end }}, | ||
| "title": "Task: {{ .Name }}", | ||
| "message": "Execution #: {{ .Task.ID }}\n<font color=\"{{ .Color }}\"><b>{{ .Task.Result }}</b></font>\n{{ if .Task.Version }}Version: {{ .Task.Version }}\n{{ end }}\nDescription: {{ .Task.Desc }}\nAuthor: {{ .Author }}", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Observation (Low, codebase-wide pattern) — JSON injection via User-controlled values ( For example, a task message of This is the same pattern used by all other alert templates in this codebase (telegram, slack, rocketchat, etc.), so it is not a regression unique to this PR. Flagging for awareness — the proper fix would be to use |
||
| "url": "{{ .Task.URL }}", | ||
| "url_title": "Task URL" | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Severity: Medium — Secret leakage via error logs
The Pushover
userkey andtokenare embedded in the URL query string. Whenhttp.Postfails (DNS error, TLS failure, timeout, connection refused, etc.), Go'snet/httpincludes the full URL in the returnederrormessage. That error is then passed tot.Log()on line 563, which broadcasts it to all project users via WebSocket and persists it in the task log database.This leaks server-level configuration secrets to any user with access to the project.
The Pushover API accepts
userandtokenas fields in the JSON POST body, so there is no need to put them in the URL. Recommended fix: moveuserandtokeninto the JSON template body and POST to the bare endpointhttps://api.pushover.net/1/messages.json.And add to
pushover.tmpl:{ "user": "{{.PushoverUserKey}}", "token": "{{.PushoverToken}}", ... }(Note: the same pattern exists in the Gotify and Telegram alert senders, but those APIs require the token in the URL path/query. Pushover does not.)