fix: sanitize NOTIFY channel name to prevent SQL injection #241

Closed
opened 2026-03-10 17:26:32 +00:00 by ash · 0 comments
Owner

Problem

pgstore/notifier.go uses fmt.Sprintf("NOTIFY %s", channel) — if channel name contains SQL, it could be injected. Low risk (app-configured) but sloppy.

Solution

Validate channel name is [a-zA-Z0-9_] only. Reject or sanitize on construction.

Pillar: Security

## Problem `pgstore/notifier.go` uses `fmt.Sprintf("NOTIFY %s", channel)` — if channel name contains SQL, it could be injected. Low risk (app-configured) but sloppy. ## Solution Validate channel name is `[a-zA-Z0-9_]` only. Reject or sanitize on construction. ## Pillar: Security
ash closed this issue 2026-03-10 18:13:31 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ash/eskit#241
No description provided.