[{"data":1,"prerenderedAt":73},["ShallowReactive",2],{"fix-index":3},{"entries":4},[5,22,33,49,61],{"id":6,"slug":7,"title":8,"description":9,"bucket":10,"severity":11,"status":12,"publishedAt":13,"summary":14,"affectedCheck":15,"fixSteps":16,"agenticPrompt":17,"references":18},"fix-permissive-firebase-rules","permissive-firebase-rules","Your Firebase or Firestore rules let anyone read your database","Default or test mode security rules leave your whole database world readable, and the client SDK keys are public by design. Here is how to check your rules and lock them down.","NEW_VULNERABILITY","critical","published","2026-11-23T09:20:00.000Z","\u003Cp>Backend as a service platforms move authorisation out of your server and into a rules file. That is a real advantage, right up until the rules are wrong, because there is no server in between to catch the mistake.\u003C\u002Fp>\n\u003Cp>The configuration your app ships, the project identifier and the client API key, is public by design and visible in your JavaScript bundle. That is expected and is not itself the problem. The rules are the only thing standing between a visitor and your data.\u003C\u002Fp>\n\u003Cp>The common failure is starting a project in test mode, which allows open read and write access so you can build quickly, and then shipping before tightening it. A second failure is a rule that checks only that somebody is signed in, without checking \u003Cem>which\u003C\u002Fem> user they are, so any authenticated account can read every record. Either way the result is a database that answers questions for anyone who asks.\u003C\u002Fp>","\u003Cp>Open your project's rules in the Firebase console and read them. Two patterns are immediate problems.\u003C\u002Fp>\n\u003Cp>Open access, usually left over from test mode:\u003C\u002Fp>\n\u003Cpre>allow read, write: if true;\u003C\u002Fpre>\n\u003Cp>Signed in but unrestricted, which lets any account read everyone's records:\u003C\u002Fp>\n\u003Cpre>allow read: if request.auth != null;\u003C\u002Fpre>\n\u003Cp>The console's Rules Playground will simulate a read as an unauthenticated user against a specific document path, which is the quickest way to confirm what a stranger can actually do. Check the expiry date too: test mode rules are commonly written as a date comparison that has already lapsed, which fails closed, or is still open.\u003C\u002Fp>\n\u003Cp>If your rules allow unauthenticated reads of collections holding user data, treat that data as already retrieved.\u003C\u002Fp>","\u003Ch3>1. Close open access immediately\u003C\u002Fh3>\n\u003Cp>Replace any \u003Ccode>if true\u003C\u002Fcode> rule. Start from deny by default and grant only what a specific path genuinely needs.\u003C\u002Fp>\n\u003Ch3>2. Scope every rule to the owning user\u003C\u002Fh3>\n\u003Cp>Checking that a request is authenticated is not authorisation. Compare the signed in user against the record's owner, for example:\u003C\u002Fp>\n\u003Cpre>match \u002Fusers\u002F{userId} {\n  allow read, write: if request.auth != null\n    &amp;&amp; request.auth.uid == userId;\n}\u003C\u002Fpre>\n\u003Ch3>3. Validate writes, not just reads\u003C\u002Fh3>\n\u003Cp>Rules decide what a client may write as well as read. Constrain the shape and the values of incoming data so a client cannot set fields it should not control, such as a role, a balance or a flag that grants privileges.\u003C\u002Fp>\n\u003Ch3>4. Keep privileged work on the server\u003C\u002Fh3>\n\u003Cp>Anything that must not be client decided belongs in a server context with the admin SDK, behind your own endpoint. Rules protect client access, they do not make a privileged operation safe to expose.\u003C\u002Fp>\n\u003Ch3>5. Test the rules, then keep testing them\u003C\u002Fh3>\n\u003Cp>Use the emulator and the rules unit testing library to assert both what is allowed and what is refused. Rules are code, and untested rules drift. Add these to your normal test run so a future change cannot quietly reopen access.\u003C\u002Fp>\n\u003Ch3>6. Assume disclosure and act on it\u003C\u002Fh3>\n\u003Cp>If personal data was readable, you may have notification duties under the data protection law that applies to you. Decide that deliberately rather than by omission.\u003C\u002Fp>","You are helping me audit and fix the security rules on a backend as a service database for an app I own and operate.\n\nProblem: my Firebase, Firestore or Realtime Database rules may allow public or over broad access to data.\n\nWork through the following in order, and confirm with me before applying any rules change.\n\n1. Find the rules files in this repository (for example firestore.rules, storage.rules, database.rules.json) and the project configuration. If they are not in the repository, tell me and explain how to export them from the console.\n2. Read every rule and list each match path with the access it grants and the conditions attached.\n3. Flag every rule matching a dangerous pattern, and explain the practical consequence of each in plain language:\n   - allow read, write: if true\n   - any condition that only checks request.auth != null without comparing identity to the record owner\n   - a test mode timestamp condition, noting whether it has expired\n   - wildcard recursive matches that grant more than the specific path needs\n4. For each collection, tell me what data it holds and who should be able to read and write it. Ask me where you cannot tell from the code.\n5. Rewrite the rules to deny by default and grant least privilege, scoping each rule to the owning user, and validating the shape and values of writes so a client cannot set privileged fields. Show me the full proposed rules file before anything is applied.\n6. Identify any operation that the client should not be allowed to decide, and propose moving it to a server side function using the admin SDK behind my own endpoint.\n7. Write rules unit tests using the emulator and the rules testing library, asserting both the allowed and the denied cases, including an unauthenticated read of every sensitive collection. Wire them into the project's existing test command.\n8. Tell me plainly which collections were readable without authentication, so I can assess whether personal data was exposed and whether I have a notification duty.\n\nDo not print any record contents or personal data. Finish with the proposed rules, the tests, and an ordered list of what I must do by hand.",[19],{"label":20,"href":21},"Firebase: Security Rules","https:\u002F\u002Ffirebase.google.com\u002Fdocs\u002Frules",{"id":23,"slug":24,"title":25,"description":26,"bucket":10,"severity":27,"status":12,"publishedAt":28,"summary":29,"affectedCheck":30,"fixSteps":31,"agenticPrompt":32},"fix-leaked-source-maps","leaked-source-maps","Your production build is leaking source and secrets to the browser","Source maps and hardcoded keys in a client bundle hand your original code and your API secrets to every visitor. Here is how to check what you are shipping, and what to do about it.","high","2026-11-23T09:15:00.000Z","\u003Cp>Modern front end tooling makes this easy to get wrong, because the default behaviour is tuned for debugging rather than for shipping. Two separate problems usually arrive together.\u003C\u002Fp>\n\u003Cp>The first is source maps. A \u003Ccode>.js.map\u003C\u002Fcode> file next to your bundle lets anyone reconstruct your original, unminified source, with comments, file names and directory structure intact. That is a disclosure problem rather than a direct break, but it removes the effort from finding everything else.\u003C\u002Fp>\n\u003Cp>The second is the serious one. Any value compiled into a client bundle is public, permanently, no matter how it is named. A build time variable prefixed for client exposure, an API key passed to a browser SDK, a token inlined for convenience: all of it ships to every visitor. Minification is not protection, and neither is removing the source map. If a secret reached the browser, it has already been disclosed.\u003C\u002Fp>","\u003Cp>First, look for source maps. Open your site, view the main JavaScript bundle, and check the last line for a comment like:\u003C\u002Fp>\n\u003Cpre>\u002F\u002F# sourceMappingURL=index-a1b2c3.js.map\u003C\u002Fpre>\n\u003Cp>Then request that file directly. If it loads, your original source is public.\u003C\u002Fp>\n\u003Cp>Second, and more important, search the shipped bundle for secrets. In your browser devtools, open the Network tab, load your site, and search the JavaScript responses for telltale fragments such as \u003Ccode>secret\u003C\u002Fcode>, \u003Ccode>api_key\u003C\u002Fcode>, \u003Ccode>apikey\u003C\u002Fcode>, \u003Ccode>password\u003C\u002Fcode>, \u003Ccode>token\u003C\u002Fcode>, and \u003Ccode>-----BEGIN\u003C\u002Fcode>.\u003C\u002Fp>\n\u003Cp>Anything you find there is already public. Treat it as compromised, not as something to tidy up later.\u003C\u002Fp>","\u003Ch3>1. Rotate anything that reached the browser\u003C\u002Fh3>\n\u003Cp>Any credential found in a client bundle must be rotated. It was served to every visitor and may sit in caches, proxies and archives. Removing it from the next build does not undo the disclosure.\u003C\u002Fp>\n\u003Ch3>2. Decide what genuinely belongs client side\u003C\u002Fh3>\n\u003Cp>Some keys are designed to be public, such as a publishable payment key or a map tile key. Those are fine, but they must be restricted by referrer, domain or scope in the provider's dashboard. Everything else belongs on the server.\u003C\u002Fp>\n\u003Ch3>3. Move real secrets behind your own endpoint\u003C\u002Fh3>\n\u003Cp>If the browser needs data that requires a privileged key, call your own server route, keep the key there, and return only the result. The browser should never hold the credential.\u003C\u002Fp>\n\u003Ch3>4. Stop publishing source maps\u003C\u002Fh3>\n\u003Cp>Either disable source map output for production builds, or keep generating them and upload them to your error tracker instead of deploying them. Most trackers support uploading and then deleting the files from the build output, which is the best of both: readable stack traces for you, nothing public.\u003C\u002Fp>\n\u003Ch3>5. Check your client exposure prefix\u003C\u002Fh3>\n\u003Cp>Frameworks expose variables to the browser through a naming convention. Audit every variable using that prefix and confirm each one is genuinely safe to publish. It is a common mistake to add the prefix to make a build work and ship a real secret by accident.\u003C\u002Fp>","You are helping me audit and fix what my production front end build exposes to the browser. I own and operate this site.\n\nProblem: my production build may be publishing source maps and, more seriously, may contain secrets compiled into the client bundle.\n\nWork through the following in order, and confirm with me before any destructive or irreversible step.\n\n1. Identify the framework and the bundler, and find the production build configuration.\n2. Tell me whether source maps are emitted for production builds, and show me the exact setting that controls it.\n3. Find every environment variable this project exposes to the client. Identify the framework's client exposure prefix first (for example the prefix used by Vite, Next, Nuxt or Create React App), then list every variable using it.\n4. For each client exposed variable, classify it as SAFE TO PUBLISH (designed to be public, such as a publishable payment key or a map key) or MUST NOT BE PUBLIC. Explain each classification. Refer to variables by NAME ONLY and never print a value.\n5. Search the repository for secrets passed into client side code by any other route: hardcoded literals, values imported into components, keys handed to browser SDKs. Report file and line, names only, never values.\n6. For everything classified MUST NOT BE PUBLIC, produce a rotation checklist naming the credential, its provider, and where it is rotated. I will do the rotating.\n7. Propose the refactor that moves each real secret behind a server route, so the browser receives only the result and never the credential. Show me the change before applying it.\n8. For keys that are legitimately public, tell me what restriction I should apply in the provider's dashboard (referrer, domain, IP or scope allowlist).\n9. Recommend a production source map strategy: either disable emission, or emit and upload to my error tracker then delete from the deployed output. Tell me which this project already supports.\n\nFinish with a summary of what you changed, the rotation checklist, and anything I must do by hand.",{"id":34,"slug":35,"title":36,"description":37,"bucket":38,"severity":39,"status":12,"publishedAt":40,"summary":41,"affectedCheck":42,"fixSteps":43,"agenticPrompt":44,"references":45},"fix-directory-listing","directory-listing","Your server is listing directory contents","Directory listing turns your web server into a file browser, exposing backups, dumps and files you never meant to publish. Here is how to check and switch it off.","LONG_STANDING_VULNERABILITY","medium","2026-11-23T09:10:00.000Z","\u003Cp>When a web server receives a request for a directory with no index file, it can do one of two things: refuse, or list what is inside. Listing is the unhelpful option, and on some configurations it is the default.\u003C\u002Fp>\n\u003Cp>The listing itself is not the vulnerability. The problem is that it removes the need to guess. Files nobody linked to, and nobody expected to be found, become browsable: database dumps, \u003Ccode>backup.zip\u003C\u002Fcode>, \u003Ccode>site-old\u002F\u003C\u002Fcode>, editor swap files, spreadsheets, invoices, build output with internal paths in it.\u003C\u002Fp>\n\u003Cp>Treat this as a disclosure issue that makes every other weakness easier to find. It is usually a few minutes of work to fix and it closes off a whole category of casual discovery.\u003C\u002Fp>","\u003Cp>Request a directory on your own site that has no index page, for example:\u003C\u002Fp>\n\u003Cpre>https:\u002F\u002Fyour-domain.com\u002Fassets\u002F\nhttps:\u002F\u002Fyour-domain.com\u002Fuploads\u002F\nhttps:\u002F\u002Fyour-domain.com\u002Fbackups\u002F\u003C\u002Fpre>\n\u003Cp>If you see a bare table of filenames with a title like \u003Ccode>Index of \u002Fuploads\u003C\u002Fcode>, listing is on. A \u003Ccode>403\u003C\u002Fcode> or \u003Ccode>404\u003C\u002Fcode> is the correct response.\u003C\u002Fp>\n\u003Cp>While you are there, look at what the listing reveals. Anything sensitive in those directories should be treated as already downloaded.\u003C\u002Fp>","\u003Ch3>1. Turn listing off\u003C\u002Fh3>\n\u003Cp>For nginx, make sure autoindex is off. It is off by default, so an explicit \u003Ccode>autoindex on;\u003C\u002Fcode> somewhere is usually the cause:\u003C\u002Fp>\n\u003Cpre>autoindex off;\u003C\u002Fpre>\n\u003Cp>For Apache, remove the \u003Ccode>Indexes\u003C\u002Fcode> option:\u003C\u002Fp>\n\u003Cpre>Options -Indexes\u003C\u002Fpre>\n\u003Ch3>2. Move what should never have been published\u003C\u002Fh3>\n\u003Cp>Switching listing off hides the index, not the files. Anyone who guesses a filename can still fetch it. Move backups, dumps and archives out of the published directory altogether.\u003C\u002Fp>\n\u003Ch3>3. Rotate anything a dump contained\u003C\u002Fh3>\n\u003Cp>If a database dump or an archive of your application was exposed, treat its contents as read, and rotate any credential inside it.\u003C\u002Fp>\n\u003Ch3>4. Stop writing backups into the web root\u003C\u002Fh3>\n\u003Cp>This usually comes from a convenience script or a plugin writing to a path under the document root. Fix the script, not just today's files, or the problem returns with the next backup.\u003C\u002Fp>","You are helping me fix a security misconfiguration on a website I own and operate.\n\nProblem: my web server lists directory contents when there is no index file, exposing files I never intended to publish.\n\nWork through the following in order, and confirm with me before deleting or moving anything.\n\n1. Identify the web server and the directory it publishes. Tell me how you concluded that.\n2. Find the configuration that enables directory listing: autoindex on for nginx, or Options Indexes for Apache. Report every place it is set, including included config files and .htaccess.\n3. Give me the exact change that disables it for this server, and nothing broader than necessary.\n4. Inventory the published directory for files that should not be public. Look for database dumps (.sql, .dump), archives (.zip, .tar, .tar.gz, .bak), editor and swap files (.swp, ~, .orig, .save), spreadsheets and documents, private keys (.pem, .key, .p12), and any directory named like backup, old, temp, or copy.\n5. Classify that inventory by sensitivity, and recommend for each whether to move it out of the published directory or delete it. Do not delete anything yourself: list it and wait for me.\n6. If any dump or archive is likely to contain credentials, tell me so and produce a rotation checklist naming each credential and where it is rotated. Never print a secret value.\n7. Check whether anything in this repository or its scripts writes backups into the published directory, and propose a fix so the problem does not come back with the next backup run.\n8. Add an index file or an explicit deny rule for directories that are meant to stay browsable to nobody.\n\nFinish with a summary of what you changed and an ordered list of what I must do by hand.",[46],{"label":47,"href":48},"OWASP Top 10: Security Misconfiguration","https:\u002F\u002Fowasp.org\u002FTop10\u002FA05_2021-Security_Misconfiguration\u002F",{"id":50,"slug":51,"title":52,"description":53,"bucket":38,"severity":27,"status":12,"publishedAt":54,"summary":55,"affectedCheck":56,"fixSteps":57,"agenticPrompt":58,"references":59},"fix-exposed-git-folder","exposed-git-folder","Your .git folder is exposed to the internet","A published .git directory lets anyone reconstruct your entire source code and read every secret your repository has ever contained. Check it in one request and fix it today.","2026-11-23T09:05:00.000Z","\u003Cp>Deploying by running \u003Ccode>git pull\u003C\u002Fcode> on the server is convenient, and it leaves a \u003Ccode>.git\u003C\u002Fcode> directory next to your application. If that directory is inside the folder your web server publishes, it is readable over HTTP.\u003C\u002Fp>\n\u003Cp>That matters more than it first appears. \u003Ccode>.git\u003C\u002Fcode> does not just describe the current files, it contains the repository's object database. With it, your full source code can be reconstructed, along with every version of every file that was ever committed.\u003C\u002Fp>\n\u003Cp>So this exposes two things at once: your source code, including any server side logic you assumed was private, and your history. Credentials that were committed once and removed later are still in there, and they are still valid unless somebody rotated them.\u003C\u002Fp>","\u003Cp>Ask your own site for the repository's config file:\u003C\u002Fp>\n\u003Cpre>https:\u002F\u002Fyour-domain.com\u002F.git\u002Fconfig\u003C\u002Fpre>\n\u003Cp>If you get back a text file containing \u003Ccode>[core]\u003C\u002Fcode> and a \u003Ccode>[remote \"origin\"]\u003C\u002Fcode> section, the directory is exposed. A \u003Ccode>404\u003C\u002Fcode> or \u003Ccode>403\u003C\u002Fcode> is the correct answer.\u003C\u002Fp>\n\u003Cp>Also try \u003Ccode>\u002F.git\u002FHEAD\u003C\u002Fcode>. A response of \u003Ccode>ref: refs\u002Fheads\u002Fmain\u003C\u002Fcode> confirms the same problem. Some servers block the directory index while still serving the files inside it, so test a file and not just \u003Ccode>\u002F.git\u002F\u003C\u002Fcode>.\u003C\u002Fp>","\u003Ch3>1. Stop serving the directory\u003C\u002Fh3>\n\u003Cp>Block it at the web server. For nginx, denying all dotfiles covers this and \u003Ccode>.env\u003C\u002Fcode> at the same time:\u003C\u002Fp>\n\u003Cpre>location ~ \u002F\\. {\n  deny all;\n  return 404;\n}\u003C\u002Fpre>\n\u003Cp>For Apache:\u003C\u002Fp>\n\u003Cpre>&lt;DirectoryMatch \"\u002F\\.git\"&gt;\n  Require all denied\n&lt;\u002FDirectoryMatch&gt;\u003C\u002Fpre>\n\u003Ch3>2. Audit the history for secrets\u003C\u002Fh3>\n\u003Cp>Assume the repository was downloaded. Search the history for credentials that were committed and later removed, and rotate every one you find. They are still live keys.\u003C\u002Fp>\n\u003Ch3>3. Change how you deploy\u003C\u002Fh3>\n\u003Cp>Pulling a git repository into the web root is the root cause. Build elsewhere and publish only the build output, or deploy an artifact, or point the document root at a subdirectory such as \u003Ccode>public\u002F\u003C\u002Fcode> so the repository sits above it.\u003C\u002Fp>\n\u003Ch3>4. Point the document root at the right place\u003C\u002Fh3>\n\u003Cp>Most frameworks expect the server to publish a single subdirectory. Serving the project root is what exposes \u003Ccode>.git\u003C\u002Fcode>, \u003Ccode>.env\u003C\u002Fcode>, lockfiles and configuration all at once. Fixing the document root fixes a whole class of problems.\u003C\u002Fp>","You are helping me fix a security misconfiguration on a website I own and operate.\n\nProblem: my .git directory is reachable over HTTP, which exposes my source code and the full commit history, including any secrets ever committed.\n\nWork through the following in order, and confirm with me before any destructive or irreversible step.\n\n1. Identify the stack, the deploy method and the directory the web server publishes. Tell me whether the repository root is being served directly, and how you concluded that.\n2. Explain how this project is deployed. If deployment works by running git pull on the server, say so clearly, because that is the root cause.\n3. Add a web server rule that denies all requests for paths beginning with a dot, covering both .git and .env. Detect whether this project uses nginx, Apache, Caddy, or a managed host, and write the rule for that one only.\n4. Propose the smallest change that stops the repository being inside the published directory: either repoint the document root at the framework's public directory, or switch to publishing build output or a deployment artifact. Show me the change, do not apply it to production yourself.\n5. Scan the git history for committed secrets and report them BY NAME AND LOCATION ONLY. Never print a secret value. Useful starting points: git log --all --full-history for files such as .env, config files, private keys, .pem, .p12, id_rsa, and service account JSON.\n6. From that scan, produce a rotation checklist naming each credential, the provider it belongs to, and where it gets rotated. I will do the rotating.\n7. Tell me whether the exposed history contains anything beyond credentials that I should treat as disclosed, for example internal hostnames, customer data in fixtures, or private business logic.\n\nFinish with a summary of the changes you made, and an ordered list of what I must do by hand.",[60],{"label":47,"href":48},{"id":62,"slug":63,"title":64,"description":65,"bucket":38,"severity":11,"status":12,"publishedAt":66,"summary":67,"affectedCheck":68,"fixSteps":69,"agenticPrompt":70,"references":71},"fix-public-env","public-env","Your .env file is publicly readable","A publicly reachable .env file hands every API key, database password and signing secret to anyone who asks for it. Here is how to check, and how to fix it properly.","2026-11-23T09:00:00.000Z","\u003Cp>A \u003Ccode>.env\u003C\u002Fcode> file holds the credentials your application needs to run: database passwords, API keys, mail and payment provider secrets, session and token signing keys. It belongs on the server, readable only by the application process.\u003C\u002Fp>\n\u003Cp>When that file sits inside the directory your web server publishes, anybody can request it over HTTP and read every secret in it. There is no exploit and no skill involved, it is an ordinary file request. Automated scanners sweep the internet for exactly this, so exposure tends to be measured in hours rather than months.\u003C\u002Fp>\n\u003Cp>The damage rarely stops at the one site. The same keys are usually reused across staging and production, and database, storage and mail credentials let an attacker read your data, change it, or send mail as you. A single exposed \u003Ccode>.env\u003C\u002Fcode> is therefore a common route to a full account takeover.\u003C\u002Fp>","\u003Cp>Request the file from your own site, straight from the browser address bar:\u003C\u002Fp>\n\u003Cpre>https:\u002F\u002Fyour-domain.com\u002F.env\u003C\u002Fpre>\n\u003Cp>If the browser shows or downloads a file of \u003Ccode>KEY=value\u003C\u002Fcode> lines, it is exposed. A \u003Ccode>404\u003C\u002Fcode> or \u003Ccode>403\u003C\u002Fcode> means that path is not being served, which is what you want.\u003C\u002Fp>\n\u003Cp>Check the variants too, because editors, backups and deploy scripts leave them behind constantly: \u003Ccode>.env.local\u003C\u002Fcode>, \u003Ccode>.env.production\u003C\u002Fcode>, \u003Ccode>.env.development\u003C\u002Fcode>, \u003Ccode>.env.backup\u003C\u002Fcode>, \u003Ccode>.env.save\u003C\u002Fcode> and \u003Ccode>.env.bak\u003C\u002Fcode>.\u003C\u002Fp>\n\u003Cp>Treat anything that loads as already read by somebody else. Plan on that basis.\u003C\u002Fp>","\u003Ch3>1. Rotate every secret first\u003C\u002Fh3>\n\u003Cp>Change every credential that file contained before you touch anything else. Deleting the file achieves nothing while the keys inside it still work. Rotate database passwords, API keys, access tokens and signing secrets, and invalidate existing sessions if your framework allows it.\u003C\u002Fp>\n\u003Ch3>2. Move configuration out of the web root\u003C\u002Fh3>\n\u003Cp>The directory your web server publishes should contain only what you mean to publish. Application code and configuration belong above it, not inside it.\u003C\u002Fp>\n\u003Ch3>3. Deny dotfiles at the web server\u003C\u002Fh3>\n\u003Cp>Refuse any request for a path that begins with a dot. For nginx:\u003C\u002Fp>\n\u003Cpre>location ~ \u002F\\. {\n  deny all;\n  return 404;\n}\u003C\u002Fpre>\n\u003Cp>For Apache, inside the virtual host or directory block:\u003C\u002Fp>\n\u003Cpre>&lt;FilesMatch \"^\\.\"&gt;\n  Require all denied\n&lt;\u002FFilesMatch&gt;\u003C\u002Fpre>\n\u003Ch3>4. Keep it out of version control\u003C\u002Fh3>\n\u003Cp>Add \u003Ccode>.env\u003C\u002Fcode> and its variants to \u003Ccode>.gitignore\u003C\u002Fcode>. If the file was ever committed, the secrets are in your git history and must be rotated whatever the working tree looks like now.\u003C\u002Fp>\n\u003Ch3>5. Prefer injected configuration\u003C\u002Fh3>\n\u003Cp>On a managed host, set configuration as environment variables in the platform instead of shipping a file at all. Then there is nothing on disk to expose.\u003C\u002Fp>","You are helping me fix a security misconfiguration on a website I own and operate.\n\nProblem: a .env file (or one of its variants) is publicly readable over HTTP, which exposes my application secrets.\n\nWork through the following in order. Stop and confirm with me before any destructive or irreversible step.\n\n1. Identify the stack and the framework in this repository, then tell me which directory the web server actually publishes (the document root) and how you concluded that.\n2. Find every environment file in the repository and in the deploy configuration: .env, .env.local, .env.production, .env.development, .env.backup, .env.bak, .env.save, and anything else matching .env*.\n3. Report which of those sit inside the published directory.\n4. List, by NAME ONLY, every secret these files contain. Never print, log, echo or copy a secret VALUE anywhere: not into a file, a commit message, a comment, or your own notes.\n5. Produce a rotation checklist: for each secret name, which provider it belongs to and where it gets rotated. I will do the rotating. Do not attempt to rotate anything yourself.\n6. Move configuration out of the published directory, or convert it to platform environment variables, and update whatever code reads it.\n7. Add a web server rule that denies all requests for paths beginning with a dot. Detect whether this project uses nginx, Apache, Caddy, or a managed host, and write the rule for that one only.\n8. Make sure .gitignore excludes every .env* file, except .env.example.\n9. Check whether an environment file was ever committed, using: git log --all --full-history -- '*.env*'. If it was, say so plainly and tell me that rotation is mandatory because the secrets remain in history.\n10. Create or update .env.example containing the key names with empty values, so the required configuration stays documented.\n\nFinish with a summary of what you changed and a list of everything I still have to do by hand.",[72],{"label":47,"href":48},1795449486708]