Skip to content

fix: remove activation_key from account REST API response#830

Merged
Kelketek merged 1 commit intoopencraft-release/sumac.1-krach-institutefrom
fox/sumac-activation-patch
Apr 2, 2026
Merged

fix: remove activation_key from account REST API response#830
Kelketek merged 1 commit intoopencraft-release/sumac.1-krach-institutefrom
fox/sumac-activation-patch

Conversation

@Kelketek
Copy link
Copy Markdown
Member

@Kelketek Kelketek commented Mar 31, 2026

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.

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>
@Kelketek Kelketek force-pushed the fox/sumac-activation-patch branch from 36359f0 to 7c0b505 Compare April 1, 2026 14:47
Copy link
Copy Markdown
Member

@samuelallan72 samuelallan72 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Kelketek 👍 Thanks!

  • I tested this: checked this matches the upstream patch, checked it appears to apply cleanly, checked that the failing tests aren't related (although some tests are still to complete, something in github is down; we can re-run the tests soon hopefully)
  • I read through the code
  • I checked for accessibility issues
  • Includes documentation

@Kelketek Kelketek merged commit 559590e into opencraft-release/sumac.1-krach-institute Apr 2, 2026
60 of 74 checks passed
@Kelketek Kelketek deleted the fox/sumac-activation-patch branch April 2, 2026 19:42
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.

3 participants