Ruby: SMTP command injection

ID H1:137631
Type hackerone
Reporter jeremy
Modified 2016-06-30T07:28:29


Net::SMTP is vulnerable to RCPT TO/MAIL FROM injection due to lack of input validation and conformance to the SMTP protocol.

Publicly disclosed already:

People are wrongly assigning this to the mail gem ( and thinking it's fixed, when in fact the underlying vuln remains in Net::SMTP.

Discussed as an issue with the mail library here: And mentioned that it's likely an issue with net-smtp not doing input validation, per RFC spec:

The mail gem should do input validation too, of course. But its responsibility is creating internet messages, and it would validate addresses against that spec. Its responsibility is not SMTP protocol compliance. Net::SMTP is.

Addressing this in Ruby in a timely manner will help resolve the considerable confusion that's emerged due to the lack of response to a publicly disclosed vulnerability.