.. / CVE-2017-16894

Exploit for Laravel <5.5.21 - Information Disclosure (CVE-2017-16894)

Description:

Laravel through 5.5.21 is susceptible to information disclosure. An attacker can obtain sensitive information such as externally usable passwords via a direct request for the /.env URI. NOTE: CVE pertains only to the writeNewEnvironmentFileWith function in src/Illuminate/Foundation/Console/KeyGenerateCommand.php, which uses file_put_contents without restricting .env permissions. The .env filename is not used exclusively by Laravel.

Nuclei Template

View the template here CVE-2017-16894.yaml

Validate with Nuclei

echo "$URL" | nuclei -t ~/nuclei-templates/http/cves/2017/CVE-2017-16894.yaml
Copy

References:

https://packetstormsecurity.com/files/cve/CVE-2017-16894
http://whiteboyz.xyz/laravel-env-file-vuln.html
https://twitter.com/finnwea/status/967709791442341888
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-16894
https://nvd.nist.gov/vuln/detail/CVE-2017-16894