Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-2359

Safe multiline messages

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      The problem with using multiple lines in a messages, is of course CRLF (or other form of line injection).

      however, much like you can let people write javascript that can't be executed by a browser safely if you encode it, I think you could do the same for CRLF. I think simply printing \n%n would be safe (\n being the actual encoding), but adding a header and footer to demark might be better...

      [ERROR] 01234 - com.mydomain.app ...
      ```
      my message\n
      has multiple\r\n
      lines\r
      ```

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                xenoterracide Caleb Cushing
              • Votes:
                1 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: