STMicroelectronics X-CUBE-AZRTOS-F7 HTTP server single PUT request integer underflow vulnerability
The HTTP server's PUT handler in NetX Duo subtracts the request body size from the attacker-supplied Content-Length without checking that the body is not larger than the declared length. A crafted PUT request with a smaller Content-Length than the data sent causes an unsigned underflow, so the server keeps receiving and writing data until it fills the file system, causing a denial of service.
Originally disclosed on Cisco Talos
An integer underflow vulnerability exists in the HTTP server PUT request functionality of STMicroelectronics X-CUBE-AZRTOS-WL 2.0.0. A specially crafted network packet can lead to denial of service.
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 report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The code subtracts the received body size from the unsigned Content-Length without validating that the body is not larger than the declared length, so the result wraps to a very large value.
Impact
An attacker could write an excessively large file and consume all file system resources, causing a denial of service; the CVSS score rates availability impact as low.
What the attacker needed
Network access to the HTTP server; ability to send PUT requests
The fix
The code should validate that the received body does not exceed the declared Content-Length before subtracting, preventing the unsigned wrap; the vendor released a patch in March 2025.
How it was found
- Send an HTTP PUT request whose body contains more bytes than the Content-Length header declares.
- The server writes the first packet's body and subtracts its size from the declared length, wrapping to a huge value.
- The server enters its receive loop and keeps accepting and writing further data to the target 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 report has not been written yet. The Original tab links to the source.
A web server that accepts file uploads reads a number called Content-Length to know how many bytes to expect. Here the code subtracts the bytes already received from that number, but if more bytes arrived than the number said, the result goes below zero. Because the number cannot be negative, it wraps around to a huge value, so the device keeps writing data to its storage until it runs out of space.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.