Skip to content

Commit

Permalink
Merge pull request #190 from SpigotRCE/patch-1
Browse files Browse the repository at this point in the history
Fixed plugin messaging exploit
  • Loading branch information
Syrent authored Nov 27, 2024
2 parents 0e40256 + ab36efe commit 2693604
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ public void unregister(VelocityMessagingEvent messagingEvent) {

@Subscribe
public void onMessageReceive(PluginMessageEvent event) {
if (!(event.getSource() instanceof ServerConnection)) return;
if (!event.getIdentifier().equals(name)) return;
if (!event.getIdentifier().equals(name)) return; // Not our channel
event.setResult(PluginMessageEvent.ForwardResult.handled()); // Drop the packet
if (!(event.getSource() instanceof ServerConnection)) return; // Somebody is trying to hack us

String rawMessage = new String(event.getData(), StandardCharsets.UTF_8);
if (rawMessage.isEmpty()) return;
Expand All @@ -60,4 +61,4 @@ public ChannelIdentifier getName() {
return name;
}

}
}

0 comments on commit 2693604

Please sign in to comment.