Hi,

I've encountered a major bug in your code validating the payment request. In line 30 of commerce_transferuj_pl.inc the server's remote address is checked using $_SERVER['REMOTE_ADDR']. This doesn't work when a Drupal is behind reverse proxy.

You should use ip_address() function to correctly determine server's remote address.

Comments

ad4m’s picture

Here is the patch that fixes this bug.

ad4m’s picture

Again with attachment.

ad4m’s picture

Status: Active » Needs review
StatusFileSize
new1.1 KB

Found another bugs in transaction status request validation.

1. Transaction id extracted from $_POST is a string, but is run intval().
2. Transaction amount extracted from $_POST is run through floatval(). There is a difference in md5 checksum if you use float or string. The md5 checksum returned by Transferuj.pl uses transaction id as a string, not float. I've checked that by manually comparing md5 checksums.

I'm attaching a patch fixing both and the previous bug.

szymon.l’s picture

Works for me, thanks!