This vulnerability occurs when software sets an internal variable to an insecure or unnecessarily weak default value during initialization, rather than using the most secure option available.
Insecure default initialization happens when a developer or framework assigns a starting value to a variable that is inherently vulnerable. Common examples include enabling debug modes, using weak cryptographic keys, granting excessive permissions, or turning security features off by default. This creates a hidden security gap because the system starts in a weakened state, often without the administrator or end-user being aware that they need to change a setting to be secure. To prevent this, developers should adopt a 'secure by default' design principle. This means the initial configuration should be the most restrictive and safest possible, requiring explicit action to loosen security, not the other way around. Always validate that security-critical variables like encryption settings, authentication flags, and privilege levels are initialized to their strongest values, and ensure documentation clearly warns against using insecure defaults.
Impact: Modify Application Data
An attacker could gain access to and modify sensitive data or system information.
// $user and $pass automatically set from POST request* if (login_user($user,$pass)) { ``` $authorized = true; }
phpphp
...*