/prodsec-skills:compiler-hardeningfrom prodsec-skills
Applies compiler hardening flags and sanitizers to C/C++ builds. Use when reviewing build configurations, CI pipelines, or Makefiles/CMakeLists for native code projects.
Ships in prodsec-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
| Category | Examples |
|---|---|
| Memory errors | Buffer overflow, use-after-free (UAF), buffer over-read |
| Dependency attacks | Library hijacking, library sideloading, supply chain compromise |
When building with Fedora/RPM toolchains, hardened flags are often applied automatically. For other build systems, explicitly add hardening options.
The OpenSSF Compiler Hardening Guide is the canonical reference. Key flags include:
| Flag | Purpose |
|---|---|
-fstack-protector-strong | Stack buffer overflow detection |
-D_FORTIFY_SOURCE=2 | Runtime buffer overflow checks for standard library functions |
-fPIE / -pie | Position-independent executable for ASLR |
-Wl,-z,relro,-z,now | Full RELRO -- makes GOT read-only after relocation |
-Wl,-z,noexecstack | Non-executable stack |
-fno-strict-overflow | Prevent undefined behavior optimizations on signed overflow |
GCC 14+ provides -fhardened as a convenience flag that enables a recommended set of hardening options.
The Fedora Security Features Matrix provides an overview of security features available in a modern Linux system.
Sanitizers add runtime instrumentation that catches errors during testing that would otherwise go undetected. They increase binary size and resource consumption but provide significantly better error detection and debug information than traditional tooling.
| Sanitizer | Flag | Detects |
|---|---|---|
| AddressSanitizer | -fsanitize=address | Memory access violations (buffer overflow, UAF, stack overflow) |
| ThreadSanitizer | -fsanitize=thread | Data races and race conditions |
| LeakSanitizer | -fsanitize=leak | Memory leaks |
| UndefinedBehaviorSanitizer | -fsanitize=undefined | Undefined behavior at runtime |
Run sanitizer-enabled builds in CI. ASan and UBSan are the highest-value sanitizers for most projects.
JIT compilers inherently conflict with W^X (write XOR execute) because they must generate executable code at runtime. W^X protections apply at page granularity and cannot be meaningfully enforced on JIT buffers. Other memory areas (thread stacks, heap) should still have NX (non-executable) protection.
User-space sandboxing alone is insufficient; prefer OS and process-level isolation (namespaces, seccomp, SELinux) as the primary security boundary. User-space sandboxes can serve as defense-in-depth but have historically introduced their own security bugs and should not be the sole barrier, especially post-Spectre.
Dynamic linking relies on well-known search paths and filesystem permissions. The compilation environment may differ from the runtime environment with different (but compatible) library versions. Review and mitigate:
LD_LIBRARY_PATH, RPATH manipulation)-fhardened with GCC 14+)-fstack-protector-strong is enabled_FORTIFY_SOURCE=2 is defined-fPIE -pie)-Wl,-z,relro,-z,now)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub redhatproductsecurity/prodsec-skills --plugin prodsec-skills130 skills in this plugin
/address-sanitizerAddressSanitizer detects memory errors during fuzzing. Use when fuzzing C/C++ code to find buffer overflows and use-after-free bugs.
/admin-interface-securitySecure the administrative interface of model registries. Use when building, deploying, or reviewing model registry access controls and admin interfaces./aflppAFL++ is a fork of AFL with better fuzzing performance and advanced features. Use for multi-core fuzzing of C/C++ projects.
/agentic-actions-auditorAudits GitHub Actions workflows for security vulnerabilities in AI agent integrations including Claude Code Action, Gemini CLI, OpenAI Codex, and GitHub AI Inference. Detects attack vectors where attacker-controlled input reaches AI agents running in CI/CD pipelines, including env var intermediary patterns, direct expression injection, dangerous sandbox configurations, and wildcard user allowlists. Use when reviewing workflow files that invoke AI coding agents, auditing CI/CD pipeline security for prompt injection risks, or evaluating agentic action configurations./agent-identityEnforce that AI agents have their own identity separate from human users. Use when designing, building, or reviewing agent identity management, agent authentication, or agent permission models./agent-to-agent-authEnforce SPIFFE/SPIRE plus mTLS for agent-to-agent communication. Use when designing, building, or reviewing authentication between AI agents or multi-agent systems.Other plugins' skills for the same job