3
9
Fork
You've already forked farming
14

kiwi can_grow() doesn't check permissions #52

Closed
opened 2026年06月05日 18:54:32 +02:00 by SwissalpS · 6 comments
Line 120 in 7cc6c9c
local function can_grow(pos)

This makes it a griefing vector. (tested and reported by Huhhila on Pandorabox)

[moretrees] uses core.spawn_tree(pos, model) which seems to work well with protections.
github.com/mt-mods/moretrees@bf28cd8e7c/init.lua (L216)

https://codeberg.org/tenplus1/farming/src/commit/7cc6c9c3ecece8b778c1a2e45f3501139548f721/crops/kiwi.lua#L120 This makes it a griefing vector. (tested and reported by Huhhila on Pandorabox) [moretrees] uses ```core.spawn_tree(pos, model)``` which seems to work well with protections. https://github.com/mt-mods/moretrees/blob/bf28cd8e7c74a0457e717e647c110470d7462035/init.lua#L216

Grow doesnt need permissions, a protection check is done when sapling is placed, and the schematic is made so that nothing can be replaced apart from the sapling itself when grown, so it cannot be used to grief.

Note: core.spawn_tree is used to spawn L-type decorations and not schematics.

Grow doesnt need permissions, a protection check is done when sapling is placed, and the schematic is made so that nothing can be replaced apart from the sapling itself when grown, so it cannot be used to grief. Note: core.spawn_tree is used to spawn L-type decorations and not schematics.

I happen to trust Huhhila, if they say they managed to destroy protected chest with contents, I believe them.

This may not be exclusive to kiwi, we are still testing with other trees and so far only kiwis have raised concern.

Attached a screen grab of a kiwi destroying a chest containing items and also destroying a rubber tree trunk. This without any protections in play.

I happen to trust Huhhila, if they say they managed to destroy protected chest with contents, I believe them. This may not be exclusive to kiwi, we are still testing with other trees and so far only kiwis have raised concern. Attached a screen grab of a kiwi destroying a chest containing items and also destroying a rubber tree trunk. This without any protections in play.

@SwissalpS - The latest upate fixed that issue by only force placing the bottom of the tree to replace sapling.

"No nodes were harmed in the making of this comment..."

@SwissalpS - The latest upate fixed that issue by only force placing the bottom of the tree to replace sapling. "No nodes were harmed in the making of this comment..."

7f12a2a667 doesn't stop destruction of nodes entirely. 2 nodes above the sapling is still vulnerable.

https://codeberg.org/tenplus1/farming/commit/7f12a2a6674cb67b141f06c448e46fd72da0d954 doesn't stop destruction of nodes entirely. 2 nodes above the sapling is still vulnerable.

BTW, local l isn't used anywhere in the scheme.

BTW, ```local l``` isn't used anywhere in the scheme.

Good eye, I never spotted that other T :) also using l for under leave randomness... Thanks :P

Good eye, I never spotted that other T :) also using l for under leave randomness... Thanks :P
Sign in to join this conversation.
No Branch/Tag specified
master
No results found.
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
tenplus1/farming#52
Reference in a new issue
tenplus1/farming
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?