BaseDraft

CWE-547Use of Hard-coded, Security-relevant Constants

Category: other

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· 1

  • Other — Varies by Context, Quality Degradation, Reduce Maintainability
    The existence of hardcoded constants could cause unexpected behavior and the introduction of weaknesses during code maintenance or when making changes to the code if all occurrences are not modified. The use of hardcoded constants is an indication of poor quality.

Potential mitigations· 1

  • [Implementation]Avoid using hard-coded constants. Configuration files offer a more flexible solution.

References

  1. https://cwe.mitre.org/data/definitions/547.html

(incoming)2

TypeTargetConfidenceTier
VulnerabilityCVE-2025-30206cve-2025-302060%live
VulnerabilityCVE-2026-28256cve-2026-282560%live

Related by meaning· 6

Nearest entities by semantic similarity across the cs-graph corpus.

CWE
Use of Hard-coded Password
CWE
Use of Hard-coded Credentials
CWE
Use of Hard-coded Cryptographic Key
CWE
Lack of Administrator Control over Security
CWE
Exposure of Sensitive System Information to an Unauthorized Control Sphere
CWE
Use of Default Credentials
Sourced from MITRE CWE 4.20. Curated for EU compliance use cases by Adam Lundqvist, Founder at SQUR.