code
stringlengths
14
2.05k
label
int64
0
1
programming_language
stringclasses
7 values
cwe_id
stringlengths
6
14
cwe_name
stringlengths
5
98
description
stringlengths
36
379
url
stringlengths
36
48
label_name
stringclasses
2 values
public void writeData(LPDataOutput output) throws IOException {}
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void readData(LPDataInput input) throws IOException { msg = new ExitRoute[input.readInt()]; for (int i = 0; i < msg.length; i++) { msg[i] = input.readExitRoute(MainProxy.getClientMainWorld()); } }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void writeData(LPDataOutput output) throws IOException { output.writeInt(msg.length); for (ExitRoute element : msg) { output.writeExitRoute(element); } }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void writeData(LPDataOutput output) throws IOException { output.writeEnumSet(set, PipeRoutingConnectionType.class); output.writeLPPosition(pos); }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void readData(LPDataInput input) throws IOException { set = input.readEnumSet(PipeRoutingConnectionType.class); pos = input.readLPPosition(); }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void readData(LPDataInput input) throws IOException { pos = input.readLPPosition(); filterPositions = new EnumMap<>(PipeRoutingConnectionType.class); short id; while ((id = input.readShort()) != -1) { PipeRoutingConnectionType type = PipeRoutingConnectionType.values[id]; List<List<DoubleCoordinates>> typeFilters = new ArrayList<>(); int length; while ((length = input.readShort()) != -1) { List<DoubleCoordinates> linkedFilter = new ArrayList<>(); for (int i = 0; i < length; i++) { linkedFilter.add(input.readLPPosition()); } typeFilters.add(linkedFilter); } filterPositions.put(type, typeFilters); } }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void writeData(LPDataOutput output) throws IOException { output.writeLPPosition(pos); for (PipeRoutingConnectionType type : filters.keySet()) { output.writeShort(type.ordinal()); for (List<IFilter> linkedFilter : filters.get(type)) { output.writeShort(linkedFilter.size()); for (IFilter filter : linkedFilter) { output.writeLPPosition(filter.getLPPosition()); } } output.writeShort(-1); } output.writeShort(-1); }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void writeData(LPDataOutput output) throws IOException {}
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void readData(LPDataInput input) throws IOException {}
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void writeData(LPDataOutput output) throws IOException {}
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void readData(LPDataInput input) throws IOException {}
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void writeData(LPDataOutput output) throws IOException { output.writeExitRoute(exitRoute); }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void readData(LPDataInput input) throws IOException { exitRoute = input.readExitRoute(MainProxy.getClientMainWorld()); }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public RoutingUpdateTargetResponse(int id) { super(id); }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void processPacket(final EntityPlayer player) { if (mode == TargetMode.None) { player.addChatMessage(new ChatComponentText(ChatColor.RED + "No Target Found")); } else if (mode == TargetMode.Block) { int x = (Integer) additions[0]; int y = (Integer) additions[1]; int z = (Integer) additions[2]; player.addChatMessage(new ChatComponentText("Checking Block at: x:" + x + " y:" + y + " z:" + z)); Block id = player.worldObj.getBlock(x, y, z); player.addChatMessage(new ChatComponentText("Found Block with Id: " + Block.getIdFromBlock(id))); final TileEntity tile = player.worldObj.getTileEntity(x, y, z); if (tile == null) { player.addChatMessage(new ChatComponentText(ChatColor.RED + "No TileEntity found")); } else if (!(tile instanceof LogisticsTileGenericPipe)) { player.addChatMessage(new ChatComponentText(ChatColor.RED + "No LogisticsTileGenericPipe found")); } else if (!(((LogisticsTileGenericPipe) tile).pipe instanceof CoreRoutedPipe)) { player.addChatMessage(new ChatComponentText(ChatColor.RED + "No CoreRoutedPipe found")); } else { LPChatListener.addTask(() -> { player.addChatMessage(new ChatComponentText(ChatColor.GREEN + "Starting RoutingTable debug update.")); DebugController.instance(player).debug(((ServerRouter) ((CoreRoutedPipe) ((LogisticsTileGenericPipe) tile).pipe).getRouter())); MainProxy.sendPacketToPlayer(PacketHandler.getPacket(OpenChatGui.class), player); return true; }, player); player.addChatMessage(new ChatComponentText( ChatColor.AQUA + "Start RoutingTable debug update ? " + ChatColor.RESET + "<" + ChatColor.GREEN + "yes" + ChatColor.RESET + "/" + ChatColor.RED + "no" + ChatColor.RESET + ">")); MainProxy.sendPacketToPlayer(PacketHandler.getPacket(OpenChatGui.class), player); } } else if (mode == TargetMode.Entity) { player.addChatMessage(new ChatComponentText(ChatColor.RED + "Entity not allowed")); } }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void readData(LPDataInput input) throws IOException { mode = TargetMode.values()[input.readByte()]; int size = input.readInt(); additions = new Object[size]; for (int i = 0; i < size; i++) { byte[] bytes = input.readByteArray(); ByteArrayInputStream bis = new ByteArrayInputStream(bytes); ObjectInput in = new ObjectInputStream(bis); try { Object o = in.readObject(); additions[i] = o; } catch (ClassNotFoundException e) { throw new UnsupportedOperationException(e); } } }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void writeData(LPDataOutput output) throws IOException { output.writeByte(mode.ordinal()); output.writeInt(additions.length); for (Object addition : additions) { ByteArrayOutputStream bos = new ByteArrayOutputStream(); ObjectOutput out = new ObjectOutputStream(bos); out.writeObject(addition); output.writeByteArray(bos.toByteArray()); } }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void writeData(LPDataOutput output) throws IOException { output.writeInt(satID); super.writeData(output); }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void readData(LPDataInput input) throws IOException { satID = input.readInt(); super.readData(input); }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void readData(LPDataInput input) throws IOException { super.readData(input); side = input.readForgeDirection(); }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void writeData(LPDataOutput output) throws IOException { super.writeData(output); output.writeForgeDirection(side); }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void writeData(LPDataOutput output) throws IOException { super.writeData(output); output.writeForgeDirection(side); }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void readData(LPDataInput input) throws IOException { super.readData(input); side = input.readForgeDirection(); }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public boolean getTurtleConnect() { if (container instanceof LogisticsTileGenericPipe) { return container.getTurtleConnect(); } return false; }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void readData(LPDataInput input) throws IOException { isOpaqueClientSide = input.readBoolean(); }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void setTurtleConnect(Boolean flag) { if (container instanceof LogisticsTileGenericPipe) { container.setTurtleConnect(flag); } }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void writeData(LPDataOutput output) throws IOException { output.writeBoolean(isOpaque()); }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void readData(LPDataInput input) throws IOException { pipeId = input.readInt(); }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void setTurtleConnect(boolean flag) { SimpleServiceLocator.ccProxy.setTurtleConnect(flag, this); }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void writeData(LPDataOutput output) throws IOException { output.writeInt(pipeId); }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void writeData(LPDataOutput output) throws IOException { if (orientation == null) { output.writeBoolean(false); } else { output.writeBoolean(true); output.writeEnum(orientation); } }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void setOnPipe(CoreMultiBlockPipe pipe) { ((HSTubeCurve) pipe).orientation = this; }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void readData(LPDataInput input) throws IOException { if (input.readBoolean()) { orientation = input.readEnum(CurveOrientation.class); } }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void rotatePositions(IPositionRotateble set) { renderOrientation.rotatePositions(set); }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void writeData(LPDataOutput output) throws IOException { if (orientation == null) { output.writeBoolean(false); } else { output.writeBoolean(true); output.writeEnum(orientation); } }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
TubeGainRenderOrientation(ForgeDirection dir) { this.dir = dir; }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void rotatePositions(IPositionRotateble set) { renderOrientation.rotateOrientation(set); }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void setOnPipe(CoreMultiBlockPipe pipe) { ((HSTubeGain) pipe).orientation = this; }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void rotateOrientation(IPositionRotateble set) { if (this == EAST) { set.rotateRight(); } else if (this == WEST) { set.rotateLeft(); } else if (this == SOUTH) { set.rotateLeft(); set.rotateLeft(); } }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void readData(LPDataInput input) throws IOException { if (input.readBoolean()) { orientation = input.readEnum(TubeGainOrientation.class); } }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
TubeGainOrientation(TubeGainRenderOrientation render, DoubleCoordinates off, ForgeDirection dir) { renderOrientation = render; offset = off; this.dir = dir; }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void rotatePositions(IPositionRotateble set) { renderOrientation.rotateOrientation(set); }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void writeData(LPDataOutput output) throws IOException { if (orientation == null) { output.writeBoolean(false); } else { output.writeBoolean(true); output.writeEnum(orientation); } }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void setOnPipe(CoreMultiBlockPipe pipe) { ((HSTubeLine) pipe).orientation = this; }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void readData(LPDataInput input) throws IOException { if (input.readBoolean()) { orientation = input.readEnum(TubeLineOrientation.class); } }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
TubeLineRenderOrientation(ForgeDirection dir) { this.dir = dir; }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
TubeLineOrientation(TubeLineRenderOrientation render, DoubleCoordinates off, ForgeDirection dir) { renderOrientation = render; offset = off; this.dir = dir; }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void rotateOrientation(IPositionRotateble set) { if (this == EAST_WEST) { set.rotateLeft(); } }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void readData(LPDataInput input) throws IOException { if (input.readBoolean()) { orientation = input.readEnum(CurveSOrientation.class); } }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void rotatePositions(IPositionRotateble set) { renderOrientation.rotatePositions(set); }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void setOnPipe(CoreMultiBlockPipe pipe) { ((HSTubeSCurve) pipe).orientation = this; }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void writeData(LPDataOutput output) throws IOException { if (orientation == null) { output.writeBoolean(false); } else { output.writeBoolean(true); output.writeEnum(orientation); } }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void rotatePositions(IPositionRotateble set) { if (this == SOUTH) { set.rotateLeft(); set.rotateLeft(); } else if (this == EAST) { set.rotateRight(); } else if (this == WEST) { set.rotateLeft(); } }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public ITubeRenderOrientation getRenderOrientation() { return this; }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public DoubleCoordinates getOffset() { return new DoubleCoordinates(0, 0, 0); }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void readData(LPDataInput input) throws IOException { orientation = input.readEnum(SpeedupDirection.class); }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void writeData(LPDataOutput output) throws IOException { output.writeEnum(orientation); }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void setOnPipe(CoreMultiBlockPipe pipe) { ((HSTubeSpeedup) pipe).orientation = this; }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void readData(LPDataInput input) throws IOException {}
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void writeData(LPDataOutput output) throws IOException {}
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void readData_LP(LPDataInput input) throws IOException { if (input.readBoolean()) { ByteBuf buf = input.readByteBuf(); readData(buf); } }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void writeData_LP(LPDataOutput output) throws IOException { output.writeBoolean(true); ByteBuf buf = Unpooled.buffer(128); writeData(buf); output.writeByteBuf(buf); }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void writeData(LPDataOutput output) throws IOException { ByteBuf buf = Unpooled.buffer(128); this.writeData(buf); output.writeByteBuf(buf); }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void readData(LPDataInput input) throws IOException { ByteBuf buf = input.readByteBuf(); this.readData(buf); }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void writeData(LPDataOutput output) throws IOException { output.writeByte(mask); output.writeByte(isBCPipeMask); output.writeByte(isTDPipeMask); }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void readData(LPDataInput input) throws IOException { byte newMask = input.readByte(); if (newMask != mask) { mask = newMask; dirty = true; } newMask = input.readByte(); if (newMask != isBCPipeMask) { isBCPipeMask = newMask; dirty = true; } newMask = input.readByte(); if (newMask != isTDPipeMask) { isTDPipeMask = newMask; dirty = true; } }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void writeData(LPDataOutput output) throws IOException { pipeConnectionMatrix.writeData(output); textureMatrix.writeData(output); bcRenderState.writeData_LP(output); //Always needs to be last. Different length depending on proxy loading state. }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void readData(LPDataInput input) throws IOException { pipeConnectionMatrix.readData(input); textureMatrix.readData(input); bcRenderState.readData_LP(input); //Always needs to be last. Different length depending on proxy loading state. }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void readData(LPDataInput input) throws IOException { for (int i = 0; i < iconIndexes.length; i++) { int icon = input.readByte(); if (iconIndexes[i] != icon) { iconIndexes[i] = icon; dirty = true; } } textureIndex = input.readInt(); isRouted = input.readBoolean(); isRoutedInDir = input.readBooleanArray(); isSubPowerInDir = input.readBooleanArray(); hasPowerUpgrade = input.readBoolean(); hasPower = input.readBoolean(); isFluid = input.readBoolean(); pointedOrientation = input.readForgeDirection(); }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void writeData(LPDataOutput output) throws IOException { for (int iconIndexe : iconIndexes) { output.writeByte(iconIndexe); } output.writeInt(textureIndex); output.writeBoolean(isRouted); output.writeBooleanArray(isRoutedInDir); output.writeBooleanArray(isSubPowerInDir); output.writeBoolean(hasPowerUpgrade); output.writeBoolean(hasPower); output.writeBoolean(isFluid); output.writeForgeDirection(pointedOrientation); }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void setCCType(Object type) { ccObject = type; }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public DictResource(LPDataInput input) throws IOException { stack = input.readItemIdentifierStack(); requester = null; BitSet bits = input.readBitSet(); use_od = bits.get(0); ignore_dmg = bits.get(1); ignore_nbt = bits.get(2); use_category = bits.get(3); }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public Object getCCType() { return ccObject; }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void writeData(LPDataOutput output) throws IOException { output.writeItemIdentifierStack(stack); BitSet bits = new BitSet(); bits.set(0, use_od); bits.set(1, ignore_dmg); bits.set(2, ignore_nbt); bits.set(3, use_category); output.writeBitSet(bits); }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public Object getCCType() { return ccObject; }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void writeData(LPDataOutput output) throws IOException { output.writeItemIdentifier(liquid.getItemIdentifier()); output.writeInt(amount); }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public FluidResource(LPDataInput input) throws IOException { liquid = FluidIdentifier.get(input.readItemIdentifier()); amount = input.readInt(); target = null; }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void setCCType(Object type) { ccObject = type; }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public ItemResource(LPDataInput input) throws IOException { stack = input.readItemIdentifierStack(); requester = null; }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void setCCType(Object type) { ccObject = type; }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public Object getCCType() { return ccObject; }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void writeData(LPDataOutput output) throws IOException { output.writeItemIdentifierStack(stack); }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public static IResource readResource(LPDataInput input) throws IOException { int id = input.readInt(); if (id == -1) { return null; } return ResourceNetwork.values()[id].readData(input); }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
ItemResource(ItemResource.class) { @Override protected IResource readData(LPDataInput input) throws IOException { return new ItemResource(input); } },
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public static void writeResource(LPDataOutput output, IResource resource) throws IOException { if (resource == null) { output.writeInt(-1); return; } ResourceNetwork[] values = ResourceNetwork.values(); for (ResourceNetwork value : values) { if (value.clazz.isAssignableFrom(resource.getClass())) { output.writeInt(value.ordinal()); resource.writeData(output); return; } } throw new UnsupportedOperationException(resource.getClass().toString()); }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
FluidResource(FluidResource.class) { @Override protected IResource readData(LPDataInput input) throws IOException { return new FluidResource(input); } };
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
DictResource(DictResource.class) { @Override protected IResource readData(LPDataInput input) throws IOException { return new DictResource(input); } },
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void writeData(LPDataOutput output) throws IOException { output.writeInt(posX); output.writeInt(posY); output.writeInt(posZ); output.writeByte(dir.ordinal()); output.writeBoolean(finalPipe); output.writeBoolean(startPipe); output.writeInt(length); for (PipeRoutingConnectionType type : PipeRoutingConnectionType.values()) { output.writeBoolean(connectionType.contains(type)); } }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public LaserData readData(LPDataInput input) throws IOException { posX = input.readInt(); posY = input.readInt(); posZ = input.readInt(); dir = ForgeDirection.values()[input.readByte()]; finalPipe = input.readBoolean(); startPipe = input.readBoolean(); length = input.readInt(); connectionType = EnumSet.noneOf(PipeRoutingConnectionType.class); for (PipeRoutingConnectionType type : PipeRoutingConnectionType.values()) { if (input.readBoolean()) { connectionType.add(type); } } return this; }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
private static byte[] compress(byte[] content) { ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); try { GZIPOutputStream gzipOutputStream = new GZIPOutputStream(byteArrayOutputStream); gzipOutputStream.write(content); gzipOutputStream.close(); } catch (IOException e) { throw new RuntimeException(e); } return byteArrayOutputStream.toByteArray(); }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void setPause(boolean flag) { clientCompressorThread.setPause(flag); }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void clear() { clientCompressorThread.clear(); clientDecompressorThread.clear(); }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
private void handlePacketData(final Pair<EntityPlayer, byte[]> playerDataPair) { try { LPDataIOWrapper.provideData(playerDataPair.getValue2(), input -> { PacketHandler.onPacketData(input, playerDataPair.getValue1()); }); } catch (IOException e) { System.err.println("IO Error in handlePacketData for player " + playerDataPair.getValue1().getCommandSenderName()); e.printStackTrace(); } }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
private static byte[] decompress(byte[] contentBytes) { ByteArrayOutputStream out = new ByteArrayOutputStream(); try { GZIPInputStream gzip = new GZIPInputStream(new ByteArrayInputStream(contentBytes)); int buffer = 0; while ((buffer = gzip.read()) != -1) { out.write(buffer); } } catch (IOException e) { throw new RuntimeException(e); } return out.toByteArray(); }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void run() { while (true) { boolean flag; do { flag = false; byte[] buffer = null; synchronized (queue) { if (queue.size() > 0) { flag = true; buffer = queue.getFirst(); queue.removeFirst(); } } if (flag && buffer != null) { byte[] packetbytes = ClientPacketBufferHandlerThread.decompress(buffer); byte[] newBuffer = new byte[packetbytes.length + ByteBuffer.length]; System.arraycopy(ByteBuffer, 0, newBuffer, 0, ByteBuffer.length); System.arraycopy(packetbytes, 0, newBuffer, ByteBuffer.length, packetbytes.length); ByteBuffer = newBuffer; } } while (flag); while (ByteBuffer.length >= 4) { int size = ((ByteBuffer[0] & 255) << 24) + ((ByteBuffer[1] & 255) << 16) + ((ByteBuffer[2] & 255) << 8) + ((ByteBuffer[3] & 255) << 0); if (size + 4 > ByteBuffer.length) { break; } byte[] packet = Arrays.copyOfRange(ByteBuffer, 4, size + 4); ByteBuffer = Arrays.copyOfRange(ByteBuffer, size + 4, ByteBuffer.length); packetBufferLock.lock(); try { PacketBuffer.add(new Pair<>(MainProxy.proxy.getClientPlayer(), packet)); } finally { packetBufferLock.unlock(); } } synchronized (queue) { while (queue.size() == 0) { try { queue.wait(); } catch (InterruptedException e) { } } } if (clear) { clear = false; ByteBuffer = new byte[] {}; } } }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public ClientPacketBufferHandlerThread() {}
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void clientTick(ClientTickEvent event) { if (event.phase != Phase.END) { return; } clientDecompressorThread.clientTickEnd(); }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void run() { while (true) { try { synchronized (clientList) { if (!pause && clientList.size() > 0) { clientBuffer = LPDataIOWrapper.collectData(output -> { output.writeBytes(clientBuffer); clearLock.lock(); try { for (ModernPacket packet : clientList) { output.writeShort(packet.getId()); output.writeInt(packet.getDebugId()); packet.writeData(output); } } finally { clientList.clear(); clearLock.unlock(); } }); } } //Send Content if (clientBuffer.length > 0) { while (clientBuffer.length > 1024 * 32) { byte[] sendbuffer = Arrays.copyOf(clientBuffer, 1024 * 32); clientBuffer = Arrays.copyOfRange(clientBuffer, 1024 * 32, clientBuffer.length); byte[] compressed = ClientPacketBufferHandlerThread.compress(sendbuffer); MainProxy.sendPacketToServer(PacketHandler.getPacket(BufferTransfer.class).setContent(compressed)); } byte[] sendbuffer = clientBuffer; clientBuffer = new byte[] {}; byte[] compressed = ClientPacketBufferHandlerThread.compress(sendbuffer); MainProxy.sendPacketToServer(PacketHandler.getPacket(BufferTransfer.class).setContent(compressed)); } } catch (IOException e) { e.printStackTrace(); } synchronized (clientList) { while (pause || clientList.size() == 0) { try { clientList.wait(); } catch (InterruptedException e) {} } } if (clear) { clear = false; clientBuffer = new byte[] {}; } } }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void addPacketToCompressor(ModernPacket packet) { clientCompressorThread.addPacketToCompressor(packet); }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
public void handlePacket(byte[] content) { clientDecompressorThread.handlePacket(content); }
0
Java
CWE-502
Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable