Skip to content
Info disclosure Write-up Intermediate

From Source Code Leak to Full Session Forgery: How Hardcoded Secr

A publicly exposed backup archive contained a configuration file with hardcoded production database credentials and a global encryption key. An attacker could use these secrets to access the database directly or forge signed session cookies to hijack administrative accounts.

M0stafaX404 Follow

Published on medium.com

During an authorized security assessment of an enterprise web application, a critical sensitive information disclosure vulnerability was identified. By analyzing a publicly exposed backup archive format (tar.gz) discovered during reconnaissance, the core configuration infrastructure files were retrieved.

M0stafaX404, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Impact

An attacker could gain full read/write access to the production database or forge administrative session cookies to hijack accounts, and potentially achieve remote code execution via PHP object injection.

What the attacker needed

Publicly accessible backup archive; ability to extract and read files; network access to database (for direct DB attack)

The fix

The report states the issue was fully remediated; recommended actions include rotating credentials, regenerating the encryption key, moving secrets to environment variables or a vault, and removing backup files from the web root.

How it was found

  1. Discover a publicly exposed backup archive (tar.gz) during reconnaissance.
  2. Extract the archive and locate the main configuration file app-config.php.
  3. Review the file to find hardcoded database credentials and the APP_ENC_KEY value.
  4. Use the leaked database credentials to connect directly to the production database (if network access is available).
  5. Use the leaked APP_ENC_KEY to forge a signed session cookie for an administrative user and submit it to the server.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A backup file left on the web server included a settings file that stored secret passwords and a key used to sign login cookies. Anyone who found the backup could read those secrets and use them to break into the database or create fake admin login cookies.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

More by M0stafaX404

View all

1 more disclosed report, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.