Engineering
address-sanitizer avatar

address-sanitizer

AddressSanitizer (ASan) integration for detecting memory safety vulnerabilities like buffer overflows and use-after-free errors in C/C++ projects.

Introduction

AddressSanitizer (ASan) is a critical runtime instrumentation tool designed for finding severe memory corruption bugs in C, C++, and Rust codebases. This skill provides an automated workflow to integrate ASan into your fuzzing and testing pipelines, ensuring that memory safety violations—which often serve as the root cause for exploitable security vulnerabilities—are caught early during development rather than in production environments. It is intended for software engineers, security researchers, and QA testers working on systems-level code where manual memory management is required.

  • Instruments source code at compile time to monitor memory allocations, enabling real-time detection of illegal memory operations.

  • Provides deep diagnostic reports for heap-buffer-overflows, stack-buffer-overflows, use-after-free, double-free, and memory leaks.

  • Simplifies the configuration of ASAN_OPTIONS for environment-specific behaviors such as verbosity, leak detection management, and abort-on-error settings.

  • Supports integration with industry-standard fuzzing engines including libFuzzer and AFL++.

  • Offers guidance on combining ASan with other sanitizers like UndefinedBehaviorSanitizer (UBSan) for a comprehensive security posture.

  • Use this skill to instrument builds via -fsanitize=address during fuzzing or unit testing campaigns.

  • Requires careful management of memory limits (e.g., -rss_limit_mb=0 in libFuzzer) because ASan reserves approximately 20TB of virtual memory.

  • Not recommended for production environments due to potential performance overhead (typically 2-4x slowdown) and the risk of reducing system security if error reporting is exposed.

  • Ideal for debugging intermittent crashes, auditing legacy codebases for safety regressions, and establishing robust test harnesses.

  • Limitations include experimental or limited support for non-Linux platforms like Windows and macOS, and performance overhead that may prohibit use in resource-constrained environments.

Repository Stats

Stars
4,874
Forks
424
Open Issues
21
Language
Python
Default Branch
main
Sync Status
Idle
Last Synced
Apr 29, 2026, 06:42 AM
View on GitHub