Log injection

From zakirkun/ice-tea · View interactive version

Log injection is an AI agent skill from the GitHub repository zakirkun/ice-tea. Detects user-controlled input written to log files without sanitization, enabling log forging and potential log viewer attacks.

How to use this skill

Skill file

Log Injection

Overview

Log injection occurs when user-supplied data is written to log files without sanitizing newline characters. Attackers can:

Detection Strategy

Look for logging calls that directly include user-supplied request parameters.

Remediation

Vulnerable (Node.js):

const username = req.body.username;
logger.info(`User login attempt: ${username}`); // injection via \n

Safe (Node.js):

logger.info('User login attempt', { username: username.replace(/[\r\n]/g, '') });
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.