Skip to content

No DTO in the entire app uses @IsNotEmpty() — required free-text fields (milestone title, pool name, team name) accept whitespace-only or empty strings #354

Description

@abayomicornelius

A repo-wide grep -rn "IsNotEmpty" src returns zero matches. Every required free-text field is validated with @IsString() alone, which class-validator treats as satisfied by "" or " ":

MilestonesService.create (src/milestones/milestones.service.ts) and MaintenancePoolService.create (src/maintenance-pool/maintenance-pool.service.ts) persist dto.title/dto.name verbatim with no server-side trim/empty check either. A client can POST /milestones with title: " " or POST /maintenance-pools with name: "" and get a 201 with a blank-looking, unsearchable/undisplayable resource that then holds real escrowed funds.

Fix: add @IsNotEmpty() (pair with a custom @Transform(({value}) => value?.trim()) or a @Matches(/\S/) if whitespace-only must also be rejected) to CreateMilestoneDto.title, CreatePoolDto.name, and CreateTeamDto.name.

Activity

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

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbugSomething isn't workinggood first issueGood for newcomers

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions