Skip to content

Commit

Permalink
added more tests for SwiftMailer vulnerability CVE-2016-10074
Browse files Browse the repository at this point in the history
  • Loading branch information
cebe committed Dec 28, 2016
1 parent 6af2a43 commit 96ee5c3
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion tests/framework/validators/EmailValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 96ee5c3

Please sign in to comment.