mojira.dev
MC-311206

Server-sent particle packets can freeze or crash the client due to unbounded particle counts

The Minecraft client appears to accept extremely large particle counts sent by a server without applying a sufficiently strict client-side limit or particle processing budget.

A malicious or incorrectly configured server can send a particle packet requesting an absurd number of particles. The client then attempts to process/spawn the requested particles, which can cause severe lag, memory pressure, an extended freeze, or potentially a complete client crash.

This should not be possible from untrusted server input. Particle effects are cosmetic, and there is no practical reason for the client to attempt to honor arbitrarily large particle counts.

The client should enforce a reasonable upper bound on the number of particles that can be created from a single packet, as well as preferably enforce a broader per-tick or per-frame particle processing budget so that the limit cannot simply be bypassed by sending many packets.

Steps to Reproduce

  1. Join a server capable of sending custom particle packets to the client.

  2. Have the server send a particle packet with an extremely large particle count. (Can also be done in Singleplayer using the /particle command)

  3. Observe the client attempting to process the requested number of particles.

  4. With sufficiently large values, the client becomes severely unresponsive and may freeze or crash. (Stuttering starts to happen at around 100.000 particles with 10.000.000 almost always crashing the client)

Expected Result

The client should safely clamp, discard, or otherwise limit particle requests that exceed a reasonable client-side particle budget.

Excessive server-supplied particle data should never be able to consume effectively unbounded client CPU, GPU, or memory resources.

Actual Result

The client attempts to process excessively large particle requests received from the server, allowing a server to cause severe client lag, freezing, or a crash simply by sending pathological particle values.

Additional Notes

This is particularly problematic because the packet contents are controlled by a remote server and therefore should be treated as untrusted input.

A per-packet limit alone may not be sufficient, since a server could send many packets below that limit. A global particle creation/processing budget per tick or frame would provide more robust protection.

Since particles are cosmetic and non-authoritative, dropping excess particles would be preferable to allowing them to negatively affect client stability.

Linked issues

Attachments

Comments 5

Thank you for your report!

  • Can you provide logs and crash dumps? You can find them at %appdata%\.minecraft

  • Can you record a video of the issue and upload it?

  • Could you please include details about your device and system specifications (RAM, CPU, GPU)?

  • Are you using any third-party server?

  • Could you explain what do mean by “Custom particle packets“ Could you provide them?

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

Hey, here is everything you asked for:

  • The client reports an OutOfMemoryError when there are too many particles (this log is taken directly from the recorded video):

[11:42:25] [Server thread/INFO]: [RealMester: Displaying particle minecraft:angry_villager]
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Server thread"
[11:42:41] [Render thread/WARN]: Failed to get system info for Memory (heap)
java.lang.OutOfMemoryError: Java heap space
[11:42:45] [Render thread/WARN]: Could not spawn particle effect net.minecraft.core.particles.SimpleParticleType@46ea78f0
[11:42:45] [Render thread/INFO]: [System] [CHAT] Displaying particle minecraft:angry_villager
  • System specifications are provided in the debug menu in the video.

  • This bug is server-independent, it can be replicated on the internal server, but also on the dedicated vanilla server or 3rd party ones.

  • By “Custom particle packets” I generally meant any particle packet that doesn’t naturally appear during vanilla gameplay and therefore had to be manually constructed. The /particle command can achieve the same thing since it just provides a user-facing command to create a particle packet with user-provided parameters.

Please also provide the commands needed to produce the particle counts required for the crash to occur

General format: /particle <any particle> ~ ~ ~ 0 0 0 1 <high number> force @s
Examples:
/particle <any particle> ~ ~ ~ 0 0 0 1 100000 force @s
/particle <any particle> ~ ~ ~ 0 0 0 1 1000000 force @s
/particle <any particle> ~ ~ ~ 0 0 0 1 10000000 force @s

None of the settings seem to matter, as long as the particle gets rendered by the player and the count is high enough, the hang will occur. (force is used here to make sure the particle bypasses the video settings)

Usually around 10 million will hang the client for a considerably long time.

Hi!
Thank you for your report! 

We're already tracking this issue at MC-183528 , so I will resolve and link this ticket as a Duplicate. 

I suggest also to browse through the main issue for potential fixes. 

If you would like to add a vote and any extra information to the main ticket it would be appreciated. 

Quick Links: 
📓 Issue Guidelines – 💬 Mojang Support – 📧 Suggestions – 📖 Minecraft Wiki

MesterMan03

(Unassigned)

Unconfirmed

26.2

Retrieved