This vulnerability occurs when a web application transmits sensitive cookies over an HTTPS connection but fails to set the 'Secure' attribute on those cookies.

When a cookie is marked with the 'Secure' attribute, browsers guarantee it will only be sent over encrypted HTTPS connections. If this attribute is missing, even if the application initially uses HTTPS, the browser may inadvertently send the sensitive cookie over an unencrypted HTTP request. This often happens during redirects, when loading mixed content, or if a user manually types an HTTP URL, exposing session tokens or authentication data to interception. To prevent this, developers must explicitly set the 'Secure' flag for all cookies containing sensitive information in their application code. This is a critical server-side configuration that should be part of a standard secure cookie policy, alongside other attributes like 'HttpOnly' and 'SameSite'. Relying solely on HTTPS for the initial transmission is not sufficient; the 'Secure' attribute provides an essential enforcement layer at the browser level.
Impact: Read Application Data
Omitting the secure flag makes it possible for the user agent to send the cookies in plaintext over an HTTP session.
java