GHSL-2020-138, GHSL-2020-139: Remote code execution (RCE) and elevation of privileges (EoP) in SmartStoreNET - CVE-2020-27996, CVE-2020-27997
SmartStoreNET deserialised user-supplied request data into arbitrary .NET types, allowing an authenticated user to execute code by uploading a crafted assembly and referencing it. Separately, most state-changing endpoints lacked CSRF protection, so a malicious site could trick a logged-in administrator into creating a new admin account.
In the SmartStoreNET implementation of Model–View–Controller all models are derived from base class ModelBase. The class has a member property CustomProperties that is a dictionary of string to any object.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
Any authenticated user could execute arbitrary code on the server, and a malicious site could trick a logged-in administrator into creating a new admin account; CSRF is partially mitigated by SameSite cookies, but that setting may be None.
What the attacker needed
A free account; avatar upload feature enabled; victim (admin) visits malicious site
The fix
The vendor released v4.0.1 to address the RCE and v4.1.0 to address the CSRF.
How it was found
- Register an account on the e-shop.
- Compile a mixed-mode C++/CLI assembly that runs a program when loaded.
- Upload the assembly as an avatar image; the server renames it but the new name is returned in the response.
- Send a POST request to the addressadd endpoint with CustomProperties specifying the AssemblyInstaller type and the path to the uploaded file.
- The payload executes on the first request; to run it again, upload another file.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
The shopping cart software took data from a web form and used it to build internal objects without checking what kind of object was requested. An attacker could ask it to build a special object that runs a file they had uploaded, leading to code execution. Also, many forms that change settings did not verify the request came from the site itself, so another website could silently submit them on behalf of a logged-in administrator.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.