Skip to content

Server-side validation gaps: priority, state group, string length #387

Description

@cavidelizade

Summary

Several user inputs aren't validated server-side, so garbage values persist and break downstream logic, and overlong strings 500 on a varchar overflow.

Details

  • Priority is only validated in BulkUpdate. IssueService.Create and Update assign priority verbatim, and the column is VARCHAR(30), so a >30-char value 500s and any short garbage value is stored and breaks priority filtering/sorting.
  • State group: StateService.Update validates against validStateGroups, but Create accepts any string (defaulting only when empty), so a state can be created with group: "foobar" that never matches a group query.
  • String max-length is missing across most create/update bodies (they use binding:"required" with no max). The columns are bounded (state name/color VARCHAR(255), project name, workspace name, issue name), so overlong input reaches Postgres and errors as 22001 -> 500. The max= pattern is used in the auth handlers, so it's known but applied inconsistently.
  • No DB CHECK constraints exist on any enum-like column (network, access, role, state group, priority, sync kind/state), so there's no backstop when app-side validation is missed.

Suggested fix

Validate priority and state group on create as well as update, add max length binding (or service-side caps) on user string fields, and consider adding CHECK constraints for the enum columns.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions