Project

General

Profile

Actions

Bug #76347

closed

Clarify description of [*][cookieSecure] and [BE][fileDenyPattern]

Added by Helmut Hummel almost 8 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Should have
Category:
Security
Target version:
-
Start date:
2016-05-28
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Original (German) description

Die Beschreibung für die Konfiguration von [SYS][cookieSecure] ist nicht eindeutig und verständlich genug um eine sichere Konfiguration vornehmen zu können.

Integer (0, 1, 2): Indicates that the cookie should only be transmitted over a secure HTTPS connection from the client.

0 always send cookie

1 (force HTTPS) the cookie will only be set if a secure (HTTPS) connection exists - use this in combination with lockSSL since otherwise the application will fail and throw an exception

2 the cookie will be set in each case, but uses the secure flag if a secure (HTTPS) connection exists.

Betrachtet man den Code hinter dieser Konfiguration ergibt sich folgende Interpretation des Parameters [SYS][cookieSecure]:

[SYS][cookieSecure]

HTTP-Verbindung

HTTPS-Verbindung

0

Cookie wird ohne secure gesetzt

Cookie wird ohne secure gesetzt

1

Es wird kein Cookie gesetzt

Cookie wird mit secure gesetzt

2

Cookie wird ohne secure gesetzt

Cookie wird mit secure gesetzt

Die sicherste Konfiguration wäre also [SYS][cookieSecure] = 1

Hierdurch wird auch sichergestellt, dass das Cookie bei einer HTTP-Verbindung erst gar nicht zum Benutzer gesendet wird.

PHP-Code:

typo3/sysext/core/Classes/Authentication/AbstractUserAuthentication.php


                       $cookieSecure
                          = (bool)$settings['cookieSecure'] &&
                          GeneralUtility::getIndpEnv('TYPO3_SSL');

                       //
                          Deliver cookies only via HTTP and prevent possible XSS by
                          JavaScript:

                       $cookieHttpOnly
                          = (bool)$settings['cookieHttpOnly'];

                       // Do
                          not set cookie if cookieSecure is set to "1" (force
                          HTTPS) and no secure channel is used:

                       if
                          ((int)$settings['cookieSecure'] !== 1 ||
                          GeneralUtility::getIndpEnv('TYPO3_SSL')) {

                           setcookie($this->name,
                          $this->id, $cookieExpire, $cookiePath, $cookieDomain,
                          $cookieSecure, $cookieHttpOnly);

                           $this->cookieWasSetOnCurrentRequest
                          = true;

                       } else
                          {


Risikofaktor: Leicht

Maßnahme:

Es sollte in der Beschreibung zu dieser Konfiguration klarer herausgestellt werden, welche Unterschiede bestehen und welche Einstellung welches Sicherheitsniveau aufweist.

Ungenaue Beschreibung für [BE][fileDenyPattern]
Betroffenes Modul: Typo3 Core

Beschreibung:

Die Konfiguration [BE][fileDenyPattern] ist mit folgendem Text beschrieben:

A perl-compatible regular expression (without delimiters!) that - if it matches a filename - will deny the file upload/rename or whatever in the webspace. For security reasons, files with multiple extensions have to be denied on an Apache environment with mod_alias, if the filename contains a valid php handler in an arbitrary position. Also, ".htaccess" files have to be denied. Matching is done case-insensitive. Default value is stored in constant FILE_DENY_PATTERN_DEFAULT

Diese Beschreibung ist zu ungenau und erweckt falsche Eindrücke der Sicherheit. Man könnte annehmen, dass es generell nicht möglich ist Dateien hochzuladen, die diesem Pattern entsprechen. Allerdings ist es einem Administrator generell erlaubt alle Dateien hochzuladen (siehe 6.1.2.2). Zudem bleibt offen, dass Upload-Funktionen von Extensions nicht dieser Regel unterliegen außer sie implementieren Sie explizit.

Der Satz "For security reasons, files with multiple extensions have to be denied on an Apache environment with mod_alias, if the filename contains a valid php handler in an arbitrary position." kann nicht eindeutig interpretiert werden. Konkrete Handlungsanweisungen sollten hier beschreiben werden, welche Einstellung im Apache vorgenommen werden sollten.

Risikofaktor: Leicht

Maßnahme:

Die Beschreibung des Parameters sollte hinsichtlich einer klaren Abgrenzung und höherem Verständnis angepasst werden.

Actions #1

Updated by Helmut Hummel almost 8 years ago

  • Assignee deleted (Helmut Hummel)
Actions #2

Updated by Daniel Siepmann about 4 years ago

  • Assignee set to Daniel Siepmann
Actions #3

Updated by Gerrit Code Review about 4 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63649

Actions #4

Updated by Daniel Siepmann about 4 years ago

Regarding "cookieSecure" I can not find the German description anywhere. The currently used English description states that =1 is the only way to set the cookie only in secure ways.

Actions #5

Updated by Gerrit Code Review about 4 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63649

Actions #6

Updated by Gerrit Code Review about 4 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63649

Actions #7

Updated by Gerrit Code Review about 4 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63649

Actions #8

Updated by Daniel Siepmann about 4 years ago

  • Status changed from Under Review to Closed

Accordingly to discussion in patch set, this is already solved and there is no need for further changes.

Actions

Also available in: Atom PDF