The environment scanner examinesDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Eljakani/ward/llms.txt
Use this file to discover all available pages before exploring further.
.env and .env.example files for common security issues that could expose your Laravel application to vulnerabilities in production.
What it checks
The env-scanner performs 8 distinct security checks:| Check ID | Issue | Severity | Description |
|---|---|---|---|
| ENV-001 | No .env file found | Info | Application is missing an .env file. May be intentional in containerized deployments. |
| ENV-002 | APP_DEBUG enabled | High | APP_DEBUG=true exposes detailed error messages, stack traces, database queries, and environment variables to end users. |
| ENV-003 | Empty or missing APP_KEY | Critical | The application encryption key is not set. Laravel cannot encrypt cookies, sessions, and other sensitive data without it. |
| ENV-004 | Weak or default APP_KEY | Critical | The APP_KEY appears to be a default or placeholder value, making all encrypted data predictable and breakable. |
| ENV-005 | Non-production APP_ENV | Medium | APP_ENV is set to local, development, or dev, suggesting a non-production configuration on what may be a production server. |
| ENV-006 | Empty database password | Low | DB_PASSWORD is set to an empty string. Valid for local development but a security risk in production. |
| ENV-007 | File sessions in production | Low | SESSION_DRIVER is set to file in a production environment. File sessions don’t scale across multiple servers. |
| ENV-008 | Real credentials in .env.example | Medium | The .env.example file contains values that don’t look like placeholders. This file is typically committed to version control. |
Implementation details
Extracted frominternal/scanner/env/scanner.go:
APP_DEBUG check
APP_KEY validation
The scanner checks for weak keys using these heuristics:.env.example credential detection
The scanner looks for real-looking credentials in.env.example:
Example findings
Remediation examples
Fix APP_DEBUG
.env
Generate APP_KEY
Terminal
.env file automatically.
Fix session configuration
.env
Disabling checks
To disable specific environment checks, add them to your~/.ward/config.yaml:
Related documentation
- Configuration scanner - Checks config/*.php files
- Custom rules - Write your own .env checks
- Rule overrides - Change severity levels