fix(alerts): rate limit alert channel test messages and cap channels per workspace
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 55/100
Línea de trabajo
Start with src/app/w/[workspace]/alerts/actions.ts and compare the existing email test limit with sendAlertChannelTest; read src/lib/rate-limit/attempts.ts for limit definitions. Follow the api_keys_enforce_limit migration pattern for the workspace cap, then inspect the related pgTAP, unit, and Playwright tests. Done means both limits and the form refusal work, with the stated tests passing; verify the issue is still unclaimed before starting.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Context
Found by the Fable pre-production review on 2026-12-02 (main at cedc1914; every line reference below re-checked on main at cde5aa3b). Source: security and privacy readiness report, new issue 5.
sendAlertChannelTest posts to the channel's URL with no attempt limit (src/app/w/[workspace]/alerts/actions.ts:672-693), while the email test has one (countAttempt("alert-email-test", ...), :515). Private and local addresses are refused (src/lib/notifications/channels.ts:40-110), so this is abuse, not SSRF. There is no cap on alert channels per workspace in the database; DESTINATIONS_LIMIT = 50 only bounds reads (src/lib/data/notification-destinations.ts:50). Other tables enforce a cap with a trigger (api_keys_enforce_limit, supabase/migrations/20261105120320_api_keys.sql:88-116; webhook_endpoints_enforce_limit, 20261116120000_webhook_setup.sql:40-65).
Impact: an owner or admin can add a generic webhook channel pointing at any public HTTPS URL and loop the Server Action, using StackDash as a request relay. Against Slack or Discord this draws rate limits on the egress addresses every workspace's alerts share, so other workspaces' alerts are delayed. Low risk while sign-up is invite only; needed before #143.
The channel cap needs a migration (a limit trigger on notification_destinations), so it is not a code-only change.
Plan
- Add
countAttempttosendAlertChannelTest, per user and per IP, with its own limit name, returning a plain refusal with the wait time (same pattern as:515). - Add a migration with a trigger that caps channels per workspace at
DESTINATIONS_LIMIT, followingapi_keys_enforce_limit. - Show the cap's refusal on the add channel form.
Acceptance criteria
- Channel test sends are limited per user and per IP with a plain refusal message.
- The database refuses a channel past the per-workspace cap (pgTAP).
- A unit test covers the test-send refusal.
- Playwright e2e: the add channel refusal is announced, with an axe scan.
Files and areas
src/app/w/[workspace]/alerts/actions.ts, src/lib/rate-limit/attempts.ts (limit definition), a new migration, pgTAP and unit tests.
Non-goals: connection caps (#85), other alert actions.
Verification
npm run typecheck, npm run lint, npx vitest run src/app/w/[workspace]/alerts, npm run test:db.
Branch: <issue-number>-channel-test-limit
Model: anthropic/claude-opus-5-5 | Reasoning effort: unknown
- Lenguaje dominante
- TypeScript
- Estrellas
- 13
- Forks
- 2
- Merge medio
- 5 h 20 min
- PR fusionados (30 d)
- 287
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de eddiejaoude/StackDash
-
area: integrations documentation priority: P2 size: XS
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
eddiejaoude/StackDash#798 ·
Los mantenedores suelen responder en 1 día
-
area: ops documentation priority: P3 size: XS
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
eddiejaoude/StackDash#796 ·
Los mantenedores suelen responder en 1 día
-
area: docs documentation impact: low priority: P3 size: XS
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
eddiejaoude/StackDash#790 ·
Los mantenedores suelen responder en 1 día
-
area: ops bug impact: low priority: P3 size: XS
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
eddiejaoude/StackDash#785 ·
Los mantenedores suelen responder en 1 día
-
area: connections enhancement impact: low priority: P3 size: XS
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
eddiejaoude/StackDash#768 ·
Los mantenedores suelen responder en 1 día
Todos los issues de eddiejaoude/StackDash
Issues similares
-
bot:ai-assisted component:midnight-js status:untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
midnightntwrk/midnight-js#1790 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
area:vscode bug has repro platform:macos platform:vscode regression
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
anthropics/claude-code#113502 ·
-
Add: Rajdhani TV HDAbiertocheck:passed streams:add
Dificultad 1/5 Menos de una hora Aptitud para principiantes 77/100
Los mantenedores suelen responder en 1 día
-
effort/l priority/p1 risk/high triage/core
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
iflytek/skillhub#1188 · 1 comentario ·
Los mantenedores suelen responder en 1 día