mirror of
https://github.com/GTNewHorizons/EnderCore.git
synced 2026-11-12 00:07:38 +00:00
fix serialization exploit (#9)
This commit is contained in:
1 parent
e1778d1013
commit
68ba8bc29d
1 file changed
+11
@@ -1,5 +1,7 @@
|
||||
package com.enderio.core.common.config;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
@@ -50,9 +52,18 @@ public class PacketConfigSync implements IMessage {
|
||||
ByteBufUtils.writeUTF8String(buf, modid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Pa4ok
|
||||
* you can trick forge network system & send client packet to server
|
||||
* and then use different hacks with serialization of untrusted data
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void fromBytes(ByteBuf buf) {
|
||||
if(FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER) {
|
||||
return;
|
||||
}
|
||||
|
||||
short len = buf.readShort();
|
||||
byte[] compressedBody = new byte[len];
|
||||
|
||||
|
||||
Reference in new issue
Block a user