The configuration scanner examines Laravel’sDocumentation 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.
config/*.php files for hardcoded secrets, insecure defaults, and missing security flags that could compromise your application.
What it checks
The config-scanner performs 13 security checks across 8 configuration files:All checks
| Check ID | File | Issue | Severity |
|---|---|---|---|
| CFG-001 | app.php | Debug mode hardcoded to true | High |
| CFG-002 | app.php | Non-standard encryption cipher | Medium |
| CFG-003 | auth.php | Password reset token expiry too long | Low |
| CFG-004 | session.php | Session cookie missing HttpOnly flag | High |
| CFG-005 | session.php | Session cookie missing Secure flag | Medium |
| CFG-006 | session.php | Session cookie SameSite set to none | Medium |
| CFG-007 | session.php | Session lifetime excessively long | Low |
| CFG-008 | mail.php | Mail password hardcoded in config | High |
| CFG-009 | cors.php | CORS allows all origins | Medium |
| CFG-010 | cors.php | CORS allows credentials with wildcard origin | High |
| CFG-011 | database.php | Database password hardcoded in config | High |
| CFG-012 | broadcasting.php | Broadcasting secret/key hardcoded | Medium |
| CFG-013 | logging.php | Slack webhook URL hardcoded | Medium |
Implementation details
Extracted frominternal/scanner/configscan/scanner.go:
Config files scanned
Pattern matching
The scanner uses regex to find problematic configurations:Hardcoded credential detection
For mail, database, and broadcasting configs, Ward detects hardcoded credentials:Critical checks
Session security (CFG-004, CFG-005, CFG-006)
Session cookies without proper flags are vulnerable to theft:HttpOnly flag (CFG-004)
HttpOnly flag (CFG-004)
Without
HttpOnly, JavaScript can access the session cookie via document.cookie, enabling theft through XSS attacks.config/session.php
Secure flag (CFG-005)
Secure flag (CFG-005)
Without
Secure, the cookie is sent over plain HTTP, allowing session hijacking via network sniffing.config/session.php
SameSite attribute (CFG-006)
SameSite attribute (CFG-006)
Setting SameSite to ‘none’ allows the cookie to be sent with cross-site requests, weakening CSRF protection.
config/session.php
CORS misconfiguration (CFG-009, CFG-010)
Allowing all origins is dangerous, especially with credentials:config/cors.php
Example findings
Remediation guide
Move credentials to .env
config/database.php
.env
Fix session security
config/session.php
Fix CORS configuration
config/cors.php
Disabling checks
To disable specific config checks:~/.ward/config.yaml
Related documentation
- Environment scanner - Checks .env files
- Rules scanner - Custom YAML rules for configs
- Rule overrides - Adjust severity levels