> ## Content Index
> Fetch the complete content index at: https://sudosecurity.org/llms.txt
> Use this file to discover other available public pages before exploring further.

# Every Plugin You Install Is Arbitrary Code Execution
- URL: https://sudosecurity.org/minecraft-plugin-supply-chain-security/
- Published: 2026-11-16T05:40:19.000Z
- Updated: 2026-11-16T05:40:19.000Z
- Description: A Minecraft plugin is a JAR loaded into your server's JVM with no sandbox, no permission model, and full access to the filesystem and network.
- Author: Santhdium
- Tags: Minecraft, Cybersecurity, Vulnerabilities, Self Hosting, Java, Systems Administration, Minecraft Mondays

Here is what happens when you drop a JAR into `plugins/` and restart.

The server hands the file to a class loader, resolves the `main` class named in `plugin.yml`, and instantiates it. From that moment the plugin is running inside your server's JVM with exactly the same privileges as the server itself. It can read any file the process can read. It can open any network connection. It can spawn processes. It can load more classes from a URL at runtime.

There is no sandbox. There is no permission manifest. Nothing asks whether a chat-formatting plugin should be making outbound HTTPS requests at three in the morning.

The permission system you're thinking of — `plugin.yml`, `permissions:`, `op` — governs what *players* can do through a plugin. It governs nothing about what the plugin does to your machine.

That's not a flaw in Bukkit's design so much as an unavoidable consequence of it. A plugin API expressive enough to let someone write WorldGuard is expressive enough to let someone write a keylogger. The two capabilities are the same capability.

## The Code Runs Before Your Code Does

It's worth being precise about *when* a plugin starts executing, because the usual mental model — "it runs when `onEnable()` fires" — is wrong in a way that matters.

From `PluginClassLoader.java` in the [Bukkit](https://github.com/Bukkit/Bukkit?ref=sudosecurity.org) repository, the loader is a plain `URLClassLoader` pointed at the JAR:

```java
final class PluginClassLoader extends URLClassLoader {

```

```java
        super(new URL[] {file.toURI().toURL()}, parent);

```

And the main class is resolved like this:

```java
            Class<?> jarClass;
            try {
                jarClass = Class.forName(description.getMain(), true, this);
            } catch (ClassNotFoundException ex) {
                throw new InvalidPluginException("Cannot find main class `" + description.getMain() + "'", ex);
            }

