Skip to content

Command injection via server_password #2

@lapuhhh

Description

@lapuhhh

Trashmap allows users to update test server settings (server name and password) via the update-settings endpoint.

However, the server_password field is not properly sanitized — it is inserted directly into the server configuration file (likely autoexec.cfg or equivalent for DDNet). This makes it possible to inject arbitrary server commands by appending new lines to the password value, for example setting sv_rcon_password.

As a result, any user can gain unrestricted RCON access to their own test server.

Potential risks:

  • Full server control via RCON (commands like shutdown, kick, ban, change settings, etc.)
  • Possibility to keep servers occupied/flooded (e.g. via sv_shutdown_when_empty 0 or similar), which can block ports/slots for other users who want to test maps.

Would it be possible to add sanitization for server_password (e.g. escape newlines/quotes or restrict allowed characters)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions