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

Header injection vulnerability in address object #1289

Closed
2 of 6 tasks
tmazeika opened this issue May 22, 2021 · 1 comment
Closed
2 of 6 tasks

Header injection vulnerability in address object #1289

tmazeika opened this issue May 22, 2021 · 1 comment

Comments

@tmazeika
Copy link

tmazeika commented May 22, 2021

Please fill the following questionnaire about your issue:

  1. What kind of issue are you reporting?
  • A bug in Nodemailer
  • A bug in a plugin of Nodemailer (eg. issues with nodemailer-sendgrid)
  • Feature request
  • Looking for help to resolve some kind of problem with Nodemailer
  1. Are you listed as a sponsor of Nodemailer project (see Sponsors button above)?
  • Yes. Sponsors get priority support
  • No. Unless it is a bug in Nodemailer you might find support from public forums like StackOverflow.
  1. State your problem here:

I've got a pretty standard sendMail call here in an HTTP handler:

await transporter.sendMail({
  from: '...',
  to: '...',
  replyTo: {
    name,
    address,
  },
  subject: 'My Subject',
  text: message,
});

An address that contains line-breaks can add arbitrary SMTP headers. In my mind, the reason for using an address object is to avoid having to deal with escaping odd names and addresses (like would be necessary with `${name} <${address}>`); therefore, it is expected that name and address don't have to be sanitized. Otherwise, it's not just an address object, but an "address plus maybe arbitrary headers," which is not something anyone would want to have. I'm not sure what other fields are vulnerable. This was discovered by @lol768.

@andris9
Copy link
Member

andris9 commented May 23, 2021

Thank you for the report. I verified this to be correct, so I fixed the issue and released nodemailer@6.6.1

@andris9 andris9 closed this as completed May 23, 2021
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

No branches or pull requests

2 participants