```

The second argument to `Class.forName` is `initialize`. Passing `true` means the JVM runs the class's static initializer as part of resolving it — before the constructor, before `onLoad()`, before `onEnable()`, before any lifecycle hook a server owner would think to reason about.

So a static initializer in a plugin's main class is not "early." It is the first thing that happens. Remember that for the next section, because it is exactly where the 2023 payload lived.

## June 2023

The theoretical version of all this got tested, and the results are worth going through in detail because almost every assumption people rely on failed at once.

Starting around April 2023 and breaking publicly on **6 June 2023**, attackers compromised accounts on **CurseForge** and **dev.bukkit.org** and pushed malicious updates to existing, popular projects. The malware was named **fractureiser**.

The [fractureiser investigation team](https://github.com/fractureiser-investigation/fractureiser?ref=sudosecurity.org) documented it as four stages, and the division of labour is the interesting part — each stage does one job and fetches the next.

**Stage 0** is the part that shipped inside the JAR: a new static method inserted into the project's main class, with obfuscated strings, called from that class's **static initializer**. Per the paragraph above, that means it fired the instant the server resolved the plugin's main class. Its only job was to download and load a remote class loader payload.

**Stage 1** (`dl.jar`) is that loader. It checks a system property so it doesn't run twice, contacts command-and-control, downloads stage 2, and establishes persistence — **on Linux via systemd unit files**, on Windows via the Run registry key or the Startup folder. Note which of those two is a server.

**Stage 2** (`lib.jar`, also seen as `libWebGL64.jar`) is a heavily obfuscated bootstrap. It opens a local port, checks in with C&C for update instructions roughly **every five seconds**, then fetches, hides and launches stage 3.

**Stage 3** (`client.jar`) is the payload. It reads Microsoft and Minecraft login tokens from several launchers and from the Windows Credential Manager, lifts Discord tokens plus cookies and saved logins from Chromium- and Firefox-based browsers, goes after crypto wallets, and replaces cryptocurrency addresses on the clipboard with the attacker's own. Luna Pixel Studios, quoted in [Prism Launcher's advisory](https://prismlauncher.org/news/cf-compromised-alert/?ref=sudosecurity.org), described it as additionally usable as a botnet and as leaving a backdoor behind.

And then the part that makes it a supply-chain incident rather than a malware incident. Stage 3 scans the filesystem for JARs that look like **Forge, Fabric, Bukkit, Bungee or vanilla** Minecraft artifacts — or any JAR with a main class at all — and injects the stage 0 backdoor into them.

Stage 3 was later swapped for a different JAR the investigators describe as an updater for a separate Minecraft malware family, continuing the same credential and clipboard theft with Task Scheduler and systemd persistence. The campaign was maintained, not fired once.

### These Were Plugins, Not Just Mods

Most coverage at the time framed this as a mods-and-modpacks story. The affected-project list says otherwise. From Prism Launcher's advisory, the Bukkit side alone:

> Display Entity Editor · Haven Elytra · The Nexus Event Custom Entity Editor · Simple Harvesting · MCBounties · Easy Custom Foods · Anti Command Spam Bungeecord Support · Ultimate Leveling · Anti Redstone Crash · Hydration · Fragment Permission Plugin · No VPNS · Ultimate Titles Animations Gradient RGB · Floating Damage

Fourteen server-side plugins. Permissions, anti-crash, anti-VPN, bounties, harvesting, chat titles — the ordinary furniture of a mid-sized SMP. Nothing exotic, nothing you'd hesitate over.

And the targeting was not incidental. Luna Pixel Studios' assessment, as carried by Prism Launcher, was that the code **"mainly targets Linux users, likely with the intent of infecting servers,"** while adding that it **"will still affect people on Windows."**

That reframes the whole incident. The desktop credential theft was real and widespread, but the Linux persistence path, the systemd units, and a plugin distribution channel point the same direction: servers were a goal, not collateral.

One honest footnote, because it's the kind of detail that gets left out of incident writeups. Prism Launcher noted the Linux persistence service may not have worked at all, owing to an invalid `WantedBy` field in the generated unit. The server-side half of this campaign was partly saved by the attacker fumbling a systemd directive. That is not a control you get to rely on twice.

## Four Assumptions That Failed

**"I have 2FA on my account."** Prism Launcher's advisory is blunt about it: **"The affected accounts had two-factor authentication enabled."** The team considered a simple password compromise unlikely and pointed at auth token theft or something at the platform layer. Second factors protect a login. They do nothing for a stolen session token, and nothing at all if the weakness is on the far side of the login.

**"I only download from official repositories."** CurseForge and dev.bukkit.org *are* the official repositories. That's where it came from.

Modrinth is the instructive counterexample, and not for the reason people usually cite. It scanned ten months of uploads and found nothing infected — but the investigation team's own framing of that result was that it was **"entirely luck,"** and that Modrinth "is just as safe as CurseForge is." A platform that happened not to be targeted this time is not a platform with a structural defence. Treat the clean scan as a data point about June 2023, not a reason to pick a host.

**"I'll check the changelog."** The malicious updates were **archived immediately after upload**, which, per Prism Launcher, means they *"do not show on the web UI, only via the API."* The compromise was invisible on the website and live in the download path at the same time. Luna Pixel Studios also noted the archiving was the attacker's own doing, leaving the files available to resurface.

**"My other plugins are fine, I got them elsewhere."** Stage 3 infected JARs by shape, not by origin. Minecraft itself, unrelated Java applications, plugins downloaded from anywhere. Once one infected file executed, the provenance of everything else stopped mattering.

That fourth point is the one worth dwelling on, because it changes what "clean" means. A plugin's trustworthiness is not a property of where you got it. It's a property of every machine that JAR has passed through.

This is the same shape as the dependency problem everywhere else — a trusted name, a version bump, no review step. If you want the comparison outside the JVM, [npm's version of this argument](https://sudosecurity.org/npm-dependency-security-before-ci-trust-decisions-2026/) turns on exactly the same question of where trust is actually being decided.

## What Makes Servers Worse Than Desktops

A compromised desktop is a bad week. A compromised *server* is a different kind of problem.

**It runs unattended.** Nobody is watching a headless box at 4am, and stage 2's five-second check-in loop does not need anyone to be.

**It holds other people's data.** Player IPs, chat logs, staff credentials in plugin configs, database passwords, your proxy forwarding secret.

**It has a long-lived trust relationship with the rest of your network.** A malicious plugin on your survival server can reach your database, your proxy, and every other backend — exactly the position a firewall can't help with, because those connections are supposed to happen.

That relationship is more generous than most people realise. If you run a proxy, a backend plugin can send messages on the `bungeecord:main` channel and the proxy will act on them: subchannels including `ConnectOther`, `KickPlayer`, `IPOther` and `ServerIP` let a plugin move arbitrary players between servers, disconnect anyone, read another player's IP address and port, and enumerate your backends. No proxy plugin, no proxy permissions, no filesystem access needed — just the compatibility channel, which is enabled by default. One compromised plugin on the least important server on your network is a read on every player's address. [The proxy side of this](https://sudosecurity.org/minecraft-proxy-security-velocity-forwarding/) goes through the full capability list.

**It runs as whatever user you started it as.** On an unfortunate number of self-hosted boxes, that's root.

## Containing It

You cannot audit every plugin. Nobody does. What you can do is arrange things so that one bad JAR is a bad day rather than a rebuild.

### Stop running as root

If your server process is root, a malicious plugin owns the machine outright — it can install a persistent service, read `/etc/shadow`, and touch every other container on the host.

```bash
sudo useradd -r -m -d /opt/minecraft -s /usr/sbin/nologin minecraft
sudo chown -R minecraft:minecraft /opt/minecraft

