Skip to content

Add Pushover notifications support (#3693)#3976

Open
sickwell6988 wants to merge 4 commits into
developfrom
feat/pushover-alerts
Open

Add Pushover notifications support (#3693)#3976
sickwell6988 wants to merge 4 commits into
developfrom
feat/pushover-alerts

Conversation

@sickwell6988

@sickwell6988 sickwell6988 commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Originally requested in #3693

Tested and verified

Screenshot 2026-06-18 at 00 06 14 telegram-cloud-photo-size-2-5303018484725915965-y

Tested in Docker

Performed tests agains the new feature, by defining setting in

  • config.json
  • environment variables
  • new Pushover token UI field

Pushover API token UI field > config.json || environment variables

sickwell6988 and others added 3 commits June 17, 2026 22:11
Adds Pushover as a new alert channel with per-project API token override
(project GUI token wins over global config). Includes db migration v2.19.3,
config fields, TaskRunner wiring, and template.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds Pushover API token input to ProjectForm and `pushoverApiTokenOptional`
translation key across all 17 language files.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Security review: PR #3976 (Pushover notifications)

Reviewed the added Pushover alert path end-to-end (project settings → task runner → pushover.tmpl → Pushover API).

Outcome: 2 medium-severity issues found in new code.

Severity Issue Location
Medium Pushover API token readable by any project member (not just project admins) db/Project.go
Medium JSON injection via unescaped task/template fields can override Pushover API parameters services/tasks/templates/pushover.tmpl

No authn/authz bypass, SSRF, SQL injection, or new dependency supply-chain concerns identified in this diff.

Open in Web View Automation 

Sent by Cursor Automation: Find vulnerabilities

Comment thread db/Project.go Outdated
"user": "{{ .Pushover.User }}",
"title": "{{ .Name }} #{{ .Task.ID }}: {{ .Task.Result }}",
"html": 1,
"message": "<b>{{ .Task.Result }}</b> {{ .Task.Version }} - {{ .Task.Desc }}\nby {{ .Author }}",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Severity: Medium — JSON injection / alert manipulation

This template builds JSON with text/template and no escaping. {{ .Task.Desc }} is populated from Task.Message, which task starters can set via POST /api/project/{id}/tasks (CanRunProjectTasks). Template name and author are also attacker-influenced.

Attack path: start a task with a crafted message such as x"}, "user": "<attacker_pushover_key>", "priority": 2, "x": ". When the alert fires, injected keys can override Pushover API fields (recipient user, priority, etc.) because duplicate JSON keys are commonly last-wins.

Impact: redirect operational alerts to an attacker-controlled Pushover account (information disclosure) or manipulate notification metadata; phishing via injected url is also possible depending on parser behavior.

Drop the GUI/DB-stored alert_pushover_token in favor of the global
SEMAPHORE_PUSHOVER_API_TOKEN config. Storing a per-project token and
serializing it via the project JSON exposed the credential to any
project member through GET /api/project/{id}.

- Remove AlertPushoverToken from db.Project and its INSERT/UPDATE columns
- Drop the alert_pushover_token migration column changes
- Remove the in-memory carrier from TaskRunner and the test alert sender
- sendPushoverAlert now uses only the global config token/user
- Remove the Pushover token field and i18n keys from ProjectForm

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security review: PR #3976 (Pushover notifications)

Re-reviewed after latest changes (synchronize).

Outcome: 1 medium-severity issue in new code. Prior per-project credential disclosure finding is resolved — Pushover credentials now come only from global config (util.Config), not project API fields.

Severity Issue Location
Medium JSON injection via unescaped task fields can override Pushover API parameters (recipient user, url, etc.) services/tasks/templates/pushover.tmpl

Resolved since last review: Per-project alert_pushover_token exposure (db/Project.go) no longer present in this PR.

No authn/authz bypass, SSRF, SQL injection, or meaningful supply-chain change identified (package-lock.json is a formatting-only churn).

Open in Web View Automation 

Sent by Cursor Automation: Find vulnerabilities

"user": "{{ .Pushover.User }}",
"title": "{{ .Name }} #{{ .Task.ID }}: {{ .Task.Result }}",
"html": 1,
"message": "<b>{{ .Task.Result }}</b> {{ .Task.Version }} - {{ .Task.Desc }}\nby {{ .Author }}",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Severity: Medium — JSON injection / alert hijacking

This template builds JSON with text/template and no escaping. {{ .Task.Desc }} is populated from Task.Message, which task starters supply via POST /api/project/{id}/tasks (requires CanRunProjectTasks). {{ .Author }} and template {{ .Name }} are also attacker-influenced.

Attack path: start a task with a crafted message such as x"}, "user": "<attacker_pushover_key>", "priority": 2, "x": ". When the alert fires, injected keys appear after the legitimate user field; duplicate-key parsers (including typical JSON decoders) are last-wins, so the notification is redirected to the attacker's Pushover account using the server's application token.

Impact: operational alert hijacking (information disclosure) and possible phishing via injected url/title fields.

Fix: build the request with encoding/json (or at minimum json template func escaping) instead of hand-assembled JSON strings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant