Problem/Motivation

ImageStyleDownloadController::deliver() does direct string comparison when checking the derivative token.

$valid &= $request->query->get(IMAGE_DERIVATIVE_TOKEN) === $image_style->getPathToken($image_uri);

Steps to reproduce

I didn't attempt, so I guess this is more theoretical.

Proposed resolution

Use hash_equals() instead of direct string comparison.

Remaining tasks

Use hash_equals() instead of direct string comparison.

User interface changes

None.

API changes

Data model changes

None.

Issue fork webp-3188548

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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

daceej created an issue. See original summary.

daceej’s picture

Patch to use hash_equals().

daceej’s picture

Assigned: daceej » Unassigned
Status: Active » Needs review
scott_euser’s picture

Status: Needs review » Reviewed & tested by the community

This looks good to me. hash_equals is the recommended way from core after deprecation here.

alexmoreno made their first commit to this issue’s fork.

Balu Ertl’s picture

Title: WebP potentially susceptible to timing attacks. » WebP potentially susceptible to timing attacks
markus_petrux’s picture

Rerolled to apply to 1.x-dev

alexmoreno’s picture

alexmoreno’s picture

Status: Reviewed & tested by the community » Fixed
alexmoreno’s picture

Version: 8.x-1.0-beta5 » 8.x-1.x-dev
fathima.asmat’s picture

This is fixed in the latest release https://www.drupal.org/project/webp/releases/8.x-1.0-beta6 and can be marked as closed

Status: Fixed » Closed (fixed)

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