CVE-2017-16894 Information disclosure in n/a

High 7.5 Published Updated

Remote attackers can read sensitive .env file contents, including passwords, due to insecure file permissions in Laravel's key generation command.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2017-16894?

CVE-2017-16894 is a high-severity vulnerability in n/a, published on 20 Nov 2017. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

In Laravel framework through 5.5.21, remote attackers can obtain sensitive information (such as externally usable passwords) via a direct request for the /.env URI. NOTE: this CVE is only about Laravel framework's writeNewEnvironmentFileWith function in src/Illuminate/Foundation/Console/KeyGenerateCommand.php, which uses file_put_contents without restricting the .env permissions. The .env filename is not used exclusively by Laravel framework.

Weakness: CWE-200

Which versions are affected by CVE-2017-16894?

It affects 1 product.

Products include Laravel Laravel.

How do I fix CVE-2017-16894?

Apply the vendor's patch.

Is CVE-2017-16894 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2017-16894 exists.

Public exploit code: 1 Metasploit module, 1 Exploit-DB entry and 1 Nuclei template.

Sources

Also known as GHSA-2v4r-7m2m-5chh.

Is CVE-2017-16894 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free