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: tell tls what the smtps server name is #634

Merged
merged 1 commit into from Aug 6, 2020

Conversation

alsuren
Copy link
Contributor

@alsuren alsuren commented Aug 6, 2020

Related issue

As discussed with @aeneasr via email.

Previously there was no way to use smtps to send email without adding ?skip_ssl_verify=true to the end of the courier.smtp.connection_uri. In practice this means that anyone with the ability to poison DNS records (for any kratos installation that supports password reset emails) will be able to register an ssl certificate for any-old-domain and receive all password reset emails (since there is no way to configure kratos to verify the ssl server name for the email provider).

thank you for the disclosure! Given that misconfiguration results in an error (or enforces TLS verification skipping which results in raised eyebrows :) ) I would not classify this as a security vulnerability. Hence, it is ok (and encouraged) to just open a public PR for this. Thank you!

Proposed changes

Allow the tls module to correctly validate the hostname of the smtp server, by telling it what hostname you're expecting to connect to.

Checklist

  • I have read the contributing guidelines.
  • I have read the security policy.
  • I confirm that this pull request does not address a security
    vulnerability. If this pull request addresses a security. vulnerability, I
    confirm that I got green light (please contact
    security@ory.sh) from the maintainers to push
    the changes.
  • I have added tests that prove my fix is effective or that my feature
    works.
  • I have added or changed the documentation.

Once this patch is applied, it is possible to send mail via smtps://...@smtp.sendgrid.net:465/ without any warnings or errors (using their free tier). I'm not sure what other tests or documentation changes would be valuable.

@aeneasr
Copy link
Member

aeneasr commented Aug 6, 2020

Thank you! e2e tests fail for a different reason which I'll address in another PR

@aeneasr
Copy link
Member

aeneasr commented Aug 6, 2020

Looks like we have to wait for NPM to fix their cache issues: https://status.npmjs.org

@aeneasr aeneasr self-assigned this Aug 6, 2020
@aeneasr aeneasr added this to In progress in Maintainer's Board via automation Aug 6, 2020
@aeneasr aeneasr added this to the v0.5.0-alpha.1 milestone Aug 6, 2020
@aeneasr aeneasr merged commit b724038 into ory:master Aug 6, 2020
Maintainer's Board automation moved this from In progress to Done Aug 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants