Skip to content
Snippets Groups Projects
Commit 08502af1 authored by Peter Wolanin's avatar Peter Wolanin
Browse files

Issue #3408830 by pwolanin: Missing entity query accessCheck() call

parent 375456f8
No related branches found
No related tags found
No related merge requests found
......@@ -64,8 +64,9 @@ class RecordPayment extends ControllerBase {
$order_id = $request->get('orderId');
$order_idv2 = $request->get('orderIdV2');
$storage = $this->entityTypeManager()->getStorage('ocf_order_confirmation');
$existing = $storage->getQuery()->condition('webform', $webform_submission->id())->execute();
// Don't allow the same webform submission to be used to record multiple,
$query = $storage->getQuery()->accessCheck(FALSE);
$existing = $query->condition('webform', $webform_submission->id())->execute();
// and also don't allow attackers to discover which sid values are valid.
if (!$order_id || !$order_idv2 || $existing) {
throw new NotFoundHttpException();
......
......@@ -9,6 +9,11 @@ use Drupal\webform\WebformInterface;
use Drupal\webform\Entity\Webform;
use Symfony\Component\HttpFoundation\Request;
/**
* Test receive ticket webhook.
*
* @group ocf_integration
*/
class ReceiveTicketWebhookTest extends EntityKernelTestBase {
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment