Skip to content
Info disclosure Write-up Advanced

Leaking ObjRefs to Exploit HTTP .NET Remoting

ASP.NET applications using .NET Remoting over HTTP could leak internal object URIs (ObjRefs) through error messages, and an attacker could use these to perform .NET Remoting attacks, potentially leading to remote code execution.

Markus Wulftange Follow

Published on code-white.com

Although already considered deprecated in 2009, .NET Remoting is still around. Even where developers might not expect it such as in ASP.NET web applications, both on-premises and on Azure.

Markus Wulftange (@mwulftange), on code-white.com

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 HTTP handler for .NET Remoting allowed HTTP headers to overwrite trusted request properties, and error responses included a serialized call context that could contain a reference to a server object (ObjRef), leaking its URI.

Impact

An attacker could obtain a valid object URI and use it to exploit .NET Remoting vulnerabilities, potentially achieving remote code execution, though default deserialization restrictions may limit direct exploitation.

What the attacker needed

ASP.NET app with .NET Remoting over HTTP; A library storing MarshalByRefObject in LogicalCallContext; Ability to send HTTP requests to the endpoint

The fix

The January 2024 security updates changed the default behaviour to no longer allow HTTP headers to overwrite trusted request values, and the setting can be reverted to the vulnerable behaviour.

How it was found

  1. Send a request to a .NET Remoting endpoint with a header that changes the HTTP verb to POST.
  2. The request reaches the formatter sink, which throws an exception because the object URI is not registered.
  3. The exception is returned in a ReturnMessage that includes the LogicalCallContext, leaking an ObjRef if present.

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.

This report is about a hidden feature in older Microsoft web software called .NET Remoting. The software could accidentally reveal secret internal addresses when it showed error messages. An attacker who saw these addresses could then send malicious requests to take over the server.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

More by Markus Wulftange

View all

25 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.