[WordPress] 外掛分享: SameSite Cookies

WordPress 外掛 SameSite Cookies 的封面圖片。

前言介紹

  • 這款 WordPress 外掛「SameSite Cookies」是 2019-05-01 上架。
  • 目前有 1000 個安裝啟用數。
  • 上一次更新是 2023-07-23,距離現在已有 649 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 6.2 以上版本才可以安裝。
  • 外掛要求網站主機運作至少需要 PHP 版本 7.0 以上。
  • 有 11 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

ayeshrajans |

外掛標籤

csrf | cookies | samesite | security |

內容簡介

該外掛為 WordPress 的驗證 Cookie 添加了「SameSite」Cookie 屬性。在支援的瀏覽器(所有目前的 IE、Edge、Chrome 和 Firefox)中,這可以有效地防止整個 WordPress 站點中的所有跨站點請求偽造攻擊。

SameSite Cookie 屬性在 PHP 7.3 版本中添加,但該外掛附帶了一個解決方案,以支援 WordPress 支持的所有 PHP 版本。

此外掛沒有提供管理 UI:啟用此外掛即可使用!

您可以從 WordPress 配置文件中配置 SameSite 屬性值。您可以從 Lax(默認值)、Strict 或 None 中選擇值。您可以在此閱讀有關 SameSite cookies 的相關資訊。

要配置 SameSite 屬性值,請在 WordPress 配置文件(wp-config.php)中編輯,並在 /** Sets up WordPress vars and included files. */ 上方加入以下行。

`php

define( ‘WP_SAMESITE_COOKIE’, ‘Lax’ ); // 從 ‘Lax’、‘Strict’ 或 ‘None’ 中選擇。
`

請注意,只有驗證 Cookie 會受到影響。而已安裝的外掛設定的常規 Cookie 不會受到影響,也不會提供任何具有意義的 SameSite 屬性值。

原文外掛簡介

This plugin adds the “SameSite” cookie flag to WordPress’s authentication cookies. On supported browsers (all current IE, Edge, Chrome, and Firefox), this can effectively prevent all Cross-Site Request Forgery attacks throughout your WordPress site.
SameSite cookie flag support was added to PHP on version 7.3, but this plugin ships with a workaround to support all PHP versions WordPress supports.
There is no administrative UI provided: Activate this plugin, and you are all set!
You can configure the SameSite flag value from your WordPress configuration file. You cna pick a value from Lax (default), Strict, or None. You can read about SameSite cookies here.
To configure the SameSite flag value, edit your WordPress configuration file (wp-config.php), and add the following lines right above /** Sets up WordPress vars and included files. */.
define( 'WP_SAMESITE_COOKIE', 'Lax' ); // Pick from 'Lax', 'Strict', or 'None'.

Note that only the authentication cookies are affected. Regular cookies that your installed plugins set will not be affected, nor provide any meaningful value with SameSite flags.

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「SameSite Cookies」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


1.0 | 1.1 | 1.2 | 1.4 | 1.5 | 2.0 | 2.1 | trunk |

延伸相關外掛(你可能也想知道)

  • Comment Form CSRF Protection 》WordPress有一個9年未解決的安全漏洞,它不能正確驗證傳入的評論。, 攻擊者可以欺騙匿名和已登入的使用者在受害者網站上張貼評論,而使用他們自己的憑據。, ...。
  • Anti CSRF 》跨站請求偽造 (CSRF) 漏洞是最著名的網站漏洞之一,可能已經存在太長時間,以致許多 WordPress 外掛(約70%)都存在此漏洞,包括本插件庫中的插件和其他地方...。
  • Headit 》這個外掛提供了在網站回應中添加 HTTP headers 的簡單方式。, 這些 headers 可以包括您的應用程式特定的自訂 headers,或者是安全相關的 headers。您可能希望...。
  • Secure User Registration by PureDevs 》總結:Secure User Registration 是一個可靠的安全解決方案,旨在保護標準和 WooCommerce 用戶註冊,防止 CSRF 攻擊和機器人註冊。它包括自定義 nonce 實施、...。

文章
Filter
Apply Filters
Mastodon