-
Notifications
You must be signed in to change notification settings - Fork 618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sanitise texture item IDs for facades #7905
base: fabric/1.20.1
Are you sure you want to change the base?
Conversation
ResourceLocation itemId; | ||
|
||
try { | ||
itemId = new ResourceLocation(nbt.getString(NBT_ITEM_ID)); | ||
} catch (ResourceLocationException e) { | ||
return ItemStack.EMPTY; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@62832 Do you know what the resource-id is that they get crashes for?
I have a hunch it's actually just an empty string since we don't guard against a tag being present, but it not having our proprty... (giving us an empty string)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anything malformed with a non A-Z such as minecraft::dirt
will cause a crash otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes but that is arbitrarily edited NBT which I don't really care about :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can crash half of AE2 if you just corrupt the NBT entirely
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The entire reason this PR was made is because a large server already reported someone using an exploit to obtain arbitrarily-modified items and cause client crashes for other players, leading to the modpack for this server disabling facades entirely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And you are certain this was not due the item having any NBT?
Because our code actually also crashes if the item has a tag, but the tag is missing or property...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't say the item had no NBT at all. This was because the item
NBT was present on the facade but the value it actually held was malformed.
Forge counterpart to #7905. --------- Co-authored-by: Sebastian Hartte <shartte@users.noreply.github.com>
Fixes an instant crash bug reported by the Prominence 2 modpack devs if a facade has somehow been obtained with a malformed texture item ID.