CWE Database
/

CWE-547

Back to CWE list

CWE-547

Use of Hard-coded, Security-relevant Constants

Base
Draft

Description

The product uses hard-coded constants instead of symbolic names for security-critical values, which increases the likelihood of mistakes during code maintenance or security policy change.

If the developer does not find all occurrences of the hard-coded constants, an incorrect policy decision may be made if one of the constants is not changed. Making changes to these values will require code changes that may be difficult or impossible once the system is released to the field. In addition, these hard-coded values may become available to attackers if the code is ever disclosed.

Common Consequences

Scope

Other

Impact

Varies by Context, Quality Degradation, Reduce Maintainability

Potential Mitigations

Implementation

Avoid using hard-coded constants. Configuration files offer a more flexible solution.

Applicable Platforms

Not Language-Specific

Security Training

Train your team to recognize and prevent security threats with our comprehensive security awareness program.

Start Training

Vulnerability Scanning

Discover vulnerabilities in your applications and infrastructure before attackers do.

Scan Now