Wallbleed: A Memory Disclosure Vulnerability in the Great Firewall of China
A buffer over-read bug in the DNS injection subsystem of China's Great Firewall caused censoring middleboxes to append up to 125 bytes of their own memory to forged DNS responses for crafted queries. An attacker could send such queries and read leaked memory, which included fragments of other users' network traffic and internal system data.
gfw.report
Published on gfw.report
We present Wallbleed, a buffer over-read vulnerability that existed in the DNS injection subsystem of the Great Firewall of China. Wallbleed caused certain nation-wide censorship middleboxes to reveal up to 125 bytes of their memory when censoring a crafted DNS query.
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
Likely a missing bounds check when parsing DNS name label length prefixes, so the parser read past the end of the query packet and treated adjacent memory as part of the name.
Impact
The leak could expose fragments of other users' plaintext traffic and internal system data, and even traffic with both endpoints outside China may have been affected if it was routed through China's network border.
What the attacker needed
Ability to send DNS packets to China; a blocked domain name; no account needed
The fix
The vulnerability was partially patched in November 2023 and fully patched in March 2024.
How it was found
- Send a well-formed DNS query for a blocked name to a host inside China to confirm an injected response arrives.
- Alter the length prefix of a later label so it extends past the end of the query.
- Send the malformed query and observe that only the vulnerable injector responds.
- Read the extra bytes in the injected response, which come from the device's memory.
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.
When a computer looks up a website name, it sends a small DNS message and expects a reply. China's censorship equipment watches these messages and forges fake replies to blocked names. A bug meant that, for specially malformed lookups, the equipment also copied a chunk of its own working memory into the reply, so the sender could see leftover data from other traffic.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.