Skip to content
RCE Write-up Intermediate

How to avoid losing your Minecraft server due to dangerous mods

The Integrated Scripting mod allowed scripts to access Java reflection via the Polyglot library, enabling arbitrary code execution on the Minecraft server. An attacker could run any OS command or add themselves to the server admin list.

medium.com

Published on medium.com

I’m sure many Minecraft server owners have experienced players trying to hack into their server and give themselves administrator privileges. Of course, such behavior isn’t limited to gaming, so I study it out of pure scientific curiosity to understand how and why it happens.

Unicorn Developer, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The mod used HostAccess.ALL in the Polyglot context, which grants unrestricted access to Java reflection, allowing scripts to execute arbitrary code.

Impact

An attacker could execute arbitrary OS commands on the server or add players to the admin list, but the vulnerability was fixed in version 1.0.17.

What the attacker needed

Minecraft server with vulnerable mod version; ability to create and use scripts in-game

How it was found

  1. Set up a Minecraft 1.21.1 server with the specified mod versions.
  2. Build a structure with chests, a scripting terminal, an item interface, an item exporter, logical cables, and a scripting drive.
  3. Insert a script that uses reflection to execute a command into a Variable Card and place it in the exporter.
  4. Put items in the chest to trigger the script.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A Minecraft mod let players write JavaScript that runs on the server. Because of a setting, those scripts could use a Java feature called reflection to run any command on the server, like opening Notepad or editing the admin list. This is dangerous because a player could take over the server.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.