# GHSA-3qpm-h9ch-px3c: Remote code injection, Improper Input Validation and Uncontrolled Recursion in Log4j library

> Attackers can execute arbitrary code on servers using the Log4j library by sending malicious messages via the JNDI parser.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 6 Jan 2022

## What is GHSA-3qpm-h9ch-px3c?

GHSA-3qpm-h9ch-px3c is a code injection vulnerability in org.powernukkit:powernukkit, published on 6 Jan 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

### Summary
The version used of Log4j, the library used for logging by PowerNukkit, is subject to a remote code execution vulnerability via the ldap JNDI parser.
It's well detailed at [CVE-2021-44228](https://github.com/advisories/GHSA-jfh8-c2jp-5v3q) and  CVE-2021-45105(https://github.com/advisories/GHSA-p6xc-xr62-6r2g).

### Impact
Malicious client code could be used to send messages and cause remote code execution on the server.

### Patches
PowerNukkit `1.5.2.1` is a patch-release that only updates the Log4j version to `2.17.0` and should be used instead of `1.5.2.0`.
All versions prior to `1.5.2.1` are affected and are not patched.

### Workarounds
If you can't upgrade, you can use the `-Dlog4j2.formatMsgNoLookups=true` startup argument as remediation, as this prevents the vulnerability from happening.

### References
https://github.com/advisories/GHSA-jfh8-c2jp-5v3q
https://github.com/advisories/GHSA-p6xc-xr62-6r2g

### For more information
If you have any questions or comments about this advisory:
* Open an issue in [the PowerNukkit repository](https://github.com/PowerNukkit/PowerNukkit/issues)

## Which versions are affected by GHSA-3qpm-h9ch-px3c?

2 open source packages ship an affected version, including org.powernukkit:powernukkit.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.powernukkit:powernukkit` | Maven | All versions | 1.5.2.1 |
| `org.powernukkit:powernukkit` | Maven | All versions | 1.5.2.1 |

## How do I fix GHSA-3qpm-h9ch-px3c?

Upgrade org.powernukkit:powernukkit to 1.5.2.1 or later.

## Is GHSA-3qpm-h9ch-px3c being exploited?

There is no known exploitation of GHSA-3qpm-h9ch-px3c in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-3qpm-h9ch-px3c and fix it if it is affected.

What it is: GHSA-3qpm-h9ch-px3c is a code injection vulnerability in org.powernukkit:powernukkit, published on 6 Jan 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-3qpm-h9ch-px3c in the wild and no public exploit code.

Affected packages and fixed versions:
- org.powernukkit:powernukkit (Maven): affected all versions; fixed in 1.5.2.1
- org.powernukkit:powernukkit (Maven): affected all versions; fixed in 1.5.2.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-3qpm-h9ch-px3c/ (Markdown: https://insights.sbomify.com/GHSA-3qpm-h9ch-px3c/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-3qpm-h9ch-px3c

---
From sbomify Insights: https://insights.sbomify.com/GHSA-3qpm-h9ch-px3c/
Summaries are generated and may contain mistakes; the official description above is the record.
