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

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
None
Integrity
Low
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:N/I:L/A:H

CVE ID

CVE-2022-24300

Weaknesses

No CWEs