Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data security issue for payment link #100

Open
sinfonie opened this issue Jan 15, 2025 · 3 comments
Open

Data security issue for payment link #100

sinfonie opened this issue Jan 15, 2025 · 3 comments

Comments

@sinfonie
Copy link

sinfonie commented Jan 15, 2025

Magento version: 2.4.7-p2
PayNow version: 1.5.6

@paynow-support
Copy link

Hello,

Thank you for explaining this matter in more detail.

In this case, we are preparing an analysis and a corresponding amendment.

@pay-now pay-now deleted a comment from sinfonie Jan 16, 2025
@ssztajnert
Copy link

ssztajnert commented Jan 16, 2025

@sinfonie we've just created an advisory with you as a collaborator till we analyse and confirm it's a security issue

@pay-now pay-now deleted a comment from paynow-support Jan 16, 2025
@sinfonie
Copy link
Author

Hello,

I've tested version 1.5.7 and noticed two issues that need urgent attention as the retry link does not function properly. Adding a token is a great idea, however:

Issue 1:
It is necessary to correct the method Paynow\PaymentGateway\Helper\PaymentHelper::getRetryPaymentUrl to always accept an argument of type (int). Typing seems to be a standard practice.
Problem: Generally, there is an inconsistency in typing in some of the module's classes. I will demonstrate this with a specific example.

Currently, the getRetryPaymentUrl method can accept any type of argument for $orderId. Then, the method encodes the RetryUrl. For instance, at vendor/pay-now/paynow-magento2/view/frontend/templates/order/history/action.phtml::7, orderId is passed as a string $order->getEntityId().
image
Image

If we encode $orderId as a string, then after decoding the URL, $orderId will remain a string and will not pass the comparison in the retry controller's condition, preventing the possibility of making another payment. Paynow\PaymentGateway\Controller\Payment\Retry:110
image

Result is:
image

Issue 2:
The method Paynow\PaymentGateway\Controller\Payment::authorizeNewPayment may throw an exception. Currently, there is no handling for this exception in the controller, which could result in an error message appearing after clicking on retry payment.
image
It would seem appropriate to add exception handling (try {} catch(){}) with redirection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants