PingPlusPlus / pingpp-php

MIT License
378 stars 182 forks source link

回调数据建议有签名验证机制 #20

Closed puxiaokang closed 9 years ago

puxiaokang commented 9 years ago

对于回调过来的数据,目前只能靠 app,order_no字段判断真伪(我没找到其它方法)。而这些信息有可能泄露,如果用来发起伪造的回调请求,就能不花一分钱完成支付订单。

有几点解决方案,但都没有签名验证机制好:

建议你们考虑下

icedfish commented 9 years ago

哈哈哈,有人和我提一样的问题了。

不过说实话,就算有密钥可以校验回调,也最好手动调一次,从逻辑上这是最安全的。

因为你的密钥很可能泄露。

samurai00 commented 9 years ago

我们的 Webhooks 有签名验证的功能。 具体验签方法可以查看:https://pingxx.com/guidance/webhooks

icedfish commented 9 years ago

@samurai00 SDK好像没提供对应的支持?

不过你们新功能推出的不声不响,都不知道这功能真的推出了呢。

lumixiliu commented 9 years ago

我们的webhooks是有签名验证机制的。你这里指的是notify么??如果是这个,建议你们换到webhooks

发自 lumixiliu

在 2015年6月11日,18:59,joaner notifications@github.com 写道:

对于回调过来的数据,目前只能靠 app,order_no字段判断真伪(我没找到其它方法)。而这些信息有可能泄露,如果用来发起伪造的回调请求,就能不花一分钱完成支付订单。

有几点解决方案,但都没有签名验证机制好:

对回调地址保密。不可靠 主动查询ping++服务器,确定订单状态真伪。多耗时间 加密客户端通信。可能被反编译获得参数信息 建议你们考虑下

— Reply to this email directly or view it on GitHub.

lumixiliu commented 9 years ago

webhooks中提供了签名验证机制的。建议你们使用这个作为回调

发自 lumixiliu

在 2015年6月11日,19:01,Yu Bing notifications@github.com 写道:

哈哈哈,有人和我提一样的问题了。

不过说实话,就算有密钥可以校验回调,也最好手动调一次,从逻辑上这是最安全的。

因为你的密钥很可能泄露。

— Reply to this email directly or view it on GitHub.

puxiaokang commented 9 years ago

@lumixiliu @samurai00 好的,谢谢提醒