Lookup for vulnerabilities affecting packages.

Vulnerability_idVCID-4ehm-4k5n-mkfk
Summary
By-passing Protection of PharStreamWrapper Interceptor
Insecure deserialization is a vulnerability which occurs when untrusted data is used to abuse the logic of an application. In July 2018, the vulnerability of insecure deserialization when executing Phar archives was addressed by removing the known attack vector in the TYPO3 core. For more details read the corresponding TYPO3 advisory.

In addition, a new interceptor was introduced to protect possible (but unknown) vulnerabilities in 3rd party components like TYPO3 extensions. Basically, the PharStreamWrapper intercepts direct invocations of Phar archives and allows or denies further processing based on individual rules.

Recently, the PharStreamWrapper was extracted from the TYPO3 core and released as standalone package under the MIT license. It is now available for any PHP driven project.

The stream wrapper overwrites the existing Phar handling of PHP, applies its own assertions and then restores the native PHP Phar handling for the corresponding commands (e.g. file_exists, include, fopen) to continue processing. After that, the native PHP Phar handling gets disabled and is overwritten by the logic of the PharStreamWrapper again. This is the only way to control invocations of Phar archives as PHP only allows a single handler for each corresponding stream.

We were informed that exception and error handlers in custom applications (e.g. TYPO3 extensions) sometimes didn't return to the original operating sequence of the PharStreamWrapper. A possible consequence was that the unprotected native PHP Phar handling remained active and therefore became vulnerable for the basic issue of insecure deserialization again.

Examples
Take a look at the following examples showing how the handling is by-passed in custom application code.

