Problem/Motivation

Endpoints that create content or increment counters (ReviewAddResource, NodeArticleLikeAddResource, NodeVideoViewAddResource, form submissions) can be called repeatedly by anonymous clients. There is no rate limiting, so counters can be inflated and the site spammed.

Proposed resolution

  • Inject the core flood service and register an event per write endpoint.
  • Make thresholds and windows configurable, with per-IP and per-user limits.
  • Return 429 with a Retry-After header when the limit is exceeded.

Remaining tasks

Implement flood checks in MyrestResourceBase and expose the settings.

User interface changes

New rate-limit settings section.

API changes

Clients may receive 429 responses.

Issue fork myrest-3615487

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

sergeydruua created an issue. See original summary.

  • sergeydruua committed 0f43200a on 1.0.x
    Issue #3615487: Add flood control to public write endpoints
    
sergeydruua’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.

sergeydruua’s picture

Status: Fixed » Closed (fixed)