```

Run the server as that user. It's five minutes and it's the single highest-value thing on this list.

### Filter outbound traffic

Inbound firewalling is standard. Outbound almost never is, and outbound is how a stage 0 loader fetches its payload and how a stolen credential leaves.

A Minecraft server needs remarkably little egress: Mojang's session and API endpoints, your database if it's remote, Maven for any plugin that resolves libraries at boot — more on that below — and whatever else your plugins genuinely require. Everything beyond that can go.

```bash
# Default deny on egress, then allow what's needed
sudo ufw default deny outgoing
sudo ufw allow out 53          # DNS
sudo ufw allow out 443         # Mojang session/API, plugin updates
sudo ufw allow out to 10.0.0.20 port 3306   # your database

```

You will break something the first time. That's the point — you'll find out what your plugins actually talk to, which is information you didn't have.

### Use systemd's sandbox

There is a certain symmetry in using systemd to contain malware that wanted systemd for persistence. Several one-line hardening directives cost nothing:

```ini
[Service]
User=minecraft
ProtectSystem=strict
ProtectHome=true
PrivateTmp=true
NoNewPrivileges=true
ReadWritePaths=/opt/minecraft

```

`ProtectSystem=strict` is the heavy one. Per [systemd's own documentation](https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html?ref=sudosecurity.org), it mounts "the entire file system hierarchy read-only, except for the API file system subtrees `/dev/`, `/proc/` and `/sys/`," with `ReadWritePaths=` punching the holes back. A plugin that tries to drop a unit file in `/etc/systemd/system` fails. Self-propagation to JARs outside `/opt/minecraft` fails. It defaults to off, so you get none of this unless you ask.

`NoNewPrivileges=true` "ensures that the service process and all its children can never gain new privileges through `execve()`" via setuid, setgid or file capabilities. Also off by default.

Now the parts people get wrong, because this is a list that is widely copy-pasted and widely misread.

**`ProtectHome=true` is probably doing nothing for you here.** It makes `/home/`, `/root` and `/run/user` inaccessible — and systemd states flatly that it "provides no protection if home directories are placed at a non-standard location, i.e. outside of the hierarchies listed above." The `useradd` line above puts this service account's home at `/opt/minecraft`, which is exactly such a location. Keep the directive, because it does block a payload from reading `/home/you/.ssh`, but do not imagine it is protecting the server directory. The thing protecting the server directory is that nothing else is writable.

**`ProtectSystem=strict` plus `PrivateTmp=true` leaves you writable temp space.** systemd is explicit: "if `ProtectSystem=` is set to strict and `PrivateTmp=` is enabled, then `/tmp/` and `/var/tmp/` will be writable." That is the correct behaviour and it is what the JVM needs, but it means "the filesystem is read-only" is not literally true. A stage-2 bootstrap that only wants somewhere to stage a download has somewhere.

**`NoNewPrivileges=` does not cover everything the process can ask for.** The documentation notes it "has no effect on processes potentially invoked on request of them through tools such as `at`, `crontab`, `systemd-run`, or arbitrary IPC services." If your service account can talk to a privileged D-Bus service or write a crontab, that is a path around it.

None of that makes the block not worth adding — it converts a total compromise into a contained one, which is the whole objective. It is worth knowing precisely what you bought, and systemd says so itself: "This setting cannot ensure protection in all cases."

### Pin versions, and don't auto-update

Plugin auto-updaters are a mechanism for executing whatever the vendor pushes, with no review step. Fractureiser's entire distribution mechanism was updates to projects people already trusted.

Pin versions. Update deliberately. Keep the JARs you're running in version control or a local artifact store, so "what changed" is answerable.

Be aware that pinning the plugin does not pin everything it loads. A plugin whose declared coordinates name an exact version is reproducible; one that resolves a range, or that depends on something which does, is not. The section after next deals with that.

The investigation team's advice to users during the incident was to avoid updating mods at all for the duration. That is not a workable permanent policy, but it is the right instinct about where the risk sits: not in running old code, in accepting new code.

### Watch the filesystem

A modification to a JAR you didn't touch is a high-signal event and trivially detectable:

```bash
# Baseline
sha256sum /opt/minecraft/plugins/*.jar > /opt/minecraft/plugins.sha256

# Check (cron this)
sha256sum -c /opt/minecraft/plugins.sha256

```

If a plugin's hash changes and you didn't update it, you have your answer immediately. Because stage 3 rewrote JARs in place to propagate, this one check would have caught it on any machine running it.

It also has a hole in it, which is the next section.

### The Code That Isn't in the JAR

Everything above assumes the JAR is the plugin. On modern Paper, it often isn't.

A plugin can declare Maven coordinates in its `plugin.yml` and the server will fetch them at load time. From Bukkit's own Javadoc for the field:

> Gets the libraries this plugin requires. This is a preview feature. Libraries must be GAV specifiers and are loaded from Maven Central.

```yaml
libraries:
    - com.squareup.okhttp3:okhttp:4.9.0

```

`LibraryLoader` turns each entry into a dependency, resolves it with Aether, and adds the resulting JARs to the plugin's classloader URLs. Resolution is transitive, so one coordinate can pull in a tree of others. The artifacts land in a `libraries/` directory in your server root — `new LocalRepository("libraries")` in the loader's constructor — and it announces what it is doing. The loader's three format strings, with their arguments filled in, produce lines shaped like this — reconstructed from `LibraryLoader`'s own `logger.log` calls rather than captured from a run:

```
[PluginName] Loading 1 libraries... please wait
Downloading <repository-url><artifact-path>
[PluginName] Loaded library libraries/com/squareup/okhttp3/okhttp/4.9.0/okhttp-4.9.0.jar

```

Note that the count in the first line is the number of entries you *declared*, not the number of JARs that arrive. One coordinate with a dependency tree produces one line of "Loading 1 libraries" and several `Loaded library` lines. The count is not an inventory.

Paper's newer plugin format widens this. A Paper plugin can declare a `PluginLoader` whose job is to build its own classpath, using `MavenLibraryResolver` with **repositories of the plugin's choosing** rather than only Central. Paper's documentation asks authors to point that at Paper's mirror instead of hitting Central's hosts directly, which is a load and terms-of-service matter rather than a security one. The security consequence is the shape of the thing: a JAR in `plugins/` can nominate a repository you have never heard of and have its contents loaded into your server's JVM at boot.

So the honest accounting on the hash check in the previous section: `sha256sum -c` over `plugins/*.jar` covers the plugin and nothing it pulls in. Baseline `libraries/` too, or you are monitoring the smaller half of your attack surface.

One point in Paper's favour, because this is not all bad news. The loader sets `RepositoryPolicy.CHECKSUM_POLICY_FAIL`, so Aether verifies each artifact against the repository's published checksum and a mismatch is fatal rather than a warning. That is worth having. Be precise about what it proves, though: the checksum is published by the same repository that serves the artifact. It defends against corruption and tampering *in transit*. It does nothing about a repository that has been compromised, or a maintainer who pushed a malicious release, which is the failure mode this entire article is about.

Two things worth doing today:

```bash
# What is actually on your plugins' classpath?
find libraries -name '*.jar' | sort

# Where did it come from? (the loader logs every fetch)
grep -E 'Downloading |Loaded library ' logs/latest.log

```

If that first command surprises you, that is the finding.

### Look inside before you trust

For a plugin from an unfamiliar source, a JAR is a zip file and decompilers are free:

```bash
unzip -l plugin.jar          # what's actually in here?
unzip -p plugin.jar plugin.yml paper-plugin.yml 2>/dev/null   # what will it go and fetch?
strings plugin.jar | grep -Ei 'http://|https://|URLClassLoader|Runtime.exec'

```

That second line is the one people skip. A `libraries:` list or a `loader:` entry tells you the JAR is not the whole program before you ever run it, and a repository URL you don't recognise in there is a decision to make consciously rather than at boot.

None of it is a guarantee. Fractureiser's stage 0 obfuscated its strings specifically to defeat the third line, so a clean `strings` result proves nothing. It is a cheap filter for the unsophisticated case, not an audit. Dedicated scanners for this family exist and the investigation team lists several.

## What to Do If You Suspect a Compromise

Order matters here.

**Take it offline first.** Don't "investigate while it runs." Stage 2 was polling for new instructions every five seconds.

**Rotate everything the process could read.** Database credentials, RCON password, your proxy forwarding secret, any API tokens in plugin configs, staff account passwords stored anywhere near that box. Do it from a different machine. Assume all of it is gone.

**Rebuild rather than clean.** Self-propagating malware that injects into arbitrary JARs is not something you remove file by file with confidence. Fresh install, worlds restored from a backup predating the suspicion, plugins re-downloaded and hash-verified. Delete `libraries/` as well and let it repopulate — stage 3 injected into any JAR with a main class, and a resolved dependency cached on disk is a JAR on disk. The investigation team's own guidance for infected systems is to assume full compromise and reinstall.

**Then check what it could reach.** Every machine that box had credentials for or a network path to.

## What This Doesn't Cover

**Malicious plugins written to be malicious.** Everything above is about a trusted project being compromised. A plugin that was hostile from its first release defeats version pinning and hash monitoring entirely, because the hash you baselined is already the bad one.

**Cleaning up an infected desktop.** The credential-theft half of the payload landed on players' machines, and recovering one of those — which browsers to assume are compromised, which tokens to revoke, whether to trust the machine afterwards — is a different article with different advice. The investigation team's own user guide is the right starting point.

**Anything resembling a sandbox.** None of this makes plugin code safe to run, and that gap is getting wider rather than narrower. The `SecurityManager` that might once have been bent into this shape was deprecated for removal in JDK 17 by [JEP 411](https://openjdk.org/jeps/411?ref=sudosecurity.org), and [JEP 486](https://openjdk.org/jeps/486?ref=sudosecurity.org) in JDK 24 made it impossible to enable at all — attempting to install one is now an error, and its methods return null, return false, or throw. If you are running a modern JDK, in-JVM privilege separation for plugins is not merely unsupported, it has been removed as an option. Containment has to happen at the OS boundary, which is what the rest of this article is about.

Worth knowing that the platform is moving the other way on a related vector. A JVM process can use the Attach API to load a Java agent into itself at runtime, and an agent can redefine JDK classes and walk straight through strong encapsulation. Any in-process guard a server or plugin might implement is therefore defeated by a plugin that simply attaches one.

[JEP 451](https://openjdk.org/jeps/451?ref=sudosecurity.org) began closing that: dynamic agent loading now warns, and the stated plan is to disallow it by default, controlled by `-XX:+EnableDynamicAgentLoading`. The JEP is clear-eyed about the trade — "Giving free reign to tools would imply giving free reign to libraries, which is tantamount to giving up on integrity by default." That is the argument this article opens with, made by the people who maintain the JVM.

It is not a control you can rely on yet, and turning dynamic loading off may break a profiler you use. But if you run a server where plugin code is only semi-trusted, `-XX:-EnableDynamicAgentLoading` is a flag worth knowing exists.

**Paper's classloader isolation.** Paper plugins, per its documentation, "are not able to access each other unless given explicit access by depending on another plugin." That is a real improvement over the shared-classloader past and it limits one plugin's reach into another's internals. It is not a security boundary against the OS, it is opt-out by design — `join-classpath: true` on a dependency hands access over — and it does nothing about a plugin's own full-privilege access to your filesystem and network.

**Compromise of the server JAR itself.** Paper, Purpur and friends ship from their own build infrastructure. That's a separate trust root with separate failure modes, and if you want the map of which fork you're actually running, [the server software guide](https://sudosecurity.org/minecraft-server-jar-guide/) covers it.

## The Honest Position

There is no way to run third-party plugins and be certain they're safe. The API can't offer that, and any advice that implies otherwise is selling something.

What you can do is stop treating "it's a popular plugin from an official repository" as a security control, because in June 2023 that exact description covered fourteen Bukkit plugins and a comparable list on the CurseForge side. Popularity is a reason attackers target something, not a reason to trust it.

So: least privilege, egress filtering, version pinning, hash monitoring, and a backup you have actually restored from at least once. None of it prevents a malicious plugin. All of it decides how much a malicious plugin costs you.

And if you run a network, [the proxy side has its own version of this problem](https://sudosecurity.org/minecraft-proxy-security-velocity-forwarding/) — backends that trust anything reaching them, for structurally similar reasons. Worth noting that stage 3 scanned for Bungee JARs by name. The proxy was on the target list too.