Skip to content

Bug: Skill assessment endpoints lack input validation, enabling assessment fraud and crashes #778

@anshul23102

Description

@anshul23102

Problem Statement

DevPath does not implement request validation on skill assessment API endpoints, allowing users to submit invalid or malicious payloads that crash the assessment engine or cause incorrect skill level calculations. Attackers can manipulate responses to claim false skill levels.

Root Cause Analysis

Assessment endpoints lack input schema validation. No bounds checking on score values. Malformed JSON or unexpected data types cause unhandled exceptions. No rate limiting prevents test submission spam.

Solution Overview

  1. Implement strict input validation using JSON schema validation library
  2. Add type checking and bounds verification on all inputs
  3. Implement rate limiting on assessment submissions
  4. Add comprehensive error handling with safe error messages
  5. Implement assessment answer verification against solution key
  6. Add tamper detection (verify responses match expected submission flow)
  7. Log suspicious assessment attempts

Type of Change

  • Bug fix (security/reliability)
  • New feature
  • Breaking change
  • Documentation update

Testing Done

Environment

  • Node.js 18.x+
  • JSON schema validator
  • Test input fuzzing

Manual Testing Steps

Test Case 1: Invalid score submission

  1. Submit skill assessment with score: 999999 (invalid)
  2. Observe response

Expected: Request rejected with validation error
Actual: Score accepted, user skill level inflated to unrealistic level

Test Case 2: Malformed JSON

  1. Submit: "{broken json: unclosed"
  2. Check error handling

Expected: Graceful 400 Bad Request response
Actual: Server crashes with 500 error

Related Issue

Prevents skill level fraud and maintains assessment integrity.

Suggested Labels

bug, level:intermediate, gssoc26, security, validation, assessment, input-validation

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions