This vulnerability occurs when code directly embeds security-critical values like passwords, cryptographic keys, or access levels as raw numbers or strings, instead of using named constants or configuration files. This practice makes the code brittle and error-prone during updates or security reviews.
Hard-coding security values creates a maintenance nightmare. If a secret needs to be rotated or a permission level changed, developers must hunt through the entire codebase for every occurrence. Missing just one instance can introduce a security gap or break functionality. Once software is deployed, updating these embedded values often requires a full re-release, which may not even be possible in some environments. These constants also risk exposure if the code is ever leaked or reverse-engineered, turning a simple configuration change into a major breach. While SAST tools can flag the pattern, Plexicus uses AI to not only detect these hard-coded secrets but also suggest the specific code fix—like moving the value to a secure configuration manager—saving hours of manual refactoring and reducing human error.
Impact: Varies by ContextQuality Degradation
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.
cc