Project

General

Profile

Actions

Support #11953

closed

überall absolue anstatt relative pfade verwenden für Filesystem pfade

Added by Marc Egger about 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Marc Egger
Target version:
Start date:
05.02.2021
Due date:
% Done:

0%

Estimated time:
Discuss:
Prio Planung:
Vote:

Description

anstatt cwdToApp zu setzen bei jedem Entrypoint, setzen wir absolutApp in Path:setMainPaths
Somit sind wir nicht mehr abhängig von dem CWD oder der art und weise wie ein Entrypoint aufgerufen wird.
Speziell für Unittests sollte dies eine grosse erleichterung sein.


Related issues

Related to QFQ - Support #11926: Anmerkungen zu FormAsFileClosedMarc Egger31.01.2021

Actions
Actions #1

Updated by Marc Egger about 3 years ago

Actions #2

Updated by Marc Egger about 3 years ago

Security Check realpath : to prevent certain attacks we could use the PHP function realpath() on all absolute paths before accessing the file and make sure that the path is inside our App directory.

Problem: the file must exist, otherwise realpath() returns false. In many places in our code we construct an absolute path to a file or folder which might not exist and if it doesn't, it is created. Therefore we cannot use this simple check here.

Out of all 47 places where an absolute path is computed most of them are concatenations of path constants which do not pose a security risk. There is only one dynamic path where we access a file which must exist: When we execute a script using the _script column. But the realpath check would only give a small security benefit here, since the path to the script is never user generated.

A much simpler security feature would be to disallow double dots /../ in user generated paths. Of the 47 places where absolute paths are computed there is not one which would need to allow /../

Actions #3

Updated by Carsten Rose about 3 years ago

  • Gerade bei den Scripts koennte es gewuenscht sein sowohl mit '..' als auch ausserhalb des App Dirs zu arbeiten.
  • Auf den I-MATH Server liegen viele Scripts, die von QFQ getriggert werden, unter `/etc/scripts` - das ist sinnvoll da man so nicht identische Scripts an mehreren Stellen hat. Also Einschraekung auf 'App Dir' ist keine gute Ueberlegung.
  • Andere Admins setzen ihr System anders auf. Ggfs. benoetigen Sie '..' - wenn realpath() 'on the fly' die Pfade anpasst, haette ich noch wenig Sorgen, aber '..' zu verbieten laesst bei uns das Telefon klingeln ...

D.h. wir koennen diese Sicherheits Intitiative vermutlich abbrechen.

Actions #4

Updated by Marc Egger about 3 years ago

ok, lassen wirs.

Habe schon eine Funktion geschrieben, die testet ob '..' vorkommt in einem Pfad. Lasse die mal drin. vielleicht brauchen wir sie mal. siehe commit 86697ebb

Actions #5

Updated by Marc Egger about 3 years ago

  • Status changed from New to In Progress
Actions #6

Updated by Carsten Rose about 3 years ago

  • Target version changed from next5 to 21.3.0

Kann das Ticket geschlossen werden?

Actions #7

Updated by Marc Egger about 3 years ago

  • Status changed from In Progress to Closed

ja

Actions

Also available in: Atom PDF