Skip to content
Back to skills

Detecting Format String

ASecurity

Detects format string vulnerabilities by identifying unsafe printf family function calls with user-controlled format strings. Use when analyzing logging, error handling, or investigating memory disclosure via format strings.

  • 666 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added February 8, 2026
security

Security analysis

A100/100

Scanned February 12, 2026

npx -y skills add majiayu000/claude-skill-registry --skill detecting-format-string --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Detecting Format String?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Detecting Format String
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-detecting-format-string/badge)](https://www.skillsdirectory.com/skills/majiayu000-detecting-format-string)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: detecting-format-string
description: Detects format string vulnerabilities by identifying unsafe printf family function calls with user-controlled format strings. Use when analyzing logging, error handling, or investigating memory disclosure via format strings.
---

# Format String Detection

## Detection Workflow

1. **Identify printf calls**: Find printf, fprintf, sprintf, snprintf, syslog functions
2. **Trace format string source**: Use `xrefs_to` to trace format string to user input
3. **Check format specifier**: Verify if format string is constant literal or user-controlled
4. **Assess exploitability**: Can attacker control format string? Can they read/write memory?

## Key Patterns

- `printf(user_string)` - user input as format string
- `fprintf(file, user_input)` - direct use of user input
- Memory read via %s, %x format specifiers
- Memory write via %n format specifier

## Output Format

Report with: id, type, severity, confidence, location, sink, source, format string, format specifier status, exploitability, attack vector, evidence, mitigation.

## Severity Guidelines

- **CRITICAL**: Format string with %n and user control
- **HIGH**: Format string with user control (read-only)
- **MEDIUM**: Format string with limited user control
- **LOW**: Format string with constant format string

## See Also

- `patterns.md` - Detailed detection patterns and exploitation scenarios
- `examples.md` - Example analysis cases and code samples
- `references.md` - CWE references and mitigation strategies

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.