Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Error with a connection below 1.7 occurs #67

Open
Finoway opened this issue Aug 5, 2023 · 1 comment
Open

[Bug] Error with a connection below 1.7 occurs #67

Finoway opened this issue Aug 5, 2023 · 1 comment

Comments

@Finoway
Copy link

Finoway commented Aug 5, 2023

Hello, I've just found on NanoLimbo version 1.5.2 that if a client lower than 1.7 connects (tested in 1.6.4) it causes an error in the console and the client remains on "Logging in". Would it be possible to refuse the connection directly? As for 1.7/1.7.1, where it replies "Unsupported client version" or not to answer the client ?

What's more, if you read nanolimbo's README, you might think that it supports versions 1.7-1.7.1, but this is not the case.

Here's the error in the NanoLimbo console:

[09:39:26] [ERROR]: Unhandled exception: 
java.lang.NullPointerException: Cannot read field "serverBound" because "state" is null
        at ua.nanit.limbo.connection.pipeline.PacketDecoder.updateState(PacketDecoder.java:68)
        at ua.nanit.limbo.connection.ClientConnection.updateState(ClientConnection.java:225)
        at ua.nanit.limbo.connection.PacketHandler.handle(PacketHandler.java:45)
        at ua.nanit.limbo.protocol.packets.PacketHandshake.handle(PacketHandshake.java:70)
        at ua.nanit.limbo.connection.ClientConnection.handlePacket(ClientConnection.java:117)
        at ua.nanit.limbo.connection.ClientConnection.channelRead(ClientConnection.java:112)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
        at ua.nanit.limbo.connection.pipeline.PacketDecoder.decode(PacketDecoder.java:57)
        at ua.nanit.limbo.connection.pipeline.PacketDecoder.decode(PacketDecoder.java:31)
        at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:88)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
        at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346)
        at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:333)
        at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:454)
        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
        at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
        at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
        at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
        at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:800)
        at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:499)
        at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:397)
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        at java.base/java.lang.Thread.run(Thread.java:833)
@Nan1t
Copy link
Owner

Nan1t commented Aug 11, 2023

Yes, it supports 1.7.2+ as the first full version (1.7 and 1.7.1 are pre-release). 1.6.4 and below use different protocol format, so we can't just check its protocol version number and say that this version is unsupported. You should prevent it on the proxy server side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants