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] Non-admin can close tickets in servers they are not admin in #466

Closed
1 task done
NonPlayerCharacterNPC opened this issue Jul 28, 2023 · 1 comment
Closed
1 task done
Assignees
Labels
bug Something isn't working important

Comments

@NonPlayerCharacterNPC
Copy link

NonPlayerCharacterNPC commented Jul 28, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

/force-close command ran in Server 1 where User 1 is Admin in showcases the inactive ticket from Server 2, where User 1 is not an admin in and so User 1 can close the tickets of Server 2.

Expected Behavior

/force-close when used with the optional time parameter, should only showcase inactive tickets in which the server it is being ran in because you might not want to be closing inactive tickets in Server 2, only Server 1 (where you ran the command in)

Steps To Reproduce

Invite your self-hosted version of the bot to TWO servers (in both cases you authorise the bot, it doesn't matter if you are server owner or not, as long as you have the manage server permissions of course and be allowed to use the /force-close command).

Create the ticket panels, and open a ticket in both servers (send a message inside of those created tickets), one with an alt account and one with the account that was defined as "SUPER" in .env

Go to either of the TWO servers and enter in the command /force-close time: 1s to showcase the list of tickets that have been inactive for more then 1 second.

If in Server 2, you are just the admin of Discord server and you run the command (and not the SUPER admin defined in .env), you might not see which servers the tickets are from and the channel will say #unknown because your alt account in Server 1, is clearly not an admin of it.

If you proceed to press the Close button, you will have closed the inactive ticket in Server 1 where you were not an admin of it.

Alternatively, if you are an admin of BOTH servers, you will see the inactive tickets and which servers the inactive tickets are from, and when you hit close, instead of having closed the tickets from the server you ran the command in, you will have closed the tickets in BOTH servers.

Environment

- OS: Ubuntu 20.04
- Node: 18.0.0
- NPM:
- Bot: 4.0.7

I am using Pterodactyl Panel.

Anything else?

I haven't inferred anything here, I did hit the close button and it did end up closing the ticket of another server where I wasn't admin in (I used an alt account), obviously you still need to be an admin with the admin permissions to have access to force-close command, you can't use it as a normal regular user which is good.

@NonPlayerCharacterNPC NonPlayerCharacterNPC added the bug Something isn't working label Jul 28, 2023
@NonPlayerCharacterNPC NonPlayerCharacterNPC changed the title [BUG] Non-admin can close tickets in servers they are not admin in (Self-hosted version). [BUG] Non-admin can close tickets in servers they are not admin in Jul 28, 2023
@eartharoid eartharoid self-assigned this Jul 29, 2023
@eartharoid
Copy link
Member

Thank you for the detailed report. Unfortunately, this extremely important problem was caused by a single very short line that was overlooked. 😔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working important
Projects
None yet
Development

No branches or pull requests

2 participants