Skip to content

[FIX 2] Reliability: score endpoint 500, DB pooling, CVE timeout, query safety, thread safety #150

Description

@TFT444

Objective

Fix the five reliability findings from the codebase audit.

Findings addressed

  • REL-001 CRITICAL: Duplicate GROUP BY causes /api/score to always return HTTP 500, fix the query
  • REL-002 MEDIUM: Fragile INTERVAL '%s minutes' psycopg2 substitution, use safe parameterisation
  • REL-003 MEDIUM: New PostgreSQL connection per request, add connection pooling
  • REL-004 MEDIUM: Synchronous CVE enrichment times out on large scans, make it async or batched
  • REL-005 LOW: NVD rate-limit guard not thread-safe, add a lock

Acceptance criteria

  • /api/score returns 200 with correct data
  • Interval query uses safe parameterisation
  • Connection pooling in place
  • Large scans no longer timeout on CVE enrichment
  • NVD rate-limit guard is thread-safe
  • CI passes, base branch dev

Category

Reliability

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingpriority: highImportant, should be fixed in the current sprint

Type

Fields

No fields configured for Bug.

Projects

Status
🔨 In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions