Study. uk . com
  1. Home
  2. All questions
  3. Question 236

CompTIA Security+ study material · question 236 of 611

An attacker submits input containing newline characters that appear in the log as separate, forged entries. What is the defence?

  1. Increasing log retention
  2. Reducing the log verbosity
  3. Validating and encoding data before it is written to the log
  4. Signing each log file
Show the answer

Answer: C. Validating and encoding data before it is written to the log

Log injection destroys the log's value as evidence, and the fix is to treat log output like any other rendering context.

Source: OWASP Logging Cheat Sheet (OWASP) — OWASP Logging Cheat Sheet › Protect

Challenge yourself on this topic → Study as cards