This vulnerability occurs when an application uses cookies to make security decisions—like granting access or changing settings—but fails to verify that the cookie data is legitimate, unaltered, and belongs to the current user.

Cookies are often used to store session identifiers, user preferences, or state information, but they are controlled by the client's browser. When an application blindly trusts cookie values without validating their integrity or checking if they match the authenticated user's session, attackers can forge or manipulate cookies to impersonate other users, escalate privileges, or bypass security controls. To prevent this, developers should treat all client-side data, including cookies, as untrusted input. Implement server-side validation for any cookie used in security decisions, use cryptographically signed or encrypted cookies to prevent tampering, and bind session cookies to specific user attributes (like IP address or user agent) to detect session hijacking attempts.
Impact: Modify Application DataExecute Unauthorized Code or Commands
Attackers can easily modify cookies, within the browser or by implementing the client-side code outside of the browser. Reliance on cookies without detailed validation and integrity checking can allow attackers to bypass authentication, conduct injection attacks such as SQL injection and cross-site scripting, or otherwise modify inputs in unexpected ways.
Impact: Gain Privileges or Assume Identity
It is dangerous to use cookies to set a user's privileges. The cookie can be manipulated to escalate an attacker's privileges to an administrative level.
java