CraftBook 3

CraftBook 3

139k Downloads

EffectData validation for Particle Effect with effectId = 2001

avas opened this issue ยท 1 comments

commented

Steps to reproduce:

  1. Start craftbukkit with WorldEdit and Craftbook (I used craftbukkit-1.2.5-r4.0, WorldEdit 5.3 and craftbook-r594).
  2. Create IC with the following text:

[MC1210]
2001:256
1
  1. Place a wall button to power it up (i.e. like this: http://www.shareurpic.com/images/8832012_07_01_13.19.32.png ).
  2. Push the button.

Actual result: client will instantly crash.
Expected result: nothing bad should happen.

I think this issue is serious. Consider somebody placing powered MC0210 with effect 2001:256 (or any other effectData value larger than 255) near the spawn area. Players will not be able to log in and get out of this IC, and even OPs will not be able to turn off that IC, unless the server admin will disable craftbook and destroy the IC.

Quick workaround may look like this (after try-catch code block getting effectData from IC sign):

if (effectId == org.bukkit.Effects.STEP_SOUND && effectData > 255) effectData = 0;
commented

I fixed it by making sure the id is valid