Format string

From zakirkun/ice-tea · View interactive version

Format string is an AI agent skill from the GitHub repository zakirkun/ice-tea. Detects format string vulnerabilities where user-controlled input is passed directly as the format argument to printf-family functions.

How to use this skill

Skill file

Format String Vulnerability

Overview

Format string vulnerabilities occur when user-controlled data is passed as the format argument to printf(), sprintf(), fprintf(), etc. Attackers can:

Detection Strategy

Any printf-family call where the first argument (format string) comes from user input rather than a string literal.

Remediation

Always use a literal format string with user data as a parameter argument.

Vulnerable:

char buf[256];
fgets(buf, sizeof(buf), stdin);
printf(buf);  // Format string vulnerability!

Safe:

char buf[256];
fgets(buf, sizeof(buf), stdin);
printf("%s", buf);  // User data as argument, not format string
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.