Infraloka Logo
Professional Blacklist: personal dispute documentation
Data LeakGit SecuritySecrets ManagementHak Jawab

What a Public Repository Can Reveal: Commit Emails and Hard-Coded Credentials

Header illustration: three things a public repository can reveal, shown with invented example values

A teaching post. Every repository name, email address, host and password below is invented, on reserved example domains. None of it is taken from a real project, person or employer.

RAHMAT WIBOWO | 28 NOVEMBER 2026


Why this post uses invented examples

Company data leaks on social media and public repositories explains what counts as company data and what Article 444 KUHP says. This post shows what the problem looks like on screen.

A real example would teach the same lesson, but it would do two other things. It would point at one identifiable person, and it would repeat a credential that may still work. Neither is needed to learn the lesson, so the examples here are made up. Where a domain appears it is a reserved one (.example), which cannot belong to anyone.

Exhibit 1: the repository listing

sample-org / demo-api                     Public
main · 1 Branch · 0 Tags

node_modules        initial commit
src                 initial commit
.DS_Store           initial commit
.gitignore          add gitignore
package.json        initial commit
server.js           fix config

This repository doesn't have a README yet.

What a reader can take from this, and what they cannot:

  • node_modules is committed. Generated dependencies are in version control. A .gitignore added in a later commit does not remove files that were already committed: it only affects files git is not yet tracking.
  • .DS_Store is committed. It is harmless macOS folder metadata, but it shows that no ignore rules existed at the start.
  • No README. Nobody has written down what the project is, which is common for practice and personal projects.
  • None of this is wrongdoing. It is housekeeping. It says nothing about whether the code belongs to anyone other than its author.

Exhibit 2: commit metadata

commit 3f2a9c1e5b7d4a08c6e1f2b93d4a7e5c0b8d1a2f (HEAD -> main, origin/main)
Author: Sample Dev <sample.dev@company.example>
Date:   Mon Jan 15 09:30:00 2024 +0700

    fix config

Every commit stores an author name and email taken from the local git configuration, and that identity stays attached to the commit for as long as it exists. If a work address is set globally and a personal project is then pushed, the public history links the project to the employer's domain.

What follows from that:

  • It can make it look as if the employer is connected to the project, when it may not be.
  • The address can be collected by scrapers.
  • Deleting a file later does not change the history that already carries the address.

Be careful about what it proves. A work email in a commit proves only that someone configured that address. It does not show that the employer knew about, approved or owns the code. Whether a project belongs to an employer depends on the employment contract, the policy and the facts, not on an email domain.

How to avoid it:

  • Set the identity per repository: git config user.email "you@personal.example".
  • Use directory-based identities, so everything under ~/work/ uses the work address and everything else does not:
# ~/.gitconfig
[user]
    email = you@personal.example
[includeIf "gitdir:~/work/"]
    path = ~/.gitconfig-work
  • On GitHub, use the private noreply address and turn on the setting that blocks pushes that would expose your email.

Exhibit 3: a hard-coded credential

const config = {
  host: 'db.internal.example',
  port: 5432,
  database: 'sampledb',
  user: 'app_user',
  password: 'example-password-123',
  ssl: false,
};

Three separate problems sit in this one block:

  1. A secret in source code. It travels into every clone and every fork, and it stays in the history after the line is deleted.
  2. ssl: false. Traffic to the database is not encrypted.
  3. A database host that the internet can reach. A leaked password is dangerous mainly when the database accepts connections from anywhere. If network access is restricted, a leaked password alone is much less useful.

Two cautions about reading an exhibit like this:

  • Whether a credential still works is known only to its owner. A credential in an old commit may have been rotated, and the server may have been shut down long ago.
  • Do not test it. Trying to log in with a credential that is not yours can count as unauthorised access under the ITE Law, whatever your reason for trying.

How to avoid it: read credentials from environment variables or a secrets manager, add .env to .gitignore before the first commit, give each environment its own credentials, and restrict database access to the networks that need it.

If you are the author: what to do, in order

  1. Treat the credential as exposed, and rotate or revoke it first. Deleting the file is not enough, because copies and caches may already exist.
  2. Restrict network access to the database or service.
  3. Remove the secret from the code and load it from the environment instead.
  4. Clean the history with a tool such as git filter-repo. This is a second line of defence, not a substitute for step 1.
  5. Fix the commit identity going forward, as in Exhibit 2.
  6. Stop tracking generated files: git rm -r --cached node_modules, with node_modules listed in .gitignore.
  7. Turn on secret scanning and push protection where your host offers them, and run a scanner such as gitleaks before each commit.
  8. If the credential was your company's, tell its security contact. Only the company can judge what must stay confidential and whether it needs to act.

If you are the one who found it

  • Do not log in or test it.
  • Do not copy the secret into a post, a chat or a screenshot that you publish, even partly. Publishing a live credential extends the exposure.
  • Report it privately: to the owner, to the platform's reporting mechanism, or to the company's security contact if there is one.
  • Keep a dated capture for your own records, and share it only with the people who need to act on it.
  • Do not name the person in public. A public post turns a housekeeping lapse into an accusation, and keeps the secret live while it is read.
  • Do not present it as proof of an offence. Whether information was meant to be kept confidential, and whether to complain under Article 444 KUHP, is a decision for the company's management. The elements are set out in the earlier post.

What this post is not

  • It is not about any real repository, account, person or employer.
  • It is not a claim that anyone leaked company data.
  • It is not legal advice.

Right of reply and correction policy

A substantive response may be published alongside this article, subject to reasonable editing for privacy, safety and relevance. If reliable evidence shows a factual statement here is wrong, I will correct it promptly and note the change.

Other posts in this series

Published by Rahmat Wibowo at InfraLoka: infraloka.co.id

#DataLeak #GitSecurity #SecretsManagement #HakJawab