Skip to content

fix: remove activation_key from account REST API response - #831

Merged
Agrendalath merged 1 commit into
opencraft-release/redwood.1-echofrom
fox/redwood-activation-patch-2
Mar 31, 2026
Merged

fix: remove activation_key from account REST API response#831
Agrendalath merged 1 commit into
opencraft-release/redwood.1-echofrom
fox/redwood-activation-patch-2

Conversation

@Kelketek

Copy link
Copy Markdown
Member

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.

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>
@Agrendalath
Agrendalath changed the base branch from opencraft-release/redwood.1-echo-prod to opencraft-release/redwood.1-echo March 31, 2026 18:23

@Agrendalath Agrendalath left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

  • I tested this: read the diff
  • I read through the code
  • I checked for accessibility issues: n/a
  • Includes documentation: n/a
  • Added to the Code Drift project board (for backports): n/a

@Agrendalath
Agrendalath merged commit 10d6e89 into opencraft-release/redwood.1-echo Mar 31, 2026
47 checks passed
@Agrendalath
Agrendalath deleted the fox/redwood-activation-patch-2 branch March 31, 2026 18:24
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.

4 participants