Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: restrict state to active and inactive in directory search #2051

Merged
merged 2 commits into from
Nov 16, 2022

Conversation

halfwhole
Copy link
Collaborator

@halfwhole halfwhole commented Oct 26, 2022

Problem

Similar to #2050, the query conditions for state when searching for URLs in the directory page are overly permissive, and should be restricted to either active or inactive states.

See Snyk dashboard - Improper Type Validation

Solution

Use Joi validator to allow the optional state field to be only one of ACTIVE, INACTIVE. (updated to remove '' following comments in the other PR!) (Joi validated fields are optional by default)

No controller tests can be added here - the Joi validation happens in the middleware before hitting the controller level

@halfwhole halfwhole merged commit ae3e580 into develop Nov 16, 2022
@halfwhole halfwhole deleted the fix/directory-search-restrict-state branch November 16, 2022 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants