forked from yiisoft/yii2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added more tests for SwiftMailer vulnerability CVE-2016-10074
- Loading branch information
Showing
1 changed file
with
20 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -128,15 +128,34 @@ public function testValidateAttribute() | |
public function malformedAddressesProvider() | ||
{ | ||
return [ | ||
// this is the demo email used in the proof of concept of the exploit | ||
['"attacker\" -oQ/tmp/ -X/var/www/cache/phpcode.php "@email.com'], | ||
// trying more adresses | ||
['"Attacker -Param2 -Param3"@test.com'], | ||
['\'Attacker -Param2 -Param3\'@test.com'], | ||
['"Attacker \" -Param2 -Param3"@test.com'], | ||
["'Attacker \\' -Param2 -Param3'@test.com"], | ||
['"attacker\" -oQ/tmp/ -X/var/www/cache/phpcode.php "@email.com'] | ||
['"attacker\" -oQ/tmp/ -X/var/www/cache/phpcode.php "@email.com'], | ||
// and even more variants | ||
['"attacker\"\ -oQ/tmp/\ -X/var/www/cache/phpcode.php"@email.com'], | ||
["\"attacker\\\"\0-oQ/tmp/\0-X/var/www/cache/phpcode.php\"@email.com"], | ||
['"[email protected]\"-Xbeep"@email.com'], | ||
|
||
["'attacker\\' -oQ/tmp/ -X/var/www/cache/phpcode.php'@email.com"], | ||
["'attacker\\\\' -oQ/tmp/ -X/var/www/cache/phpcode.php'@email.com"], | ||
["'attacker\\\\'\\ -oQ/tmp/ -X/var/www/cache/phpcode.php'@email.com"], | ||
["'attacker\\';touch /tmp/hackme'@email.com"], | ||
["'attacker\\\\';touch /tmp/hackme'@email.com"], | ||
["'attacker\\';touch/tmp/hackme'@email.com"], | ||
["'attacker\\\\';touch/tmp/hackme'@email.com"], | ||
['"attacker\" -oQ/tmp/ -X/var/www/cache/phpcode.php "@email.com'], | ||
]; | ||
} | ||
|
||
/** | ||
* Test malicious email addresses that can be used to exploit SwiftMailer vulnerability CVE-2016-10074 | ||
* https://legalhackers.com/advisories/SwiftMailer-Exploit-Remote-Code-Exec-CVE-2016-10074-Vuln.html | ||
* | ||
* @dataProvider malformedAddressesProvider | ||
*/ | ||
public function testMalformedAddresses($value) | ||
|