PHP Object Injection to RCE in extension store via unverified HTTP response
Description
Impact
PHP Object Injection leading to Remote Code Execution (RCE).
The extension/store management handlers deserialize an HTTP response body with an unrestricted unserialize() (no allowed_classes restriction), while the bundled HTTP client disables TLS certificate verification by default. Because the certificate of the remote endpoint is not validated, a network / man-in-the-middle (MITM) attacker positioned on the path to the store endpoint (e.g. via DNS spoofing, a hostile/shared network, or a compromised resolver/upstream) can substitute the response body with an attacker-chosen PHP serialized payload.
On deserialization, the payload instantiates an in-tree POP gadget (GuzzleHttp\Cookie\FileCookieJar), whose destructor writes attacker-controlled content to an attacker-chosen path. This allows writing a .php file under the web root and achieving arbitrary code execution as the web-server user (full site and database compromise, persistence, lateral movement).
Who is impacted: NukeViet 4.x installations. Exploitation requires two preconditions: (1) an attacker able to intercept/alter the server's outbound traffic to the store endpoint, and (2) a privileged administrator (GODADMIN) performing a routine store action (opening the store list, install, update, or detail). The attacker does not need an account on the target.
Patches
Yes. The issue is fixed by two complementary hardening measures:
- Safe deserialization: all
unserialize()calls on internal/remote data now disallow object instantiation via['allowed_classes' => false](exposed as theNV_UNSERIALIZE_SAFEconstant). The affected payloads are arrays/scalars only, so the change is behaviour-preserving. - TLS verification: certificate verification is enabled by default in the HTTP client, and the URL-check helper now verifies peer/host across its cURL,
get_headersandstream_sockettransports using the shipped CA bundle.
Users should upgrade to the patched release (NukeViet 4.6.xx or later — replace with the exact fixed version/tag).
Workarounds
Users who cannot upgrade immediately can reduce exposure by:
- Enabling TLS certificate verification on the HTTP client (set
sslverify => truefor store/API requests and ensure a valid CA bundle is configured). - Avoiding extension store actions (list/install/update/detail) from administrator sessions while on untrusted or shared networks.
- Restricting/monitoring outbound DNS and network paths from the server to prevent response substitution.
References
- Patch commit(s): github.com/
nukeviet/ nukeviet/ commit/ 099ec8cc4734ba8c1b871653ee454367a07446cc - Affected component: extension store handlers and the bundled HTTP client
- Project: github.com/
nukeviet/ nukeviet