Safeguard
Application Security•

CWE-1099 Inconsistent Naming Conventions for Identifiers

CWE-1099 is code and docs that name variables, functions and files in different styles. It slows reviewers down and lets misreadings through.

Safeguard Security Team
2 min read

CWE-1099, Inconsistent Naming Conventions for Identifiers, describes a product whose code, documentation or other artifacts do not use the same naming conventions consistently for variables, callables, groups of related callables, I/O capabilities, data types, file names and similar elements.

MITRE marks it as a quality issue with no direct security implications and prohibits it for mapping real vulnerabilities.

How it happens

Naming drifts when many people contribute over years. One module uses getUserName, another fetch_username, a third usr_nm. Booleans are isValid in one place and valid_flag in another. File names mix cases and separators.

# Smell: three names for the same idea
def check_auth(u): ...
def verifyUser(user): ...
def is_allowed_login(usr): ...

A reader cannot tell whether these do the same thing, whether one is stricter, or which one a new endpoint should call. That ambiguity is where the wrong function gets picked.

What an attacker gains

Nothing directly. MITRE lists reduced maintainability and increased analytical complexity, with the indirect effect of making vulnerabilities harder and slower to find and fix. Security checks with unclear names are especially easy to call wrongly or skip.

How to find it

MITRE lists automated static analysis as a detection method. Linters have naming rules for most languages. A quick manual check is to search for the same concept under several spellings.

How to fix it

  1. Write a short naming guide: case style, prefixes, how booleans and errors are named.
  2. Enforce it with a linter and a formatter in CI.
  3. Rename in small, tested steps, using editor refactoring tools.
  4. Give security checks distinct, honest names, such as require_admin rather than check.

Try it yourself

See how a static scan reports code quality and security findings together.

Click through it at your own pace, or open it full screen.

Quick check

How can naming affect security?

Unclear or inconsistent names make it easier to call the wrong check, or to skip one, during development and review.

Sources

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.