Skip to content

validateMetadata() is a no-op — user input hits the DB unvalidated #755

@Otaiki1

Description

@Otaiki1

Problem

MetadataService.upsertMetadata() calls validateMetadata(), but the validator body is empty (metadata.service.ts:50-53). Title, description, and category are inserted into the database without length checks, format enforcement, or sanitisation — opening the door to oversized payloads and stored XSS.

Fix

Implement the validator: enforce max lengths, allowlisted categories, and strip/reject dangerous characters before any DB write.

File: backend/src/services/metadata.service.ts:36-54

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions