Skip to content
Memory corruption Write-up Advanced

WolfSSL Hunting Experience: Cerita Dari Seorang Bug Hunter Pengan

The author describes several memory-safety bugs found in wolfSSL, including a buffer overflow in ASN.1 certificate extension parsing, an integer overflow in certificate chain allocation, a use-after-free in TLS handshake error handling, and a missing bounds check on chain depth. An attacker could send a malformed certificate or handshake data to crash a server, and the author claims some could lead to remote code execution.

MostReal Follow

Published on medium.com

Wkwk, jadi gini… gw udah lama banget hunting di wolfSSL ini. Buat yang gak tau, wolfSSL itu library SSL/TLS yang dipake di banyak embedded device, IoT, sampe game console.

MostReal, on medium.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

Likely missing bounds and overflow checks when parsing attacker-controlled length and count fields from ASN.1 certificates and TLS handshake messages.

Impact

A malformed certificate or handshake message could crash a wolfSSL server (denial of service), and the author claims some of the memory corruption could lead to remote code execution.

What the attacker needed

Attacker can send a malformed certificate; target uses wolfSSL; no authentication needed for handshake bugs

How it was found

  1. Compile wolfSSL from source with all features and a fuzzing harness enabled.
  2. Use AI-assisted code analysis to flag ASN.1 parsing functions with potential buffer overflow.
  3. Manually review the flagged certificate extension decoding function and spot the missing bounds check.
  4. Craft a certificate with a very large extension length so the pointer arithmetic overflows and the copy overruns the buffer.
  5. Confirm the memory corruption with AddressSanitizer and a reproducible crash.
  6. Run AFL++ with AddressSanitizer on a custom TLS server harness to find further crashes in error paths.

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.

wolfSSL is a library that handles encrypted connections (TLS) for many small and embedded devices. The author found places where the library trusts numbers in incoming certificates or handshake messages without checking they fit in memory, so a malicious message can overwrite memory or crash the program. That can take a server down or, in the worst case, let an attacker run their own code.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

More by MostReal

View all

9 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.