Skip to content

Bad regex allows invalid messages which can crash the client #1

@Antonio32A

Description

@Antonio32A

local data_pattern = base_pattern.."{[-]?%d+[%.%d+]+,[-]?%d+[%.%d+]+} %S+ %S+"

[%.%d+]+ allows input with multiple dots, e.g. 123.4.56 is considered valid which will result in pos_x or/and pos_z being nil.
This then causes a crash because nil is passed to TheWorld:FindEntities as the first or second argument:
local entities = TheSim:FindEntities(position[1],position[2],position[3],1,{},{"INLIMBO","fx"},{"epic","_inventoryitem","structure","_health"})

As far as I know this cannot be caused by the mod itself, but malicious users can use this to crash others.
Here's an example payload:
  {32.32,-1337..} other 4CEE3D8C1ED93B0C
(the hash will need to be modified per world)

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