Skip to main content
Menu
Advisories

Star Ratings does not enforce vote_access on the server

GHSA-556J-6JH2-5RCVPublished Updated GitHub

Description

Star Ratings exposes a vote_access setting for restricting who may vote, and a readonly setting for disabling voting entirely. Both are enforced only by how the browser widget is rendered. The server-side vote handler checks neither.

Affected versions

Star Ratings 2.0.1 through 2.0.3 are affected when vote_access is configured or readonly is enabled. Both are off by default.

Details

getData() checks vote_access and sets client-side readOnly and loginRequired flags for an unauthorized viewer, and passes the configured readonly setting through as the same client-side flag. It still emits a valid anonymous vote nonce in the widget data. addVote() verifies that nonce and optional per-IP deduplication, but never authorizes the current user against vote_access and never consults readonly. A client can therefore ignore the read-only UI and submit the vote directly.

Impact

An unauthenticated visitor can add and influence ratings on a site whose operator explicitly restricted voting to logged-in or otherwise authorized users, or disabled voting altogether. This crosses the operator-configured authorization boundary and affects rating integrity, including aggregate rating output.

Patches

Upgrade to Star Ratings 2.0.4 when it is released. The fix enforces both vote_access and readonly in the server-side vote handler before changing stored ratings.

Note for that release: per-page vote_access and a per-widget readOnly passed to stars() are still not bound to the callback, so the fix covers the global configuration only.

Credits

Reported by @AlpetGexha.

Affected versions

References

GitHub · getgrav/grav