Scenario A: Exception thrown from code organized in a Phar archive
```
try {
    include('phar://path-to-archive/good-archive.phar');
} catch (\Throwable $throwable) {
    // not doing much here, continue execution
}
// the insecure value can be anything that is or was user-submitted
// and cannot be trusted in terms of security, $_GET is just used as example
$insecureValue = $_GET['path'];
// the value might be 'phar://path-to-archive/malicious-archive.phar'
file_exists($insecureValue);
```
Scenario B: Errors converted to exceptions and thrown when interacting with archive contents
```
// set error handler in order to convert errors to exceptions
set_error_handler(function($errno, $errstr, $errfile, $errline, array $errcontext) {
   throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
});
// interacting with Phar archive
try {
   $resource = opendir('phar://path-to-archive/good-archive.phar/non-existing-path/');
   closedir($resource);
} catch (\Throwable $throwable) {
   // not doing much here, continue execution
}
// the insecure value can be anything that is or was user-submitted
// and cannot be trusted in terms of security, $_GET is just used as example
$insecureValue = $_GET['path'];
// the value might be 'phar://path-to-archive/malicious-archive.phar'
file_exists($insecureValue);
```
Aliases
0
alias GHSA-4v5g-8pq2-32m2
Fixed_packages
0
url pkg:composer/typo3/phar-stream-wrapper@2.0.1
purl pkg:composer/typo3/phar-stream-wrapper@2.0.1
is_vulnerable true
affected_by_vulnerabilities
0
vulnerability VCID-349d-w26k-mqfw
1
vulnerability VCID-ddsb-8rn2-x7gb
2
vulnerability VCID-hsez-yx7s-uuhn
3
vulnerability VCID-xvf6-5tjp-b7bu
resource_url http://public2.vulnerablecode.io/packages/pkg:composer/typo3/phar-stream-wrapper@2.0.1
1
url pkg:composer/typo3/phar-stream-wrapper@3.0.1
purl pkg:composer/typo3/phar-stream-wrapper@3.0.1
is_vulnerable true
affected_by_vulnerabilities
0
vulnerability VCID-349d-w26k-mqfw
1
vulnerability VCID-ddsb-8rn2-x7gb
2
vulnerability VCID-hsez-yx7s-uuhn
3
vulnerability VCID-xvf6-5tjp-b7bu
resource_url http://public2.vulnerablecode.io/packages/pkg:composer/typo3/phar-stream-wrapper@3.0.1
Affected_packages
0
url pkg:composer/typo3/phar-stream-wrapper@1.0.0
purl pkg:composer/typo3/phar-stream-wrapper@1.0.0
is_vulnerable true
affected_by_vulnerabilities
0
vulnerability VCID-4ehm-4k5n-mkfk
1
vulnerability VCID-chq1-2qx1-qqe9
resource_url http://public2.vulnerablecode.io/packages/pkg:composer/typo3/phar-stream-wrapper@1.0.0
1
url pkg:composer/typo3/phar-stream-wrapper@1.0.1
purl pkg:composer/typo3/phar-stream-wrapper@1.0.1
is_vulnerable true
affected_by_vulnerabilities
0
vulnerability VCID-4ehm-4k5n-mkfk
1
vulnerability VCID-chq1-2qx1-qqe9
resource_url http://public2.vulnerablecode.io/packages/pkg:composer/typo3/phar-stream-wrapper@1.0.1
2
url pkg:composer/typo3/phar-stream-wrapper@1.1.0
purl pkg:composer/typo3/phar-stream-wrapper@1.1.0
is_vulnerable true
affected_by_vulnerabilities
0
vulnerability VCID-4ehm-4k5n-mkfk
1
vulnerability VCID-chq1-2qx1-qqe9
resource_url http://public2.vulnerablecode.io/packages/pkg:composer/typo3/phar-stream-wrapper@1.1.0
3
url pkg:composer/typo3/phar-stream-wrapper@1.9.9
purl pkg:composer/typo3/phar-stream-wrapper@1.9.9
is_vulnerable true
affected_by_vulnerabilities
0
vulnerability VCID-4ehm-4k5n-mkfk
1
vulnerability VCID-chq1-2qx1-qqe9
resource_url http://public2.vulnerablecode.io/packages/pkg:composer/typo3/phar-stream-wrapper@1.9.9
4
url pkg:composer/typo3/phar-stream-wrapper@2.0.0
purl pkg:composer/typo3/phar-stream-wrapper@2.0.0
is_vulnerable true
affected_by_vulnerabilities
0
vulnerability VCID-349d-w26k-mqfw
1
vulnerability VCID-4ehm-4k5n-mkfk
2
vulnerability VCID-chq1-2qx1-qqe9
3
vulnerability VCID-ddsb-8rn2-x7gb
4
vulnerability VCID-hsez-yx7s-uuhn
5
vulnerability VCID-xvf6-5tjp-b7bu
resource_url http://public2.vulnerablecode.io/packages/pkg:composer/typo3/phar-stream-wrapper@2.0.0
5
url pkg:composer/typo3/phar-stream-wrapper@3.0.0
purl pkg:composer/typo3/phar-stream-wrapper@3.0.0
is_vulnerable true
affected_by_vulnerabilities
0
vulnerability VCID-349d-w26k-mqfw
1
vulnerability VCID-4ehm-4k5n-mkfk
2
vulnerability VCID-chq1-2qx1-qqe9
3
vulnerability VCID-ddsb-8rn2-x7gb
4
vulnerability VCID-hsez-yx7s-uuhn
5
vulnerability VCID-xvf6-5tjp-b7bu
resource_url http://public2.vulnerablecode.io/packages/pkg:composer/typo3/phar-stream-wrapper@3.0.0
References
0
reference_url https://github.com/FriendsOfPHP/security-advisories/blob/master/typo3/phar-stream-wrapper/2018-10-18-1.yaml
reference_id
reference_type
scores
0
value MODERATE
scoring_system generic_textual
scoring_elements
url https://github.com/FriendsOfPHP/security-advisories/blob/master/typo3/phar-stream-wrapper/2018-10-18-1.yaml
1
reference_url https://typo3.org/security/advisory/typo3-psa-2018-001
reference_id
reference_type
scores
0
value MODERATE
scoring_system generic_textual
scoring_elements
url https://typo3.org/security/advisory/typo3-psa-2018-001
2
reference_url https://github.com/advisories/GHSA-4v5g-8pq2-32m2
reference_id GHSA-4v5g-8pq2-32m2
reference_type
scores
0
value MODERATE
scoring_system cvssv3.1_qr
scoring_elements
url https://github.com/advisories/GHSA-4v5g-8pq2-32m2
Weaknesses
0
cwe_id 502
name Deserialization of Untrusted Data
description The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
1
cwe_id 937
name OWASP Top Ten 2013 Category A9 - Using Components with Known Vulnerabilities
description Weaknesses in this category are related to the A9 category in the OWASP Top Ten 2013.
2
cwe_id 1035
name OWASP Top Ten 2017 Category A9 - Using Components with Known Vulnerabilities
description Weaknesses in this category are related to the A9 category in the OWASP Top Ten 2017.
Exploits
Severity_range_score4.0 - 6.9
Exploitability0.5
Weighted_severity6.2
Risk_score3.1
Resource_urlhttp://public2.vulnerablecode.io/vulnerabilities/VCID-4ehm-4k5n-mkfk