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

feat(user-route): validate type of req.body.email #1651

Merged
merged 1 commit into from
Jul 29, 2021

Conversation

yong-jie
Copy link
Member

Problem

req.body is based on user-controlled input and so req.body.email could be crafted with a custom .trim() property. Calling .trim() before validating the variable's type is unsafe.

Solution

Enforce that the type is a string.

@yong-jie yong-jie requested a review from LoneRifle July 29, 2021 04:50
Copy link
Contributor

@LoneRifle LoneRifle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@yong-jie yong-jie merged commit 5c147b1 into develop Jul 29, 2021
@yong-jie yong-jie deleted the validate-req-body-email branch July 29, 2021 04:58
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