Validate drop value & quantity server-side#44
Merged
joelhalen merged 1 commit intoJul 17, 2026
Conversation
Submitted drop value and quantity were stored without server-side validation. Value is now resolved from the GE price for any priceable item (client value kept only as a fallback for unpriceable items), and the per-drop total is bounded to the GE integer ceiling.
Contributor
|
Hey @yonnski! Appreciate you contributing :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Drop submissions stored the
valueandquantityfrom the client without server-side validation. The GE value was only recomputed when the client sent0, so any non-zero value was trusted as-is, and quantity was unbounded — which allowed inflated loot totals on the leaderboards.Changes
get_true_item_valuenow resolves the value from the GE price for any priceable item; the client-supplied value is used only as a fallback for items with no resolvable price (untradeables / brand-new items).utils/valuation_guard.py: rejects non-positive/invalid quantities and bounds the per-drop total to the OSRS GE integer ceiling (top-tier single drops still pass).drop_processor.Tests
tests/unit/test_value_authoritative.py— value is taken from the server price, not the client.tests/unit/test_valuation_guard.py— quantity sanitation + total-value ceiling.Happy to walk through the details separately.