Skip to content
goTool Español

Solutions · WordPress

www.ejemplo.com: a copy of wp-config.php can be downloaded

With example names (mi-app, /ruta/al/proyecto). In GoTool, in 🛡 Security, this page shows your project's: your container, your compose file, your WordPress folder.

What's happening

A copy of wp-config.php with another extension (.bak, .old, ~…) answers with its contents.

Why it matters

It holds the database password and the session keys, for anyone. A .php is executed; its copy with another extension is downloaded.

What to do

  1. Find them and delete them (in the WordPress folder):
    ls -la wp-config* .wp-config*
    rm wp-config.php.bak   # la que sea
  2. Change the database password (in the database and in wp-config.php) and the session keys:
    wp config shuffle-salts
  3. And block it in nginx:
    location ~* wp-config { deny all; }

How to know it's fixed

  • It must answer 403 or 404:
    curl -sI https://www.ejemplo.com/wp-config.php.bak | head -1

More

CWE-530 · MITRE ATT&CK T1552.001

In GoTool, the file with the issue (the Dockerfile, the compose file) is also shown with the solution next to it, and the question for Claude comes ready, with your project's details and without your keys, to paste into your claude.ai.

Ask us for a demo