GHSA-7vcx-v65q-9wpg

Suggest an improvement
Source
https://github.com/advisories/GHSA-7vcx-v65q-9wpg
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2023/01/GHSA-7vcx-v65q-9wpg/GHSA-7vcx-v65q-9wpg.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-7vcx-v65q-9wpg
Published
2023-01-11T23:53:34Z
Modified
2024-11-28T05:37:14.351861Z
Summary
XML-RPC for PHP's `Wrapper::buildClientWrapperCode` method allows code injection via malicious `$client` argument
Details

In order for this weakness to be exploited, the following conditions have to apply, at the same time:

  • method Wrapper::buildClientWrapperCode, or any methods which depend on it, such as Wrapper::wrapXmlrpcServer, Wrapper::wrapXmlrpcMethod or Wrapper::buildWrapMethodSource must be in use. Note that they are not used by default in either the Client or Server classes provided by the library; the developer has to specifically make use of them in his/her own code
  • the $client argument to either of those methods should have been built with malicious data, ie. data controlled by a 3rd party, passed to its constructor call

This is most likely an uncommon usage scenario, and as such the chances of exploitation may be low.

NB the graphical debugger which is shipped as part of the library is vulnerable to this, when used with the option "Generate stub for method call" selected. In that case, the debugger will display but not execute the malicious code, which would have to be provided via carefully crafted values for the "Address" and "Path" inputs.

The attack scenario in this case is that a developer copies into his/her own source code the php snippet generated by the debugger, in a situation where the debugger is used with "Address"/"Path" input values supplied by a 3rd party. The malicious payload in the "Address"/"Path" input values should be easily recognized as suspicious by any barely proficient developer, as it resembles a bog-standard injection attack. It goes without saying that a responsible developer should not blindly copy and paste into his/her own code anything generated by a 3rd party tool, such as the phpxmlrpc debugger, without giving it at least a cursory scan.

Originally reported as issue #80

Database specific
{
    "nvd_published_at": null,
    "cwe_ids": [
        "CWE-94"
    ],
    "severity": "MODERATE",
    "github_reviewed": true,
    "github_reviewed_at": "2023-01-11T23:53:34Z"
}
References

Affected packages

Packagist / phpxmlrpc/phpxmlrpc

Package

Name
phpxmlrpc/phpxmlrpc
Purl
pkg:composer/phpxmlrpc/phpxmlrpc

Affected ranges

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

Affected versions

3.*

3.0.0
3.0.1
3.1.0
3.1.1
3.1.2

4.*

4.0.0-alpha
4.0.0
4.0.1
4.1.0
4.1.1
4.2.0
4.2.1
4.2.2
4.3.0
4.3.1
4.3.2
4.4.0
4.4.1
4.4.2
4.4.3
4.5.0
4.5.1
4.5.2
4.6.0
4.6.1
4.7.0
4.7.1
4.7.2
4.8.0
4.8.1