Skip to content

Fix infinite discount exploit using illegal client modifications - #108

Open
Sylvye wants to merge 1 commit into
Clickism:masterfrom
Sylvye:master
Open

Sylvye wants to merge 1 commit into
Clickism:masterfrom
Sylvye:master

Conversation

@Sylvye

@Sylvye Sylvye commented Sep 3, 2026

Copy link
Copy Markdown

Prevents temporary player-specific villager discounts from being serialized when picking up a villager during an active trade session.

A modified client could suppress the merchant close packet, pick up the villager, and place it again. This persisted the active specialPrice, causing the discount to be applied repeatedly.

  • Block villager serialization while Villager.isTrading() is true.
  • Force-close the server-side inventory of the active trader.
  • Require another interaction before pickup can proceed.
  • Handle blocked pickups safely for:
    • Direct sneak-right-click pickup
    • Claimed-villager menu pickup
    • Villager hoppers
  • Add Sylvye to the Paper plugin author metadata. :)

This only changes the Paper implementation. Fabric and NeoForge behavior is unaffected.

PickupManager.toItemStack now returns Optional<ItemStack> and will skip (return empty) for Villagers that are currently trading — it also closes the trader inventory to avoid issues. Call sites (VillagerEditMenu, HopperTicker, InteractListener) were updated to handle the Optional. Also updated plugin.yml authors to include 'Sylvye' and fixed a trailing newline.
@Sylvye

Sylvye commented Sep 3, 2026

Copy link
Copy Markdown
Author

Video of the exploit released by the finders: https://www.youtube.com/watch?v=qoNpJUK7f9Q

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant