Env files not kept out of git
Partialmedium severity · reads Beta
The project keeps settings in .env files, but .gitignore has no line for them, so the next `git add .` can publish them. Marked Gap when a file holds a secret-looking value (a key, token or password without a public prefix such as VITE_ or NEXT_PUBLIC_). Partial when only public settings are in it. Example and template files (.env.example) don't count. When Lintsure finds this, it marks it as Partial: it may be fine, depending on context only you can confirm.
How to fix it
Add .env and .env.* to .gitignore (keep !.env.example if you share one), then check `git ls-files` for env files already committed and rotate any secret keys they held.
Through a coding agent, Lintsure suggests the change and waits. Nothing is edited until you approve it.
Controls it relates to
- GDPRArt. 32Security of processing
- OWASP Top 10A02:2025Security Misconfiguration
What the framework asks
OWASP Top 10 A02:2025: Security Misconfiguration
Safe settings by default: debug off, real host names, strong secret keys, cookies marked secure, XML parsers that don't load outside files, and errors that don't reveal internals.
Evidence a reviewer may ask for: Production configuration and a hardening checklist.
Cyber Resilience Act Annex I Part I (2)(b): Secure by default configuration
The product ships with safe settings switched on: debug off, real host names, strong secrets, secure cookies, nothing left open that the user has to close.
Evidence a reviewer may ask for: Production configuration and the default settings a new install starts with.
CWE Top 25 CWE-200: Exposure of sensitive information
Personal data, secrets and internals don't leak into logs, URLs, errors or the browser.
Summaries are our own reading of the public texts, not the official wording.
Check your code for this
Runs on your machine. Your code is never uploaded.
npx lintsure scanThis rule is in Beta: its mapping to framework controls is our own reading of the public texts, not independently reviewed. Lintsure is a readiness tool, not an audit or legal advice. A finding, or the lack of one, doesn't make you compliant. Disclaimer
We improve these rules all the time. If you see a false alarm, a missed problem or anything that could work better, tell us in a review and we will use it to improve your experience.
Related rules
- Personal data written to logs
- Secret or private key committed to source
- Data sent over plain HTTP
- Personal data sent to an analytics or tracking tool
Did this rule flag something that's fine, or miss a real problem? Tell us on GitHub. Every report becomes a test case, so the same mistake can't come back.