Enable secure flag for authentication cookie in Login controller#109
Draft
semgrep-code-badoo[bot] wants to merge 1 commit into
Draft
Enable secure flag for authentication cookie in Login controller#109semgrep-code-badoo[bot] wants to merge 1 commit into
semgrep-code-badoo[bot] wants to merge 1 commit into
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enable the secure flag for the authentication cookie to prevent transmission over unencrypted connections.
Changes
secureparameter fromfalsetotruein thesetcookie()call inLogin.phpWhy
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 totrueensures 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.