Skip to content
vetkitChecksChangelogDocumentation

vetkit.swift.crypto.hardcoded-key

A symmetric encryption or MAC key is a string literal in source code. Anyone with the app binary can extract it and decrypt or forge the protected data.

Last updated:

Suite: Security

swift

A symmetric encryption or MAC key is a string literal in source code. Anyone with the app binary can extract it and decrypt or forge the protected data.

Category: SECURITY · Engine rule severity: ERROR

How to fix it

Generate keys at runtime (SymmetricKey(size: .bits256)) and store them in the Keychain or Secure Enclave; derive server-shared keys through a key exchange.

References

Source: packages/engine/rules/sast/swift.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.