Attacking .NET Web Services
The .NET web services in Siemens Syngo Dynamics concatenated user-controlled input into file paths using Path.Combine, allowing an attacker to read arbitrary files. Similar misuse also enabled arbitrary file writes and server-side request forgery.
The original lives on securifera.com
We do not hold its text, 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
Likely the code used Path.Combine with user-controlled input without validating that the resulting path stayed within the intended directory, so an absolute path in the input overrode the base path.
Impact
An attacker could read arbitrary files, and similar flaws could allow arbitrary file writes (potentially leading to code execution) and server-side request forgery.
What the attacker needed
Access to the web service endpoint; ability to send SOAP requests
The fix
The issues were fixed and patched by the vendor; users should update to the latest version.
How it was found
- Locate the IIS config and web.config files to find the physical path of the service code.
- Open the .svc file to identify the assembly and service class, then find the assembly on disk.
- Decompile the assembly with dnSpy or dotPeek to review the service implementation.
- Enable metadata output in web.config to expose the WSDL endpoint.
- Use Burp's Wsdler extension to generate a sample SOAP request for the vulnerable operation.
- Send a request with a full file path in the fileName field to read an arbitrary 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 write-up has not been written yet. The Original tab links to the source.
The application built file paths by joining a folder name with user input. Because of how a .NET function works, if the user input is a full path, the folder part is ignored, so the attacker can point to any file on the server. This let them read files they should not see, and similar bugs let them write files or make the server fetch other resources.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.