TL;DR: Plaintext secrets in source code repositories remain a common problem, Orca Security reported, with 85% of organizations affected. Git workflows need enforceable checks at commit and push time because shared history can preserve credential material after exposure.
Editorial analysis by NHI Mgmt Group, based on content published by Orca Security: “Git Hooks: Prevent Secrets Exposure with Pre-Commit and Pre-Receive Protection”.
By the numbers:
- 85% of organisations have plaintext secrets embedded in source code repositories.
Key questions
Q: Why do plaintext secrets in source code create a broader access risk than the repository itself?
A: Because many secrets authenticate systems outside Git, including service accounts, APIs, workloads, and cloud resources.
Q: What are the signs that secret detection controls are not working in Git?
A: Repeated secret discoveries after commits, inconsistent enforcement across teams, bypassed local hooks, and secrets still appearing in shared repositories all indicate control failure.
Q: What is the first step when plaintext secrets are found in Git workflows?
A: Stop the secret before it is committed or pushed, because once it reaches shared history, cleanup becomes incomplete and copies may already exist in clones, mirrors, or caches.
Practitioner guidance
- Implement pre-commit secret detection Run secret scanning on the developer machine before a commit is finalized so plaintext credentials are blocked before they enter local history.
- Enforce pre-receive controls on the SCM server Reject pushes that contain API keys, tokens, passwords, or certificates even when local hooks are absent or bypassed.
- Treat repository cleanup as incomplete remediation Assume a secret may persist in clones, mirrors, cached data, or rewritten history after exposure, and do not rely on deletion alone.
Bottom line: Plaintext secrets in Git are a lifecycle failure because once they enter shared history, removal is uncertain and replication may already have occurred.
Glossary terms: Plaintext Secret, Pre-commit Hook, Pre-receive Hook, Secrets Leakage
Explore further
View Full Forum → | NHI Foundation Course → | Our Services → | Read the full analysis →
Secret exposure is a lifecycle problem, not a scan problem. The article is about preventing secrets from ever entering shared Git history, which is the point where cleanup becomes uncertain and control weakens. Once a secret is propagated into repository clones, mirrors, or caches, the organisation no longer owns the full copy set. Practitioners should treat source control as part of the credential lifecycle, not merely a code review system.
A few things that frame the scale:
- Internal repositories are 6x more likely to contain secrets than public ones (32.2% vs 5.6%), contradicting the assumption that private repos are safe, according to the State of Secrets Sprawl 2026.
A question worth separating out:
Q: How should security teams implement secrets management across distributed environments?
A: Security teams should centralise governance, maintain a complete inventory of secret stores, and map each secret to its workload consumers before changing rotation or access policy. The goal is to make every secret traceable from creation to revocation, including CI/CD, runtime, and vault locations. Without that inventory, policy changes create blind spots instead of control.
👉 Read our full editorial: Git hooks reduce plaintext secret exposure in source code repositories