Skip to content

[FEATURE] Prevent slowhacking #1340

@Rainyan

Description

@Rainyan

Description

A malicious map can execute evil commands for clients. This is sometimes called "slowhacking". We should add a cvar to disable these dangerous commands.

Steps to reproduce:

  • Download the map: clientcmd.zip
    • Move the BSP to the maps folder
    • The VMF file is also provided if you want to open it in Hammer for inspection
  • Launch the game
  • Type bind x to check what your current X key bind is
  • Set neo_bot_quota 0 to make the bots go away
  • Load the in map clientcmd.bsp: map clientcmd
  • Choose a player team Jinrai or NSF
  • Spawn in the map
  • Move forwards from the spawn point and you will hit a trigger brush
  • Check bind x again to see what the bind is after hitting the brush

What happens:

  • The X key has been re-bound to value evil by the map
entity
{
	"id" "50"
	"classname" "trigger_multiple"
	"StartDisabled" "0"
	"wait" "1"
	"spawnflags" "1"
	"origin" "8 -136 52"
	connections
	{
		"OnStartTouch" "clientcmd_foo,Command,bind x evil,0,-1"
	}

What should happen:

  • The client should be protected from the malicious key re-bind

This is a contrived example of the kinds of evil manipulations a map could do on the clients, but should work as a test case.

For more information, including a list of commands we should protect at a minimum: https://developer.valvesoftware.com/wiki/Admin_Slowhacking

Proposed Solution

As a player, I want to be able to load in a custom map without worrying about the map executing malicious commands on my local client.

Alternatives Considered

We could add a cvar option for only allowing these types of commands for the official NT;RE maps (tutorial, etc).

Additional Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementNew feature or request

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions