fix: remove activation_key from account REST API response#827
Merged
Kelketek merged 1 commit intoopencraft/teakfrom Apr 2, 2026
Merged
fix: remove activation_key from account REST API response#827Kelketek merged 1 commit intoopencraft/teakfrom
Kelketek merged 1 commit intoopencraft/teakfrom
Conversation
50131ab to
99eaf4e
Compare
cherry-pick from upstream: openedx#38241 The activation_key field was exposed in /api/user/v1/accounts/{username}, allowing an attacker to bypass email verification by combining two behaviors: 1. OAuth2 password grant issues tokens to inactive users (intentional) 2. activation_key returned in API response (the vulnerability) An attacker could register, get an OAuth2 token, read the activation_key from the API, then GET /activate/{key} to activate without email access. Fix: remove activation_key from UserReadOnlySerializer.to_representation() and from ACCOUNT_VISIBILITY_CONFIGURATION["admin_fields"] (which controls the field whitelist in _filter_fields — listed fields default to None even if absent from the serializer data dict). Reported by Daniel Baillo via the Open edX security working group. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
99eaf4e to
bb84543
Compare
samuelallan72
approved these changes
Apr 1, 2026
Member
samuelallan72
left a comment
There was a problem hiding this comment.
@Kelketek 👍 Thanks!
- I tested this: checked this matches the upstream patch, checked it appears to apply cleanly, checked the tests pass
- I read through the code
- I checked for accessibility issues
- Includes documentation
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.
cherry-pick from upstream: openedx#38241
The activation_key field was exposed in /api/user/v1/accounts/{username}, allowing an attacker to bypass email verification by combining two behaviors:
An attacker could register, get an OAuth2 token, read the activation_key from the API, then GET /activate/{key} to activate without email access.
Fix: remove activation_key from UserReadOnlySerializer.to_representation() and from ACCOUNT_VISIBILITY_CONFIGURATION["admin_fields"] (which controls the field whitelist in _filter_fields — listed fields default to None even if absent from the serializer data dict).
Reported by Daniel Baillo via the Open edX security working group.