🎄 Join our Annual Holiday wargame and win prizes!


Insufficient Credential Hygiene

CI/CD pipelines often rely on credentials such as API keys, SSH keys, cloud tokens, or service account secrets to fetch dependencies, deploy artifacts, or interact with external services. Insufficient credential hygiene arises when these secrets are hard-coded in configuration files, stored in plaintext, over-privileged, or left unrotated. An adversary who gains access to the pipeline environment (e.g., via logs, cache, or a compromised job) can extract these credentials and pivot into sensitive systems, leading to source code theft, supply chain attacks, or full infrastructure compromise.

Remediation

  • Store credentials in a secure secret management system (e.g., HashiCorp Vault, AWS Secrets Manager, Kubernetes Secrets) instead of embedding them in pipeline code or environment variables.
  • Apply least-privilege to all credentials — scope keys/tokens only to the actions required for that pipeline stage.
  • Rotate credentials regularly and revoke them immediately if exposure is suspected.
  • Avoid logging or exposing secrets; enable secret masking features in CI/CD platforms to prevent leaks in logs.
  • Use ephemeral credentials (short-lived tokens or OIDC-based workload identity) instead of long-lived static keys.
  • Monitor for unused, stale, or over-privileged credentials in pipeline environments.

Metadata

  • Severity: medium
  • Slug: insufficient-credential-hygiene

CWEs

  • 497: Exposure of Sensitive System Information to an Unauthorized Control Sphere
  • 200: Exposure of Sensitive Information to an Unauthorized Actor

OWASP

  • CICD-SEC-6: Insufficient Credential Hygiene
  • LLM02:2025: Sensitive Information Disclosure
  • A03:2017: Sensitive Data Exposure

Available Labs

Select a language to explore available labs for this vulnerability.

No matching labs found

Try adjusting your language filter.

Deco line
Deco line

Play AppSec WarGames

Want to skill-up in secure coding and AppSec? Try SecDim Wargames to learn how to find, hack and fix security vulnerabilities inspired by real-world incidents.

Deco line
Deco line

Got a comment?

Join our secure coding and AppSec community. A discussion board to share and discuss all aspects of secure programming, AppSec, DevSecOps, fuzzing, cloudsec, AIsec code review, and more.

Read more