Cyber Risks · Trail of Bits Blog

Understanding Address Sanitizer: Better memory safety for your code

Summary: Trail of Bits explains AddressSanitizer, a compiler plugin that inserts checks around memory accesses at compile time and crashes the program on improper access, detecting bugs that can lead to remote code execution such as WannaCry or a WebP implementation bug. ASan runs at roughly 2x performance overhead versus Valgrind's 20x, works with C, C++, Objective-C, Rust, Go, and Swift, and relies on shadow memory and redzones to flag errors like heap-buffer-overflow, heap-use-after-free, and double-free.

What you should know: The authors found a real bug during an audit that ASan missed and note that unaligned 8-byte accesses went undetected under Clang 15, so a clean ASan run is not proof your code is free of the memory flaws that enable remote code execution.

Read the original at Trail of Bits Blog ↗