Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Snyk Code security rules

How Snyk Code security rules work and how they are updated

Snyk Code rules are updated continuously. The list expands continually, and the rules may change to provide the best protection and security solutions for your code.

This page lists all security rules used by Snyk Code when scanning your source code for vulnerabilities.

Each rule includes the following information.

  • Rule Name: The Snyk name of the rule.

  • Languages: The programming languages to which this specific rule applies. Note that there might be two rules with the same name that apply to different languages.

  • CWEs: The CWE numbers the rule covers.

  • Security Categories: The OWASP Top 10 (2025 edition) category the rule maps to, when applicable. This column also notes whether the rule appears in the CWE Top 25, and any applicable OWASP API Security Top 10 (2023) or OWASP Mobile Top 10 (2024) categories.

* XML listed in the language column applies only to NuGet XML files.

How Snyk Code secret detection works

Snyk Code secret detection is part of Snyk Code SAST. It is a separate capability from Snyk Secrets, which is a dedicated secrets scanner with its own engine and findings.

The Snyk Code rules report hardcoded secrets and credentials in these cases:

  • A hardcoded user name, password, or key assigned to a variable, field, or argument whose name indicates a credential, for example username, password, or key.

  • A secret with a known format, such as an AWS or GitHub key, matched by a regular expression.

  • A hardcoded string passed as a credential argument to a method, for example the user name and password arguments of a database connection call.

The rules match on the name and the shape of the code, and they check the value, for example its length.

Snyk Code scans source code files in supported languages. Findings appear as Hardcoded Secret or Use of Hardcoded Credentials issues, with CWE-259, CWE-321, CWE-547, or CWE-798, depending on the rule. For the rules in each language, see the language pages in this section.

To scan all plain text files for secrets, use Snyk Secrets. To suppress a Snyk Code finding, see Consistent Ignores for Snyk Code.

Last updated

Was this helpful?