GHSA-qm58-cvvm-c5qr

Suggest an improvement
Source
https://github.com/advisories/GHSA-qm58-cvvm-c5qr
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2021/06/GHSA-qm58-cvvm-c5qr/GHSA-qm58-cvvm-c5qr.json
JSON Data
https://api.test.osv.dev/v1/vulns/GHSA-qm58-cvvm-c5qr
Aliases
Published
2021-06-15T15:51:02Z
Modified
2024-02-15T05:33:12.836151Z
Severity
  • 8.1 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H CVSS Calculator
Summary
elFinder unsafe upload filtering leading to remote code execution
Details

Impact

Before elFinder 2.1.58, the upload filter did not disallow the upload of .phar files. As several Linux distributions are now shipping Apache configured in a way it will process these files as PHP scripts, attackers could gain arbitrary code execution on the server hosting the PHP connector (even in minimal configuration).

Patches

The issue has been addressed with https://github.com/Studio-42/elFinder/commit/75ea92decc16a5daf7f618f85dc621d1b534b5e1, associating .phar files to the right MIME type. Unless explicitly allowed in the configuration, such files cannot be uploaded anymore. This patch is part of the last release of elFinder, 2.1.58.

Workarounds

If you can't update to 2.1.58, make sure your connector is not exposed without authentication.

Important tips

Server-side scripts can often be created as text files. Currently, elFinder has an appropriate MIME type set for file extensions that are generally runnable on a web server.

However, the server has various settings. In some cases, the executable file may be judged as "text/plain". Therefore, elFinder installers should understand the extensions that can be executed on the web server where elFinder is installed, and check if there are any missing items in the elFinder settings.

The elFinder PHP connector has an option "additionalMimeMap" that specifies the MIME type for each extension. See #3295(comment) for more information.

References

  • https://snyk.io/vuln/composer:studio-42%2Felfinder
  • https://github.com/Studio-42/elFinder/issues/3295
  • Further technical details will be disclosed on https://blog.sonarsource.com/tag/security after some time.

For more information

If you have any questions or comments about this advisory, you can contact: - The original reporters, by sending an email to support [at] snyk.io or vulnerability.research [at] sonarsource.com; - The maintainers, by opening an issue on this repository.

Database specific
{
    "nvd_published_at": "2021-06-13T11:15:00Z",
    "cwe_ids": [
        "CWE-434"
    ],
    "severity": "HIGH",
    "github_reviewed": true,
    "github_reviewed_at": "2021-06-14T22:14:26Z"
}
References

Affected packages

Packagist / studio-42/elfinder

Package

Name
studio-42/elfinder
Purl
pkg:composer/studio-42/elfinder

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
2.1.58

Affected versions

2.*

2.0.3
2.0.4
2.0.5
2.0.6
2.0.7
2.0.8
2.0.9
2.1.0
2.1.1
2.1.2
2.1.3
2.1.4
2.1.5
2.1.6
2.1.7
2.1.8
2.1.9
2.1.10
2.1.11
2.1.12
2.1.13
2.1.14
2.1.15
2.1.16
2.1.17
2.1.18
2.1.19
2.1.20
2.1.21
2.1.22
2.1.23
2.1.24
2.1.25
2.1.26
2.1.27
2.1.28
2.1.29
2.1.30
2.1.31
2.1.32
2.1.33
2.1.34
2.1.35
2.1.36
2.1.37
2.1.38
2.1.39
2.1.40
2.1.41
2.1.42
2.1.43
2.1.44
2.1.45
2.1.46
2.1.47
2.1.48
2.1.49
2.1.50
2.1.51
2.1.52
2.1.53
2.1.54
2.1.55
2.1.56
2.1.57