log-injection-anti-pattern

Detect unsanitized user input in log messages to prevent CWE-117 injection.

8|1|Updated Jan 19, 2026
One-click install
npx skills add https://github.com/igbuend/grimbard --skill log-injection-anti-pattern
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: log-injection-anti-pattern
Source: https://github.com/igbuend/grimbard/tree/main/skills/log-injection-anti-pattern
Command: npx skills add https://github.com/igbuend/grimbard --skill log-injection-anti-pattern

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill prevents attackers from injecting malicious or misleading entries into your application logs by exploiting unsanitized user input, which can hide malicious activity or cause system misinterpretation.

Core Features & Use Cases

  • Detects unsanitized input in log messages: Identifies vulnerabilities where user-provided data is directly written to logs.
  • Provides secure logging practices: Demonstrates how to sanitize input or use structured logging to prevent injection.
  • Use Case: When reviewing code that handles user-submitted comments or system event data, this skill helps ensure that malicious strings like "\nINFO - System compromised" cannot be added to the logs.

Quick Start

Review the current code for any instances where user input is logged without proper sanitization.

Frequently Asked Questions about log-injection-anti-pattern

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

FAQPage Schema
What is log injection and how does it affect application security?

Detect log injection vulnerabilities by identifying unsanitized user input within log messages. Review code handling user-provided data or system events to ensure malicious strings cannot be added to logs.

How do I prevent log injection attacks from user-submitted data?

Detect log injection vulnerabilities by identifying unsanitized user input within log messages. Review code handling user-provided data or system events to ensure malicious strings cannot be added to logs.

How do I sanitize control characters in logging to prevent CWE-117?

Detect log injection vulnerabilities by identifying unsanitized user input within log messages. Review code handling user-provided data or system events to ensure malicious strings cannot be added to logs.

Does structured logging prevent log injection vulnerabilities?

Detect log injection vulnerabilities by identifying unsanitized user input within log messages. Review code handling user-provided data or system events to ensure malicious strings cannot be added to logs.