You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Accepting user input in log files can result in log forging. For example, if a user enters CRLF sequences (carriage return and line feed), it may be possible to break a legit log entry into two. The second entry can be made to be purposely misleading, for instance, it may warn the administrator that a reboot is required to install critical security updates.

Noncompliant Code Example

This noncompliant code example logs the user's login user name when an invalid request is received. No input sanitization is being performed.

logger.severe("Invalid username:" + getUserName());

Compliant Solution

This compliant solution sanitizes the user name input before logging it.

String username = getUserName();
sanitize(username);
logger.severe("Invalid username:" + username);

Risk Assessment

Allowing unvalidated user input to be logged can lead to forging of log entries.

Rule

Severity

Likelihood

Remediation Cost

Priority

Level

EXC34- J

medium

probable

medium

P8

L1

Automated Detection

TODO

Related Vulnerabilities

Search for vulnerabilities resulting from the violation of this rule on the CERT website.

References

[[API 06]]


FIO36-J. Do not create multiple buffered wrappers on an InputStream      09. Input Output (FIO)      09. Input Output (FIO)

  • No labels