Problem with PEX and backslashes #360


  • Defect
  • Accepted
Open
Assigned to devil_boy512
  • _ForgeUser7410750 created this issue Oct 12, 2013

    Summary:
    Upon disguising as a player with a backslash in it, PEX will start bugging. For example:
    /disguise player asdasd\

    Here is proof:
    https://github.com/PEXPlugins/PermissionsEx/issues/1116#issuecomment-26191110

    I personally think it's a PEX problem, but they say it's a DisguiseCraft problem.

    DisguiseCraft version:
    v5.0

    CraftBukkit version:
    Spigot 1125

    Console Log (if any):
    <<code>>
    Please see the Github link above ^
    <</code>>

    Steps to reproduce:
    1. Use PermissionsEX, any version.
    2. Type /disguise player asdasdasdasd\ or anything else with a backslash in it
    3. PEX starts to spew out PatternSyntaxExceptions causing the server to freeze.

    List of plugins also on the server:
    WorldGuard, PermissionsEX

    Additional information:
    Please see the github link I have posted above for detailed description and also what PEX has to say about it.

  • _ForgeUser7410750 added the tags New Defect Oct 12, 2013
  • _ForgeUser7410750 edited description Oct 12, 2013
  • Devil_Boy512 posted a comment Oct 13, 2013

    Can Minecraft accounts actually have backslashes in their username? o.o

    If so, do you think you can check if bPermissions handles them fine? If bPermissions doesn't support backslashes, I'll need to find a way to encode the backslashes into something the permissions systems can handle.

    Honestly though, it'd be much better if the encoding was handled on their end. It would make it so that plugins that want to utilize backslashes in permissions nodes wouldn't all have to make their own encoding systems.


    Edited Oct 13, 2013
  • _ForgeUser7410750 posted a comment Dec 7, 2013

    bPermissions doesn't have the problem. It's because of PEX's terribly programmed regular expression system.

    I agree that it would be better if it was handled by PEX, but they simply blamed DisguiseCraft for it instead of adding support for permissions that contain backslashes.


    Edited Dec 7, 2013
  • Devil_Boy512 posted a comment Dec 8, 2013

    @ItsHarry: Go

    Well I'm not so sure how this should be handled.
    I can think of several options:

    1. Do nothing
      • Tell users to use bPermissions if they come across this issue
    2. Encode special characters in player names
      • Makes it less obvious how DisguiseCraft's player permissions work
    3. Disallow the disguising of players with special characters in their name
      • Safe, but removes functionality
    4. Strip the special character from the player permission
      • The disguise for player "Tux2\" merely becomes "disguisecraft.player.Tux2"
      • This removes the potential to allow/restrict certain player disguises



    I'm thinking that we may end up not addressing it at all for now. We may have a better system in our recode.


    Edited Dec 8, 2013
  • _ForgeUser7410750 posted a comment Dec 10, 2013

    Could you add a little .contains(backslash) check when PEX is installed on the server?

    My server was griefed today because of PEX completely breaking because of this problem. I made a plugin that disallows disguises with a backslash in it but they somehow managed to bypass it.

    This is a really serious issue. I've reported this bug to PEX so many times but they don't even bother responding.

    I will compile a custom version of DisguiseCraft to fix this problem but I hope you will implement it in the official DisguiseCraft so that the same problem doesn't happen to other servers in the future.


    Edited Dec 10, 2013
  • Devil_Boy512 posted a comment Dec 10, 2013

    @ItsHarry: Go

    We won't make any code specific for other plugins in the DisguiseCraft core.
    It should actually be fairly easy for this to be handled in a separate plugin through the API though.

    As far as I can tell, it'd only need to cancel the PlayerDisguiseEvent.

  • _ForgeUser7410750 posted a comment Dec 10, 2013

    It turns out that # also crashes PermissionsEX.

    I will make a plugin like you said. Sadly, the DisguiseEvent is called before the permission is checked, so it won't work through that.

    Thanks for the help anyway.


    Edited Dec 10, 2013
  • Devil_Boy512 posted a comment Dec 18, 2013

    Oh sorry...
    I didn't realize that.

    Perhaps you can use the DisguiseCommandEvent to filter out any characters that shouldn't be there?

  • Devil_Boy512 removed a tag New Mar 22, 2015
  • Devil_Boy512 added a tag Verified Mar 22, 2015
  • Devil_Boy512 closed issue Mar 22, 2015
  • Devil_Boy512 removed a tag Verified Mar 22, 2015
  • Devil_Boy512 added a tag Accepted Mar 22, 2015
  • Devil_Boy512 reopened issue Mar 22, 2015

To post a comment, please login or register a new account.