{"id":34515,"date":"2021-12-21T14:55:29","date_gmt":"2021-12-21T19:55:29","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=34515"},"modified":"2021-12-21T14:55:29","modified_gmt":"2021-12-21T19:55:29","slug":"infinite-recursion-in-log4j-2-16","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2021\/12\/21\/infinite-recursion-in-log4j-2-16\/","title":{"rendered":"Infinite Recursion in Log4j 2.16"},"content":{"rendered":"<p><a href=\"https:\/\/issues.apache.org\/jira\/browse\/LOG4J2-3230\">Ross Cohen<\/a> (via <a href=\"https:\/\/news.ycombinator.com\/item?id=29603208\">Hacker News<\/a>):<\/p>\n<blockquote cite=\"https:\/\/issues.apache.org\/jira\/browse\/LOG4J2-3230\"><p>If a string substitution is attempted for any reason on the following string, it will trigger an infinite recursion, and the application will crash: <code>${${::-${::-$${::-j}}}}<\/code>.<\/p><\/blockquote>\n\n<p>This is fixed in Log4j 2.17.<\/p>\n\n<p><a href=\"https:\/\/news.ycombinator.com\/item?id=29608717\">xg15<\/a>:<\/p>\n<blockquote cite=\"https:\/\/news.ycombinator.com\/item?id=29608717\">\n<p>So, let me get this: Log4j is disabling JNDI, fixing various string substitution issues and who knows what else, but the root cause of the whole mess - that Log4j attempts string substitution on the <em>actual parameter values<\/em> remains untouched?<\/p>\n<\/blockquote>\n\n<p>That <em>is<\/em> weird, but presumably changing it would break a lot of stuff. However, <a href=\"https:\/\/www.zerodayinitiative.com\/blog\/2021\/12\/17\/cve-2021-45105-denial-of-service-via-uncontrolled-recursion-in-log4j-strsubstitutor\">this article<\/a> makes it seem like simply injecting into one of the parameters is not sufficient to trigger the infinite recursion, depending on how the logger was configured.<\/p>\n\n<p>The scary thing is that I doubt that Log4j is unusually buggy. It&rsquo;s just that more people are scrutinizing it now and finding these latent problems.<\/p>\n\n<p>Previously:<\/p>\n<ul>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2021\/12\/16\/log4j-fix-also-has-rce\/\">Log4j Fix Also Has RCE<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2021\/12\/10\/log4shell-log4j-remote-code-execution\/\">Log4Shell: Log4j Remote Code Execution<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>Ross Cohen (via Hacker News): If a string substitution is attempted for any reason on the following string, it will trigger an infinite recursion, and the application will crash: ${${::-${::-$${::-j}}}}. This is fixed in Log4j 2.17. xg15: So, let me get this: Log4j is disabling JNDI, fixing various string substitution issues and who knows what [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2021-12-21T19:55:41Z","apple_news_api_id":"4edb021d-5501-49c9-9889-b15c7abf6f80","apple_news_api_modified_at":"2021-12-21T19:55:41Z","apple_news_api_revision":"AAAAAAAAAAD\/\/\/\/\/\/\/\/\/\/w==","apple_news_api_share_url":"https:\/\/apple.news\/ATtsCHVUBScmYibFcer9vgA","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[131,2095,84,71,48],"class_list":["post-34515","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-bug","tag-exploit","tag-java","tag-programming","tag-security"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/34515","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=34515"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/34515\/revisions"}],"predecessor-version":[{"id":34516,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/34515\/revisions\/34516"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=34515"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=34515"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=34515"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}