insecure deserilize object leads to RCE On Sitecore (CVE-██████████-27218)
An insecure deserialisation flaw in Sitecore allowed an attacker to send a crafted value in the ThumbnailsAccessToken header, which was deserialised with BinaryFormatter. This could let an attacker run arbitrary operating system commands on the server.
Originally disclosed on HackerOne
- Triaged in 9 days
- Fixed in 11 days
- Disclosed after 30 days
Summary by the program
This critical vulnerability involves an insecure deserialization issue in Sitecore implementation on ██████████ , which has been assigned CVE-2025-27218. The vulnerability allows remote code execution (RCE) through unsanitized user input in the ThumbnailsAccessToken header. Using the BinaryFormatter serialization method, an attacker can create malicious serialized objects with tools like ysoserial.net and execute arbitrary operating system commands on the target server. This poses a severe security risk as it allows complete system compromise, where attackers can create, read, and exfiltrate files, potentially gaining full control of the affected system. The vulnerability has been remediated by removing public access to the affected site, which is now protected behind Cloudflare WAF.
What the report shows
The target is a Sitecore implementation on a host in the *.banfield.com scope. The program's summary describes a critical insecure deserialisation flaw, tracked as CVE-2025-27218, that allows remote code execution through unsanitised user input in the ThumbnailsAccessToken header.
The mechanism is the BinaryFormatter serialisation method. An attacker can build malicious serialised objects with a tool such as ysoserial.net and have the target server execute arbitrary operating system commands. The report does not include the request that was sent, the serialised payload, or the command that was run, so there is nothing to reproduce from the text alone.
The program rates the issue critical and says it allows complete system compromise: creating, reading and exfiltrating files, and potentially full control of the affected system. No bounty figure is given. The fix was to remove public access to the affected site, which now sits behind the Cloudflare WAF.
Root cause
The report points to unsanitised user input in the ThumbnailsAccessToken header and the use of BinaryFormatter serialisation. BinaryFormatter reconstructs arbitrary .NET object graphs from attacker-supplied bytes, and when the type information in that stream resolves to gadgets with dangerous side effects, deserialisation itself runs code.
Impact
The report's own framing is remote code execution leading to complete system compromise: an attacker could create, read and exfiltrate files and potentially take full control of the host. The program hedges with "potentially" for full control, The program hedges with "potentially" for full control.
How this kind of bug works
Serialisation turns an object graph into a byte stream; deserialisation turns those bytes back into live objects. In .NET, BinaryFormatter records type names and field values, and on read it instantiates those types and sets their fields. If any type reachable in the loaded assemblies has a side effect in its constructor, setter, finalizer or deserialisation callback, an attacker can chain such types (gadgets) so that the act of deserializing triggers file writes, process starts or network calls. ysoserial.net packages these gadget chains into ready-made payloads.
The bug class appears wherever a server accepts serialised data from a client: view state, cookies, custom headers, cache keys, session blobs, message queues and inter-service RPC. It persists because serialisation is convenient for passing structured state, and because the danger is invisible in the code: a call to deserialise looks like parsing. Defences are layered: stop using unsafe formatters (BinaryFormatter is obsolete and disabled by default in current .NET), use data-only formats such as JSON with strict schemas, sign or encrypt any blob that must round-trip through the client, and enforce type allow-lists where a serializer supports them. Network controls such as a WAF help but do not remove the flaw.
How to test for it
- Map features that carry opaque state to the client: cookies, hidden form fields, custom headers, cache and thumbnail tokens, remember-me values, and anything base64-looking or starting with a serialisation marker.
- Decode candidate values and look for structure: .NET
BinaryFormatterstreams typically begin with the bytes00 01 00 00 00 FF FF FF FF, and JSON or XML serializers leave readable type names. - Confirm the server actually deserializes the value: change a byte, truncate it, or swap in a well-formed but different value, and watch for deserialisation errors, stack traces or 500 responses that name a formatter or type.
- Only then attempt a benign gadget that proves execution without harm, such as a DNS lookup or a delay, generated with a tool like ysoserial.net for the identified formatter and platform. Keep it minimal and within the program's rules.
- Record the request, the response and the out-of-band callback as evidence.
A positive result is a callback or measurable delay caused solely by the serialised value. Common false positives: the value is base64 but is really an HMAC-signed token that fails validation before deserialisation; the error comes from a generic parser rather than a formatter; a WAF blocks the request and the apparent failure is the block page; or the callback fires from your own tooling rather than the target.
How it is fixed
The standard fix is to remove the unsafe deserialisation path: replace BinaryFormatter with a data-only serializer and a strict schema, or stop accepting the value from the client entirely and keep state server-side. Where a token must travel through the client, sign it with a server-side key and reject anything that fails verification before parsing. Apply type allow-lists if a serializer requires them, keep the framework patched for the relevant CVE, and add monitoring for deserialisation exceptions. The program here removed public access and placed the site behind a WAF.
Hunting notes
This bug class hides in features that round-trip complex state: shopping carts, personalisation, report exports, thumbnail and image proxies, legacy ASP.NET view state, and integrations between Sitecore, CMS platforms and internal services. Recon signals include headers and cookies with vendor-specific names, base64 blobs of consistent length, error pages naming .NET formatters, and old framework versions. When you find a candidate, prove execution with the least intrusive gadget you can and show the callback in the report; programs accept deserialisation reports when the evidence shows code running, not just an error message.
What happened, in plain words
This report is about a website built with Sitecore, a popular system for managing website content. The site sat on a host within the *.banfield.com scope. The program summarised the finding as a critical vulnerability tracked as CVE-2025-27218.
The flaw is called insecure deserialisation. To understand it, start with what serialisation is. When a program wants to save an object (a bundle of data and behaviour inside the program) or send it somewhere, it can turn that object into a stream of bytes. That is serialisation. Deserialisation is the reverse: the program takes the bytes and rebuilds the object. Think of it like packing a piece of furniture into a flat box and later reassembling it from the instructions inside the box. If someone can swap the instructions for their own, the reassembled furniture is whatever they wanted.
In this case the server handled unsanitised user input from a request header called ThumbnailsAccessToken, and the BinaryFormatter serialisation method was involved. A request header is a small piece of text a browser sends along with every request to a website, like the label on an envelope.
The deserializer involved is BinaryFormatter, a .NET component that rebuilds objects from bytes. The problem is that BinaryFormatter does not just rebuild plain data: it also records which types of object to create, and creating certain types can have side effects, such as starting a program. An attacker can use a tool such as ysoserial.net to build a malicious serialised object that, when deserialised, runs operating system commands on the server. That is remote code execution (RCE): running your own commands on someone else's machine from a distance.
The program describes the impact as complete system compromise. An attacker could create, read and exfiltrate files (copy them out of the system) and potentially take full control of the affected host. The report does not include the request that was sent, the serialised payload, or the command that was run, so there is nothing to reproduce from the text alone. No bounty figure is given.
The fix was to remove public access to the affected site, which now sits behind the Cloudflare WAF. A WAF (web application firewall) is a filter that inspects incoming web traffic and blocks requests that look malicious. It reduces exposure, but it does not repair the underlying flaw in the code.
In general, how this kind of bug works
Serialisation turns an object into bytes; deserialisation turns those bytes back into a live object. In .NET, BinaryFormatter stores type names and field values, and when it reads them back it creates those types and sets their fields. If any type available in the loaded code has a side effect when it is created or filled in, such as writing a file or starting a process, an attacker can chain such types together. These chains are called gadgets, and ysoserial.net packages ready-made ones.
The bug class appears wherever a server accepts serialised data from a client: cookies, hidden form fields, custom headers, cache keys, session data and messages between services. It persists because serialisation is convenient and because the danger is invisible in the code: a call to deserialise looks like ordinary parsing.
Defences are layered. Stop using unsafe formatters: BinaryFormatter is obsolete and disabled by default in current .NET. Use data-only formats such as JSON with strict schemas. Sign or encrypt any blob that must travel through the client, and enforce type allow-lists where a serializer supports them. A WAF helps but does not remove the flaw.
If you were testing for this, the general approach is:
- Map features that carry opaque state to the client: cookies, hidden form fields, custom headers, cache and thumbnail tokens, remember-me values, and anything base64-looking or starting with a serialisation marker.
- Decode candidate values and look for structure. .NET
BinaryFormatterstreams typically begin with the bytes00 01 00 00 00 FF FF FF FF, and JSON or XML serializers leave readable type names. - Confirm the server actually deserializes the value: change a byte, truncate it, or swap in a well-formed but different value, and watch for deserialisation errors, stack traces or 500 responses that name a formatter or type.
- Only then attempt a benign gadget that proves execution without harm, such as a DNS lookup or a delay, generated with a tool like ysoserial.net for the identified formatter and platform. Keep it minimal and within the program's rules.
- Record the request, the response and the out-of-band callback as evidence.
A positive result is a callback or measurable delay caused solely by the serialised value. Common false positives: the value is base64 but is really an HMAC-signed token that fails validation before deserialisation; the error comes from a generic parser rather than a formatter; a WAF blocks the request and the apparent failure is the block page; or the callback fires from your own tooling rather than the target.
The standard fix is to remove the unsafe deserialisation path: replace BinaryFormatter with a data-only serializer and a strict schema, or stop accepting the value from the client entirely and keep state server-side. Where a token must travel through the client, sign it with a server-side key and reject anything that fails verification before parsing. Apply type allow-lists if a serializer requires them, keep the framework patched for the relevant CVE, and add monitoring for deserialisation exceptions.
Glossary
- Serialisation: turning an object inside a program into a stream of bytes so it can be stored or sent.
- Deserialisation: rebuilding an object from a stream of bytes.
- Insecure deserialisation: a flaw where a program rebuilds objects from data an attacker controls, allowing malicious objects to run code.
- Remote code execution (RCE): running your own commands on a remote system.
- Request header: a small piece of text sent with a web request, carrying extra information such as a token or content type.
- Token: a value used to identify or authorise a client, often a short string.
BinaryFormatter: a .NET component that serializes and deserializes objects in a binary format; unsafe with untrusted input.- .NET: a software framework from Microsoft used to build and run applications.
- ysoserial.net: a tool that generates malicious serialised payloads for .NET applications.
- Gadget: a class in the loaded code whose creation or field-setting has a side effect that an attacker can chain into code execution.
- CVE: a public identifier for a known security vulnerability.
- WAF (web application firewall): a filter that inspects web traffic and blocks requests that look malicious.
- Cloudflare: a company providing web security and performance services, including a WAF.
- Exfiltration: copying data out of a system without authorisation.
- Base64: a way of encoding binary data as readable text.
- HMAC: a keyed hash used to sign data so tampering can be detected.
- Allow-list: a list of permitted items (here, object types) that everything else is rejected against.
- Out-of-band callback: a signal sent to a server you control, used as proof that code ran on the target.