Zum Inhalt springen

Hardcoded Secret (ARCH5110)

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

Key go.security.hardcoded-secret · Severity error · Category security · CWE CWE-798

Secrets, API keys, passwords, and private keys embedded as literals leak into version control and build artifacts. Once leaked, a secret can be abused until it is rotated.

const apiKey = "sk_live_4eC39HqLyjWDarjtT1zdp7dc"
client := stripe.New(apiKey)
apiKey := os.Getenv("STRIPE_API_KEY")
client := stripe.New(apiKey)

Load secrets from environment variables or a secret manager; never embed literals in source.