Skip to content

addCommandHandler should disallow to create commands with duplicated names #3655

@CrosRoad95

Description

@CrosRoad95

Describe the bug

As in title.

Steps to reproduce

addCommandHandler("foo", function()end)
addCommandHandler("foo", function()end) -- command is added but it should not, error should be printed

iprint(getCommandHandlers()) -- prints two above commands, commands are registered

Version

/

Additional context

It mostly for security reasons as bad actor can create command with duplicated name to avoid detection. It for example can happen in polish gamemode "pystories" where certain commands such a "admins" are excluded from logs. Because often owners of such servers are not aware of danger and they have not trusted resources someone can create mailicious command with the same name to do not raise suspicious.

It is not only good anticheat that provide protection for servers, but also good api that prevent weird behaviours.

I know this is breaking change, but it is very easy to update resources.

Relevant log output

No response

Security Policy

  • I have read and understood the Security Policy and this issue is not security related.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions