Path Traversal and Code Execution in CSLA.NET (CVE-2024-28698)
A path traversal vulnerability in CSLA.NET's MobileFormatter allowed an attacker to load an arbitrary DLL from a user-controlled path, leading to remote code execution if the attacker could upload a file. The attacker could execute code by uploading a malicious DLL and then sending a crafted request to the DataPortal endpoint.
Published on intruder.io
CSLA.NET is a framework that helps structure business logic for .NET applications into re-usable objects and share those objects between systems. During a penetration test last year, we discovered an interesting path traversal vulnerability affecting applications using this framework.
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 write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The MobileFormatter deserialization process used user-supplied type names to load assemblies via LoadFromAssemblyPath without validating that the path stayed within the application directory.
What the attacker needed
Ability to upload a file to the server; CSLA.NET before version 8.0
The fix
The library should check that the DLL resides within the application directory to prevent arbitrary DLLs from being loaded from the filesystem; the latest version of CSLA now does this.
How it was found
- Send a request to the DataPortal endpoint with a type name containing a path traversal sequence.
- Observe that the server attempts to load a DLL from the traversed path.
- Upload a malicious DLL (or a file with a .dll extension) to a directory reachable via traversal.
- Send a request with a null byte to truncate the appended .dll extension, allowing loading of a file with a different extension.
- The malicious DLL is loaded and its code executes.
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 write-up has not been written yet. The Original tab links to the source.
CSLA.NET is a framework for building .NET applications. A flaw let attackers trick the server into loading a DLL file from a location they control, and if they could upload a file, they could run their own code on the server.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.