Skip to content
vetkitChecksChangelogDocumentation

vetkit.csharp.crypto.hardcoded-key

A symmetric encryption key is a constant in source code. Anyone who can read the code or the compiled assembly can decrypt the data.

Last updated:

Suite: Security

csharp

A symmetric encryption key is a constant in source code. Anyone who can read the code or the compiled assembly can decrypt the data.

Category: SECURITY · Engine rule severity: ERROR

How to fix it

Load keys from a key-management service or protected configuration (Data Protection API, Key Vault) and rotate the exposed key.

References

Source: packages/engine/rules/sast/csharp.yml.

Generated from shipped rule definitions at build time. Matching is a review signal, not proof of exploitability. “generic” denotes text matching, not complete language or framework coverage. Runtime configuration and available tools affect whether a rule runs.