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(payment): add joi validation on POST body for payment onboarding #7405

Merged
merged 2 commits into from
Jun 19, 2024

Conversation

KenLSM
Copy link
Contributor

@KenLSM KenLSM commented Jun 18, 2024

Problem

Our payment/onboarding url doesn't strictly validates that the email field exists. This in turn causes some parts of the email validator to fail.

Notes: this was from a tester trying to inject a malicious request into our DB query.

Solution

Require email to be a valid string.

Breaking Changes

  • No - this PR is backwards compatible

Tests

Regression

  • Visit form.gov.sg/payments
  • Enter your whitelisted email
  • Ensure that the message "An email has been sent to this email address." is displayed
  • Ensure that the email is received in your inbox

@KenLSM KenLSM force-pushed the fix/strict-email-payment-onboarding branch from e41378c to 07a2d80 Compare June 18, 2024 12:48
Co-authored-by: Tejas G. <code@gtejas.com>
@KenLSM KenLSM requested a review from g-tejas June 19, 2024 03:39
@KenLSM KenLSM enabled auto-merge (squash) June 19, 2024 03:39
Copy link
Contributor

@g-tejas g-tejas left a comment

Choose a reason for hiding this comment

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

LGTM!

@KenLSM KenLSM merged commit 3125384 into develop Jun 19, 2024
19 checks passed
@KenLSM KenLSM deleted the fix/strict-email-payment-onboarding branch June 19, 2024 07:15
@g-tejas g-tejas mentioned this pull request Jun 19, 2024
13 tasks
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