Class ParanoidObjectDataInputStream
java.lang.Object
java.io.InputStream
com.hazelcast.internal.serialization.impl.ObjectDataInputStream
com.atlassian.confluence.impl.cluster.hazelcast.interceptor.authenticator.ParanoidObjectDataInputStream
- All Implemented Interfaces:
com.hazelcast.internal.nio.DataReader,com.hazelcast.nio.ObjectDataInput,com.hazelcast.nio.VersionAware,com.hazelcast.nio.WanProtocolVersionAware,com.hazelcast.spi.impl.SerializationServiceSupport,Closeable,DataInput,AutoCloseable
public class ParanoidObjectDataInputStream
extends com.hazelcast.internal.serialization.impl.ObjectDataInputStream
A subclass of Hazelcast's
ObjectDataInputStream specifically for use during join
checks which applies bounds to certain operations.
What this class overrides and what it doesn't is strongly influenced by what methods the join check implementations
actually call. For example, any of the read*Array methods could also be used to try and instantiate arrays
of unrealistic size and trigger OutOfMemoryErrors. However, the join checks never call those methods, so in
practice there's no vulnerability there.
- Since:
- 7.17.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.hazelcast.version.Versionprotected com.hazelcast.version.Version -
Constructor Summary
ConstructorsConstructorDescriptionParanoidObjectDataInputStream(InputStream in, com.hazelcast.internal.serialization.InternalSerializationService serializationService) -
Method Summary
Modifier and TypeMethodDescriptioncom.hazelcast.version.Versioncom.hazelcast.version.VersionreadUTF()OverridesObjectDataInputStream.readUTF()and applies a hard upper limit to the number of chars that can be read, to prevent malicious clients from triggeringOutOfMemoryErrorsvoidsetVersion(com.hazelcast.version.Version arg0) voidsetWanProtocolVersion(com.hazelcast.version.Version arg0) Methods inherited from class com.hazelcast.internal.serialization.impl.ObjectDataInputStream
available, close, getByteOrder, getClassLoader, getSerializationService, mark, markSupported, read, read, read, readBoolean, readBooleanArray, readByte, readByteArray, readChar, readCharArray, readData, readDataAsObject, readDouble, readDoubleArray, readFloat, readFloatArray, readFully, readFully, readInt, readIntArray, readLine, readLong, readLongArray, readObject, readObject, readShort, readShortArray, readString, readStringArray, readUnsignedByte, readUnsignedShort, readUTFArray, reset, skip, skipBytesMethods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Field Details
-
version
protected com.hazelcast.version.Version version -
wanProtocolVersion
protected com.hazelcast.version.Version wanProtocolVersion
-
-
Constructor Details
-
ParanoidObjectDataInputStream
public ParanoidObjectDataInputStream(InputStream in, com.hazelcast.internal.serialization.InternalSerializationService serializationService)
-
-
Method Details
-
readUTF
OverridesObjectDataInputStream.readUTF()and applies a hard upper limit to the number of chars that can be read, to prevent malicious clients from triggeringOutOfMemoryErrors- Specified by:
readUTFin interfaceDataInput- Specified by:
readUTFin interfacecom.hazelcast.nio.ObjectDataInput- Overrides:
readUTFin classcom.hazelcast.internal.serialization.impl.ObjectDataInputStream- Returns:
- the UTF string, or
nullif the requested length is -1 - Throws:
IOException- if data cannot be read from the streamUTFDataFormatException- if the string length to read is excessively long
-
getWanProtocolVersion
public com.hazelcast.version.Version getWanProtocolVersion()- Specified by:
getWanProtocolVersionin interfacecom.hazelcast.nio.WanProtocolVersionAware
-
setWanProtocolVersion
public void setWanProtocolVersion(com.hazelcast.version.Version arg0) - Specified by:
setWanProtocolVersionin interfacecom.hazelcast.nio.WanProtocolVersionAware
-
getVersion
public com.hazelcast.version.Version getVersion()- Specified by:
getVersionin interfacecom.hazelcast.nio.VersionAware
-
setVersion
public void setVersion(com.hazelcast.version.Version arg0) - Specified by:
setVersionin interfacecom.hazelcast.nio.VersionAware
-