Skip to content
RCE Write-up Intermediate

CVE-2023-36049: Microsoft .NET CRLF Injection Arbitrary File Write/deletion Vulnerability

The .NET Framework's FTP client fails to validate CRLF characters in FTP command parameters and FTP URIs, allowing an attacker to inject additional FTP commands. An attacker could exploit this to write or delete files in the context of the FTP server.

Justin Hung Follow

Published on zerodayinitiative.com

A remote command execution vulnerability has been reported in the Microsoft .NET Framework and Visual Studio. This vulnerability is due to improper validation of user input.

Justin Hung, Yazhi Wang, Piotr Bazydło (@chudyPB), on zerodayinitiative.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 .NET Framework's FTP client functions FormatFtpCommand and FtpWebRequest fail to validate that parameters and URIs do not contain CRLF characters, allowing command injection.

Impact

An attacker could write or delete files in the context of the FTP server.

What the attacker needed

Ability to send malicious FTP requests or URIs

The fix

Microsoft released a patch in November 2023; if unable to patch, refuse FTP URIs from untrusted peers or filter FTP traffic.

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.

FTP is an old protocol for transferring files. Commands are separated by a special two-character line ending (CRLF). If a program that builds FTP commands does not check for these characters in user input, an attacker can sneak in extra commands. Here, the .NET FTP client did not check, so an attacker could make the server delete or write files.

What is RCE?

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

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.