Skip to content

Laravel - Sensitive Information Disclosure

ID: laravel-env

Severity: high

Author: pxmme1337,dwisiswant0,geeknik,emenalf,adrianmf

Tags: config,exposure,laravel

A Laravel .env file was discovered, which stores sensitive information like database credentials and tokens. It should not be publicly accessible.

id: laravel-env
info:
name: Laravel - Sensitive Information Disclosure
author: pxmme1337,dwisiswant0,geeknik,emenalf,adrianmf
severity: high
description: |
A Laravel .env file was discovered, which stores sensitive information like database credentials and tokens. It should not be publicly accessible.
reference:
- https://laravel.com/docs/master/configuration#environment-configuration
- https://stackoverflow.com/questions/38331397/how-to-protect-env-file-in-laravel
classification:
cvss-metrics: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:L
cvss-score: 8.3
cwe-id: CWE-522
metadata:
max-request: 22
tags: config,exposure,laravel
http:
- method: GET
path:
- "{{BaseURL}}{{paths}}"
payloads:
paths:
- "/.env"
- "/.env.bak"
- "/.env.dev"
- "/.env.dev.local"
- "/.env.development.local"
- "/.env.prod"
- "/.env.prod.local"
- "/.env.production"
- "/.env.production.local"
- "/.env.local"
- "/.env.example"
- "/.env.stage"
- "/.env.live"
- "/.env.backup"
- "/.env.save"
- "/.env.old"
- "/.env.www"
- "/.env_1"
- "/.env_sample"
- "/.env.{{DN}}"
- "/.env.{{SD}}"
- "/api/.env"
matchers-condition: and
matchers:
- type: regex
part: body
regex:
- "(?mi)^APP_(NAME|ENV|KEY|DEBUG|URL|PASSWORD)="
- "(?mi)^DB_(HOST|PASSWORD|DATABASE)="
condition: or
- type: status
status:
- 200
# digest: 490a00463044022079f4a99fac86fae4799c4736fb3584a525d5d88c5ce6b2b13aad12ad9b69790f02204cd98b1286ef456fe695a9f424a2c2221239b749fab1768506c65a2f7ecab5f6:922c64590222798bb761d5b6d8e72950

This template is used to detect vulnerabilities in web applications. It can be used with the Nuclei tool to scan for specific patterns or behaviors.

Terminal window
$ nuclei -u "URL" -t "http/exposures/configs/laravel-env.yaml"

View on Github