Skip to content

Enable secure flag for authentication cookie in Login controller#109

Draft
semgrep-code-badoo[bot] wants to merge 1 commit into
masterfrom
semgrep-autofix/1779886216
Draft

Enable secure flag for authentication cookie in Login controller#109
semgrep-code-badoo[bot] wants to merge 1 commit into
masterfrom
semgrep-autofix/1779886216

Conversation

@semgrep-code-badoo
Copy link
Copy Markdown

Enable the secure flag for the authentication cookie to prevent transmission over unencrypted connections.

Changes

  • Changed the secure parameter from false to true in the setcookie() call in Login.php

Why

The secure flag was explicitly set to false, which allowed the authentication cookie containing session tokens to be transmitted over unencrypted HTTP connections. This creates a risk of session token theft via man-in-the-middle attacks. Setting the secure flag to true ensures the cookie is only sent over HTTPS connections.

Semgrep Finding Details

Secure cookie flag is explicitly disabled. This will cause cookies to be transmitted over unencrypted HTTP connections which can allow theft of confidential user data such as session tokens.

apostolos.gioulis@team.bumble.com requested this Autofix PR for this finding from the detection rule php.lang.security.taint-cookie-secure-false.taint-cookie-secure-false.


⚠️ Review carefully before merging. This PR was generated by AI and may cause breaking changes or introduce new vulnerabilities.

Enable the secure flag for the authentication cookie to prevent transmission over unencrypted connections.

## Changes
- Changed the `secure` parameter from `false` to `true` in the `setcookie()` call in `Login.php`

## Why
The secure flag was explicitly set to `false`, which allowed the authentication cookie containing session tokens to be transmitted over unencrypted HTTP connections. This creates a risk of session token theft via man-in-the-middle attacks. Setting the secure flag to `true` ensures the cookie is only sent over HTTPS connections.

## Semgrep Finding Details
Secure cookie flag is explicitly disabled. This will cause cookies to be transmitted over unencrypted HTTP connections which can allow theft of confidential user data such as session tokens.

apostolos.gioulis@team.bumble.com requested this Autofix PR for [this finding](https://semgrep.dev/orgs/bmbl/findings/283858733) from the detection rule [php.lang.security.taint-cookie-secure-false.taint-cookie-secure-false](https://semgrep.dev/r/php.lang.security.taint-cookie-secure-false.taint-cookie-secure-false).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants