Repository navigation
Enrollment security issue - #3130
Open
sanjana4khan wants to merge 5 commits into
Open
sanjana4khan wants to merge 5 commits into
sanjana4khan wants to merge 5 commits into
Conversation
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.
ClickUp ticket link: https://app.clickup.com/t/9018365849/z8zyy1pqyv
Description
Fixes a security issue:
After a student's course enrollment expired, they could get access back by opening the order success URL.
Root cause:
PaymentHandler::load_order_status_template()firestutor_order_placement_successfor any visitor who opens/?tutor_order_placement=success&order_id=N. It doesn't check login, nonce or who owns the order. The listener,HooksHandler::handle_order_placement_success(), then re-ranmanage_earnings_and_enrollments()for that order. That meant:completed, and itspost_datewas reset to now, giving another full access period. This could be repeated forever.Change (
ecommerce/HooksHandler.php):handle_order_placement_success()now only clears the buyer's cart. Enrollment and earnings are being handled when payment is actually confirmed.Impact check:
tutor_earningsrows. Money totals are unchanged because these rows were zero. The visible differences are that Pro "Number of Sales", the Statements list and dashboard "Top performing courses" no longer include these orders.Testing
Use of AI Tool
Used: Yes
Used for:
AI was used to review the branch: tracing every caller of
tutor_order_placement_successandmanage_earnings_and_enrollments, checking the gateway add-ons and Pro modules for dependencies on the success page, checking who readstutor_earnings.