Repository navigation
fix(security): prevent unapproved project updates from inflating banked RE - #196
Merged
0xQuerencia merged 10 commits intoNov 9, 2026
Merged
Conversation
…quested-changes reships
…quested-changes reships
…quested-changes reships
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.
Problem
An approved project retains
prior_approved_hoursas banked Restoration Energy while a new update goes through review. The project edit route prevented changinglevelandsidequest_idonly at statusapproved, but statusneeds_changes(including during approved update cycles) permitted both.lifetimeRe()weights banked old hours using those mutable fields, allowing a previously approved 20h Tier 1 project's old 250 RE to appear as 500 RE after a Tier 4 edit without approval, increasing the rate on unrelated future ships.Review dashboard tier-setting paths were also able to regrade previously approved work during updates.
Changes
mustPreserveApprovedProjectTerms(status, isUpdate)in each independently built app.is_updateproject in any review state; first-time projects can still choose tier while fixing requested changes.Intentional limitation
PIXL currently stores only a single tier and Trial link per project, including historical approved hours. Until there is a versioned per-approval model, an update must not be regraded at any stage; otherwise the prior approval's RE changes. Reviewers should use the original tier for update submissions.
Validation
Regression unit tests added to both
earnedProject.test.tsfiles; CI pending. No production database changes. This is a preventative patch, not a claim that Eraxty's separately reported issue has an identical cause.