TL;DR: A 2025 cloud security report cited by Orca Security found that 85% of organizations have plaintext secrets embedded in source code repositories, making exposed Git history a durable access path for attackers. Secrets caught before commit or push reduce blast radius, but governance still depends on preventing credential material from reaching shared repositories in the first place.
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: 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.
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.
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.
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