Skip to content

Remote Code Execution using minetest.deserialize

Critical
rubenwardy published GHSA-7q63-4fq2-hqcr Jan 26, 2022

Package

No package listed

Affected versions

<=5.1.1

Patched versions

5.2.0

Description

Impact

If user input is passed directly to minetest.deserialize (ie: without serializing it first), then a malicious user could run Lua code in the server environment.

Mods should never pass user input to minetest.deserialize. Even after this fix, passing user input is still highly problematic as it can cause freezes and denial of service.

Because passing user input to this function is inherently insecure, this issue isn't considered a vulnerability by itself. But when you combine this issue with GHSA-hwj2-xf72-r4cf it's possible to execute code without any mods being at fault.

If the mod security sandbox is disabled, then it would be possible for attackers to access the host system.

Patches

8d6a0b9

Workarounds

Updating to Minetest 5.4 or later is recommended.

You should also make sure that no mods pass user input to minetest.deserialize, and ensure that you apply fixes for GHSA-hwj2-xf72-r4cf

References

#9369

Severity

Critical

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

CVE ID

No known CVE

Weaknesses

No CWEs

Credits