Share
## https://sploitus.com/exploit?id=2A95146E-A404-5015-9D39-293C8EAFF4B6
# CVE-2021-44228

[![Dockerfile](https://github.com/ahmad4fifz/CVE-2021-44228/actions/workflows/test-dockerfile.yml/badge.svg)](https://github.com/ahmad4fifz/CVE-2021-44228/actions/workflows/test-dockerfile.yml)  [![docker-compose](https://github.com/ahmad4fifz/CVE-2021-44228/actions/workflows/test-docker-compose.yml/badge.svg)](https://github.com/ahmad4fifz/CVE-2021-44228/actions/workflows/test-docker-compose.yml)

This is the deployment for [Spring Boot app](https://github.com/ahmad4fifz/log4shell-vulnerable-app) with Apache Log4j2 that is vulnerable to [CVE-2021-44228](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44228) either using **docker-compose** or **Podman**.

## Description:

Apache Log4j2 <=2.14.1 JNDI features used in configuration, log messages, and parameters do not protect against attacker controlled LDAP and other JNDI related endpoints. An attacker who can control log messages or log message parameters can execute arbitrary code loaded from LDAP servers when message lookup substitution is enabled. From log4j 2.15.0, this behavior has been disabled by default. In previous releases (>2.10) this behavior can be mitigated by setting system property "log4j2.formatMsgNoLookups" to &#8220;true&#8221; or it can be mitigated in prior releases (<2.10) by removing the JndiLookup class from the classpath (example: zip -q -d log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class).

## Deployment:

### Using docker-compose:

```
docker-compose up -d
```

### Using podman: (not tested)

```
sudo podman build -t ahmad4fifz/cve-2021-44228 app/.
sudo podman play kube pods/cve-2021-44228-pod
```

## References:

- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44228
- https://nvd.nist.gov/vuln/detail/CVE-2021-44228
- https://logging.apache.org/log4j/2.x/security.html
- https://www.forescout.com/blog/forescout%E2%80%99s-response-to-cve-2021-44228-apache-log4j-2/
- https://www.docker.com/blog/apache-log4j-2-cve-2021-44228/

## License

Released under [MIT](/LICENSE) by [@ahmad4fifz](https://github.com/ahmad4fifz).