Skip to content

ItemStack meta injection

High
rubenwardy published GHSA-hwj2-xf72-r4cf Jan 26, 2022

Package

No package listed

Affected versions

<=5.3.0

Patched versions

5.4.0

Description

Impact

If a mod saves user input in an ItemStack's metadata, then this can be abused by an attacker to add or modify other meta fields of the same item stack.

What this allows depends on what mods do with the meta data:

  • If a mod uses meta to match keys with doors/chests, then this issue would allow attackers to craft keys to match any door/chest.
  • Some mods create items from item meta, which would allow attackers to get unlimited quantities of arbitrary items.
  • Denial of Service attacks.
  • Before 5.2, this could be used for Remote Code Execution

Patches

b5956bd

Workarounds

It is recommended that you update to Minetest 5.4+ or cherry-pick the patch.

Alternatively, you can workaround this issue by removing control characters before setting ItemStack meta:

value = value:gsub("[\x01\x02\x03]", "")
meta:set_string("key", value)

Severity

High
8.2
/ 10

CVSS base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
Low
Availability
High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H

CVE ID

CVE-2022-24300

Weaknesses

No CWEs