Problem/Motivation

Identified by Fable:

3. Entity validation never runs on the JSON-RPC path — the UniqueField constraint is dead code there, and there's a
  permanent-DoS race.
  ProcessTokens calls ->save() without ->validate(), so neither UniqueField nor the 512-char length constraint is enforced
  (there is no DB unique index on token either — uniqueness rests entirely on the pre-save query at
  ProcessTokens.php:47). Two concurrent registrations of the same token create duplicates; afterwards
  registerOrRefreshToken() throws "Too many tokens" forever for that token, and the client can never register or refresh
  it again. An overlong token also reaches PostgreSQL and fails at the DB layer, returning internalError instead of
  invalidParams. Recommend: unique index on the token column (or validate + handle violations), a maxLength on the
  JSON-RPC token parameter schema, and self-healing (e.g., delete duplicates) instead of throwing when count > 1.
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 committed e5352f71 on 1.0.x
    fix: #3607825 UniqueField not validated with JSON-RPC
    
    By: ptmkenny
    
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.