Skip to content
This repository was archived by the owner on Feb 1, 2026. It is now read-only.

test(backend): Phase 2 - Add Missing Security & Error Handling Tests#373

Merged
gander merged 3 commits into
mainfrom
test/missing-tests-phase2
Feb 1, 2026
Merged

test(backend): Phase 2 - Add Missing Security & Error Handling Tests#373
gander merged 3 commits into
mainfrom
test/missing-tests-phase2

Conversation

@gander

@gander gander commented Feb 1, 2026

Copy link
Copy Markdown
Member

Summary

Phase 2 of Test Suite Quality Improvements: Add Missing Security & Error Handling Tests to improve backend test coverage and catch security vulnerabilities.

Changes

1. API Security Tests (api-security.test.ts)

  • ✅ Added 2 XSS prevention tests (project name, project description fields)
  • ✅ Added 2 Command injection prevention tests (semicolon and pipe patterns)
  • ✅ Removed 2 invalid tests (backticks, dollar signs - not security risks in browser context where URLs are passed to Playwright, not shell)

2. Path Traversal Edge Cases (path-traversal-advanced.test.ts)

  • ✅ Added test for control characters in pageId (null bytes)
  • ✅ Added test for oversized path segments (5000 chars - accepts 400 or 404)

3. Error Handling Tests (error-handling.test.ts) - NEW FILE

  • ✅ Added test for large but valid payloads (100KB description)
  • ✅ Added test for extremely large payloads (10MB - expects 400 or 413)
  • ✅ Added test for concurrent scan creations (verifies different projectIds)

Test Results

All tests passing with both Node.js versions:

Node 22.21.1

  • api-security.test.ts: 27 tests passing
  • path-traversal-advanced.test.ts: 37 tests passing
  • error-handling.test.ts: 3 tests passing

Node 24.12.0

  • api-security.test.ts: 27 tests passing
  • path-traversal-advanced.test.ts: 37 tests passing
  • error-handling.test.ts: 3 tests passing

Abandoned Work

Rate limiting tests: Investigation revealed that @ts-rest/fastify doesn't support standard Fastify route-level rate limiting configuration. Rate limiting is configured via metadata but headers are not present in responses. Would require architectural changes to implement properly.

Verification

# Run all new/modified tests
npm test -- api-security.test.ts
npm test -- path-traversal-advanced.test.ts
npm test -- error-handling.test.ts

# Verify formatting
npx -y @biomejs/biome@2.3.11 ci

Related

  • Plan: Test Suite Quality Improvements (Phase 2)
  • Branch: test/missing-tests-phase2
  • Next: Phase 2.3 - Frontend Accessibility Tests

🤖 Generated with Claude Code

@github-project-automation github-project-automation Bot moved this to Backlog in Diff Voyager Feb 1, 2026
@github-actions github-actions Bot added frontend Frontend-related code (Vue.js, TypeScript, UI components) size/large Large effort: 4-8 hours of work backend Backend-related code (Node.js, API, database, repositories) tests Test-related changes (unit, integration, e2e tests) labels Feb 1, 2026
@gander
gander added this pull request to the merge queue Feb 1, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Feb 1, 2026
@gander
gander added this pull request to the merge queue Feb 1, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Feb 1, 2026
- Add XSS prevention tests for project name and description fields
- Add command injection prevention tests (semicolon and pipe patterns)
- Remove backtick and dollar sign tests (not security risks in browser context)

Phase 2: Missing Security & Error Handling Tests

🤖 Generated with Claude Code
- Add test for control characters in pageId
- Add test for oversized path segments (accept 400 or 404)

Phase 2: Missing Security & Error Handling Tests

🤖 Generated with Claude Code
…rency

- Add test for large but valid payloads
- Add test for extremely large payloads (10MB)
- Add test for concurrent scan creations

Phase 2: Missing Security & Error Handling Tests

🤖 Generated with Claude Code
@gander
gander force-pushed the test/missing-tests-phase2 branch from 5b86bb3 to 49d16d9 Compare February 1, 2026 12:48
@github-actions github-actions Bot removed the frontend Frontend-related code (Vue.js, TypeScript, UI components) label Feb 1, 2026
@gander
gander added this pull request to the merge queue Feb 1, 2026
Merged via the queue into main with commit 0890e29 Feb 1, 2026
18 checks passed
@gander
gander deleted the test/missing-tests-phase2 branch February 1, 2026 12:51
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Diff Voyager Feb 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

backend Backend-related code (Node.js, API, database, repositories) size/large Large effort: 4-8 hours of work tests Test-related changes (unit, integration, e2e tests)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Enhancement: Missing, redundant and incorrect test cases in Diff Voyager test suite

1 participant