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

Fix unsigned commands detected as signed #1082

Merged
merged 2 commits into from
Oct 12, 2023

Conversation

Joo200
Copy link
Contributor

@Joo200 Joo200 commented Sep 17, 2023

The problem

Using the proxy to intercept commands is sometimes required and should work with the api and the CommandExecuteEvent.

Currently every denied command will result into a disconnect with the message of a invalid protocol state. Even if the command is not signed and only has none or unsigned arguments.

The solution

To solve this problem I debugged the issue and found the reason: The salt is set for unsigned commands even if the command itself is not signed. This will cause a wrong return value for SessionPlayerCommand#isSigned and the SessionCommandHandler will not cancel the event correctly.

I changed the implmentation of isSignedand added some useful debug information in case of denied signed messages.

@electronicboy
Copy link
Member

I'm dubious on the nature of this given the current issues where having where cancelling anything ends up busting the chain more or less, even proxy commands appear to be doing so, yet I thought we had that handled just fine...

@Joo200
Copy link
Contributor Author

Joo200 commented Sep 17, 2023

Yes, the current implementation has more issues and chat signing and the chain doesn't work at all when I'm using velocity as a proxy. I would prefer some proper fix to allow chat and command cancellation but until someone had the time this workaround should work fine.

@electronicboy electronicboy merged commit 0d9a097 into PaperMC:dev/3.0.0 Oct 12, 2023
1 check passed
BlackBaroness added a commit to PvPClashnet/Velocity-CommandExecuteEvent that referenced this pull request Oct 24, 2023
* Add version information for 1.20.1 (PaperMC#1021)

* bump adventure to 4.14.0 (PaperMC#1034)

* check if a plugin has a executor service (PaperMC#1038)

* check if a plugin has an executor service

* checkstyle

* feat: add TabList#addEntries (PaperMC#987)

* [ci skip] Replaced weired i with i in javadocs (PaperMC#1057)

In this little patch I replaced an i which caused my build process to crash with an i

* Do not track plugin channels registered per-player on the proxy (PaperMC#591)

We don't need to track this information since Velocity uses the JoinGame packet, which is about as good of a server rejoin mechanism we're likely to get in vanilla Minecraft.

* fix PaperMC#1062

* 1.20.2 Support (PaperMC#1088)

Co-authored-by: RednedEpic <redned235@gmail.com>
Co-authored-by: Gero <gecam59@gmail.com>

* Actually send plugin message registration to backend servers

I don't see where this was ever done, and don't see how plugin messaging
could of ever worked, at least within the confines of CB and co, given
the fact that we never seemed to be sending this to the backend?

* appease checkstyle, move back to older fix placement

* Change packet decode logging prompt

* Catch throwables when loading plugins (PaperMC#1098)

* Several improvements and fixes for 1.20.2 (PaperMC#1097)

* Send LoginAcknowledged immediately

* Resend player list header/footer after backend server switched to config state

* Fix clearHeaderAndFooter not clearing fields in ConnectedPlayer

* Clear boss bars, header/footer, tab list when switching client to config state

* Send client settings in config state

* Fix unsigned commands detected as signed (PaperMC#1082)

* fix: commands flagged as signed without signed arguments

* feat: improve error message for illegal protocol state.

* acknowledge seen messages to server when running proxy commands (PaperMC#1100)

* Implement ComponentLogger (PaperMC#1022)

* Log the protocol phase in case of trying to obtain a packet id not existing in the phase (PaperMC#1107)

* Bump netty to 4.1.100.Final (PaperMC#1067)

---------

Co-authored-by: Pantera (Mad_Daniel) <89838384+Pantera07@users.noreply.github.com>
Co-authored-by: chris <reichel32574@gmail.com>
Co-authored-by: Aaron <71191102+RealBauHD@users.noreply.github.com>
Co-authored-by: powercas_gamer <cas@deltapvp.net>
Co-authored-by: Groldi <53694440+Plugrol@users.noreply.github.com>
Co-authored-by: Andrew Steinborn <git@steinborn.me>
Co-authored-by: Emmanuel Lampe <rexlmanude@gmail.com>
Co-authored-by: Paul <Paul19988@users.noreply.github.com>
Co-authored-by: RednedEpic <redned235@gmail.com>
Co-authored-by: Gero <gecam59@gmail.com>
Co-authored-by: Shane Freeder <theboyetronic@gmail.com>
Co-authored-by: Joo200 <github@joo200.de>
Co-authored-by: Adrian <68704415+4drian3d@users.noreply.github.com>
BlackBaroness added a commit to influct/Velocity that referenced this pull request Oct 24, 2023
* 1.20.2 Support (PaperMC#1088)

Co-authored-by: RednedEpic <redned235@gmail.com>
Co-authored-by: Gero <gecam59@gmail.com>

* Actually send plugin message registration to backend servers

I don't see where this was ever done, and don't see how plugin messaging
could of ever worked, at least within the confines of CB and co, given
the fact that we never seemed to be sending this to the backend?

* appease checkstyle, move back to older fix placement

* Change packet decode logging prompt

* Catch throwables when loading plugins (PaperMC#1098)

* Several improvements and fixes for 1.20.2 (PaperMC#1097)

* Send LoginAcknowledged immediately

* Resend player list header/footer after backend server switched to config state

* Fix clearHeaderAndFooter not clearing fields in ConnectedPlayer

* Clear boss bars, header/footer, tab list when switching client to config state

* Send client settings in config state

* Fix unsigned commands detected as signed (PaperMC#1082)

* fix: commands flagged as signed without signed arguments

* feat: improve error message for illegal protocol state.

* acknowledge seen messages to server when running proxy commands (PaperMC#1100)

* Implement ComponentLogger (PaperMC#1022)

* Log the protocol phase in case of trying to obtain a packet id not existing in the phase (PaperMC#1107)

* Bump netty to 4.1.100.Final (PaperMC#1067)

---------

Co-authored-by: Paul <Paul19988@users.noreply.github.com>
Co-authored-by: RednedEpic <redned235@gmail.com>
Co-authored-by: Gero <gecam59@gmail.com>
Co-authored-by: Shane Freeder <theboyetronic@gmail.com>
Co-authored-by: Joo200 <github@joo200.de>
Co-authored-by: Adrian <68704415+4drian3d@users.noreply.github.com>
Co-authored-by: Pantera (Mad_Daniel) <89838384+Pantera07@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

None yet

2 participants