Skip to content

Commit ecf44d1

Browse files
authored
Security - Fix (hestiacp#2784)
Fix for Information disclosure vulnerability
1 parent 6242752 commit ecf44d1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

web/inc/2fa/secret.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<?php
22

3+
session_start();
4+
if ((isset($_SESSION['userContext']) === False) && (php_sapi_name() !== 'cli')) exit;
5+
36
require_once '/usr/local/hestia/web/inc/2fa/loader.php';
47
Loader::register('./','RobThree\\Auth');
58

@@ -10,4 +13,4 @@
1013
$secret = $tfa->createSecret(160); // Though the default is an 80 bits secret (for backwards compatibility reasons) we recommend creating 160+ bits secrets (see RFC 4226 - Algorithm Requirements)
1114
$qrcode = $tfa->getQRCodeImageAsDataUri(gethostname(), $secret);
1215

13-
echo $secret . "-" . $qrcode;
16+
echo $secret . "-" . $qrcode;

0 commit comments

Comments
 (0)