mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-27 04:10:30 +08:00
Fixes #1634: Use masked CSRF tokens to prevent BREACH exploits
This commit is contained in:
@@ -388,7 +388,7 @@ class View extends \yii\base\View
|
||||
$request = Yii::$app->getRequest();
|
||||
if ($request instanceof \yii\web\Request && $request->enableCsrfValidation) {
|
||||
$lines[] = Html::tag('meta', '', ['name' => 'csrf-var', 'content' => $request->csrfVar]);
|
||||
$lines[] = Html::tag('meta', '', ['name' => 'csrf-token', 'content' => $request->getCsrfToken()]);
|
||||
$lines[] = Html::tag('meta', '', ['name' => 'csrf-token', 'content' => $request->getMaskedCsrfToken()]);
|
||||
}
|
||||
|
||||
if (!empty($this->linkTags)) {
|
||||
|
||||
Reference in New Issue
Block a user