Problem/Motivation

claude opus 4.8, confirmed by me:

 token_type not validated in the registration path

  registerOrRefreshToken() writes the caller-supplied $registration_token_type_plugin_id straight into the entity.
  Programmatic save() does not run the list_string allowed-values constraint, so any string is accepted. Later
  RegistrationToken::getTokenType() (Entity/RegistrationToken.php:207) calls $plugin_manager->createInstance($id); the
  manager has no fallback plugin (RegistrationTokenTypePluginManager.php), so an unknown id throws
  PluginNotFoundException and breaks any later send/validate for that token. A JSON-RPC caller can inject junk tokenType
  values → data-integrity / send-time errors.

  Fix: validate tokenType against token_type_manager->getAllowedValues() (or call $entity->validate()) and reject
  unknown types in AddPushToken or registerOrRefreshToken.
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

ptmkenny created an issue. See original summary.

ptmkenny’s picture

Title: token_type not validated in the registration path » validate token_type upon JSONRPC registration

  • ptmkenny committed 81a8e106 on 1.0.x
    fix: #3600738 validate token_type upon JSONRPC registration
    
    By:...
ptmkenny’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.