address-sanitizer

Detect memory errors in C/C++ code during fuzzing and testing.

19.0k|5.6k|Updated Jul 9, 2024
One-click install
npx skills add https://github.com/elizaOS/eliza --skill address-sanitizer-elizaos
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: address-sanitizer
Source: https://github.com/elizaOS/eliza/tree/main/packages/skills/skills/testing-handbook-skills/skills/address-sanitizer
Command: npx skills add https://github.com/elizaOS/eliza --skill address-sanitizer-elizaos

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers find critical memory errors like buffer overflows and use-after-free bugs in C/C++ code, preventing crashes and security vulnerabilities.

Core Features & Use Cases

  • Memory Error Detection: Identifies common memory corruption bugs during testing.
  • Fuzzing Integration: Seamlessly integrates with fuzzing tools like libFuzzer and AFL++ to enhance bug discovery.
  • Use Case: When fuzzing a network service written in C, use this Skill to compile the service with AddressSanitizer enabled, allowing the fuzzer to uncover memory safety issues that could lead to exploits.

Quick Start

Compile your C++ program with the AddressSanitizer flag enabled.

Frequently Asked Questions about address-sanitizer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect buffer overflows and use-after-free bugs in C++ code?

Memory errors like buffer overflows and use-after-free bugs are detected by compiling C/C++ code with AddressSanitizer flags like -fsanitize=address during testing and fuzzing. This instrumentation catches memory corruption issues that could lead to crashes or security vulnerabilities.

Does AddressSanitizer work with fuzzing tools like libFuzzer and AFL++?

Fuzzing tools like libFuzzer and AFL++ work seamlessly with AddressSanitizer by compiling the target with -fsanitize=address. This combination enhances bug discovery by allowing fuzzers to uncover memory safety issues that could lead to exploits.

What compiler flags do I need to enable memory error detection in C/C++?

Memory error detection requires compile-time instrumentation using flags like -fsanitize=address. This enables AddressSanitizer to identify memory corruption issues such as buffer overflows and use-after-free bugs during testing and fuzzing runs.

Why should I use AddressSanitizer during fuzzing instead of regular testing?

Fuzzing with AddressSanitizer enabled uncovers memory safety issues that regular testing often misses. The sanitizer detects buffer overflows and use-after-free bugs in C/C++ code as the fuzzer generates unexpected inputs, revealing vulnerabilities that could lead to exploits.

Can I detect memory corruption issues in network services written in C?

Memory corruption issues in network services written in C can be detected by compiling the service with AddressSanitizer enabled. When combined with fuzzing, this approach uncovers memory safety bugs that could otherwise lead to security exploits.