Skip to content

feat(backend): sanitize queue inputs and handle 409 duplicate slugs (#183) - #223

Open
stayzappy wants to merge 1 commit into
Stellar-Deejah:mainfrom
stayzappy:feature/issue-183-queue-input-sanitization
Open

feat(backend): sanitize queue inputs and handle 409 duplicate slugs (#183)#223
stayzappy wants to merge 1 commit into
Stellar-Deejah:mainfrom
stayzappy:feature/issue-183-queue-input-sanitization

Conversation

@stayzappy

@stayzappy stayzappy commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Closes #183

Summary of Changes (Closes #183)

1. Slug Validation & Length Restrictions

  • Enforced regex /^[a-zA-Z0-9-]+$/ and max length of 9 characters on slug field in CreateQueueSchema inside backend/src/routes/queues.ts.

2. HTML & XSS Protection

  • Added input sanitization guards rejecting HTML tags (/<[^>]*>/) in both name and description fields during queue creation.

3. Duplicate Conflict Handling

  • Handled duplicate queue slug errors in POST /api/queues, returning HTTP status 409 Conflict.

4. Unit Tests

  • Created backend/src/__tests__/queueSanitization.test.ts verifying valid payloads, slug length/character rules, HTML tag rejection, and duplicate slug 409 conflict handling.

Verification

  • Unit Tests: npx vitest run queueSanitization -> 6 passed, 0 failed.

@vercel

vercel Bot commented Aug 24, 2026

Copy link
Copy Markdown

@stayzappy is attempting to deploy a commit to the Deejah Team on Vercel.

A member of the Team first needs to authorize it.

@stayzappy
stayzappy force-pushed the feature/issue-183-queue-input-sanitization branch 2 times, most recently from 57a3a33 to 306b5f9 Compare August 31, 2026 09:38
@stayzappy
stayzappy force-pushed the feature/issue-183-queue-input-sanitization branch from 306b5f9 to 1139c1d Compare August 31, 2026 17:42
@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
line-proof Skipped Skipped Aug 31, 2026 5:42pm

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Backend: slug and name fields accept HTML/script injection — no format validation beyond length

1 participant