extension: validate base name to prevent path traversal on installThe extension base name flowed unsanitized from an uploaded archive'splugin.info.txt (or an extension id) into getInstallDir(), wh
extension: validate base name to prevent path traversal on installThe extension base name flowed unsanitized from an uploaded archive'splugin.info.txt (or an extension id) into getInstallDir(), wherefullpath() collapses '..' segments. A crafted base such as'../../../../evil' therefore resolved outside lib/plugins/, lettingdircopy() write the archive contents to an arbitrary web-writable path.Route every base assignment through a new setBase() that rejectsanything other than a bare extension name.Note: this is not really a security concern since plugins can executearbitrary code by design. The is mostly to make sure, plugin code is notinstalled accidentally at the wrong location.
show more ...
ExtensionManager: get base from plugin classes. fixes #4484When installing a plugin that has no plugin.info.txt, we need to figureout where it belongs from other data. Previously we checked the ar
ExtensionManager: get base from plugin classes. fixes #4484When installing a plugin that has no plugin.info.txt, we need to figureout where it belongs from other data. Previously we checked the archivename or folder within. This will fail for archives generated from githubbranches as the plugin would be named "dokuwiki-plugin-foobar" or "master".This implements looking for known plugin type php files, parsing themwith PHP's parser and extracting the class name. The base name is inthat class name.Seems to work fine in my unit and manual tests.
Extension Manager: updated tests
added tests for the find_folders method