Skip to content

security: remove hardcoded Firebase database secret from settings - #59

Merged
hjemmel merged 1 commit into
masterfrom
security/remove-leaked-firebase-secret
Aug 11, 2026
Merged

hjemmel merged 1 commit into
masterfrom
security/remove-leaked-firebase-secret

Conversation

@hjemmel

@hjemmel hjemmel commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Summary

app/settings.php carried a hardcoded Firebase Realtime Database URL and legacy database secret. This removes them.

The config was dead. Nothing ever read settings['firebase'] — the only consumers of the settings array are:

  • settings['logger']app/dependencies.php:16
  • settings['displayErrorDetails']public/index.php:49

FirebaseTodoRepository builds its own credentials from $_SERVER['DOCUMENT_ROOT'].'/firebase-key.json' and $_ENV['DATABASE_URI'], so nothing depended on these values.

Verified: 38 tests / 72 assertions still pass.

⚠️ This does not un-leak the secret

The value was committed in the initial commit (3ef0f38, 2019-10-17) in a public repository, and has been reachable ever since. Merging this removes it from the tip, not from history, forks, clones, or anything that scraped the repo in the last ~7 years.

The key must be rotated in the Firebase console. Treat it as compromised. Rotation is the fix; deleting the line is housekeeping.

A history rewrite is possible but has real costs — see the discussion on this PR. It is a separate decision from rotation, and it is not a substitute for it.

🤖 Generated with Claude Code

The 'firebase' block in app/settings.php held a hardcoded Firebase
Realtime Database URL and legacy database secret. Nothing ever read
settings['firebase'] — the only consumers of the settings array are
settings['logger'] (app/dependencies.php) and settings['displayErrorDetails']
(public/index.php). FirebaseTodoRepository builds its own credentials from
$_SERVER['DOCUMENT_ROOT'].'/firebase-key.json' and $_ENV['DATABASE_URI'],
so this was dead configuration.

Deleting it does not un-leak the value: it was committed in the initial
commit (3ef0f38, 2019-10-17) in a public repository, so it must be treated
as compromised and rotated in the Firebase console regardless of whether
the git history is rewritten.

Verified: 38 tests / 72 assertions still pass.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@hjemmel
hjemmel merged commit 5c952a4 into master Aug 11, 2026
2 checks passed
@github-actions
github-actions Bot deleted the security/remove-leaked-firebase-secret branch August 11, 2026 09:39
hjemmel added a commit that referenced this pull request Aug 11, 2026
…ecret

security: remove hardcoded Firebase database secret from settings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant