Skip to content

Commit 79c2d96

Browse files
committed
Fix CSRF vulnerability
1 parent 5349c21 commit 79c2d96

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Resources/views/Order/Show/_payment.html.twig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
{% if sm_can(payment, 'complete', 'sylius_payment') %}
1818
<div class="ui segment">
1919
<form action="{{ path('sylius_admin_order_payment_complete', {'orderId': order.id, 'id': payment.id}) }}" method="post" novalidate>
20+
<input type="hidden" name="_csrf_token" value="{{ csrf_token(payment.id) }}" />
2021
<input type="hidden" name="_method" value="PUT">
2122
<button type="submit" class="ui icon labeled tiny blue fluid loadable button"><i class="check icon"></i> {{ 'sylius.ui.complete'|trans }}</button>
2223
</form>
@@ -25,6 +26,7 @@
2526
{% if sm_can(payment, 'refund', 'sylius_payment') %}
2627
<div class="ui segment">
2728
<form action="{{ path('sylius_admin_order_payment_refund', {'orderId': order.id, 'id': payment.id}) }}" method="post" novalidate>
29+
<input type="hidden" name="_csrf_token" value="{{ csrf_token(payment.id) }}" />
2830
<input type="hidden" name="_method" value="PUT">
2931
<button type="submit" class="ui icon labeled tiny yellow fluid loadable button"><i class="reply all icon"></i> {{ 'sylius.ui.refund'|trans }}</button>
3032
</form>

0 commit comments

Comments
 (0)