Marketplace does not verify SSL cert when talking to PayPal
Originally disclosed on Mozilla
- Fixed in 12 days
- Paid in 18 months
- Disclosed after 12 days
On Tue, May 1, 2012 at 9:43 AM, Subodh Iyengar<[address removed]>
wrote:
> Scope of the vulnerability:
> We found a vulnerability in Zamboni, (the addons.mozilla.com store code
> https://github.com/mozilla/zamboni). Zamboni uses paypal IPN for payment
> processing, however it is open to a Man in the middle (MITM) attack in which
> an MITM can spoof a "VERIFIED" payment message from paypal forcing zamboni
> to accept an invalid payment.
>
> Details:
> Zamboni uses Paypal IPN to process payments (for apps). The code for the IPN
> sits in apps/paypal. During the IPN post-back procedure however, zamboni
> connects to paypal using urllib, which does not do server certificate
> validation.
>
> This can be seen in 2 code snippets:
> 1. In apps/paypal/views.py
>
> with statsd.timer('paypal.validate-ipn'):
> paypal_response = urllib2.urlopen(settings.PAYPAL_CGI_URL,
> data, 20).readline()
> post, transactions = _parse(post)
> # If paypal doesn't like us, fail.
> if paypal_response != 'VERIFIED':
> msg = ("Expecting 'VERIFIED' from PayPal, got '%s'. "
> "Failing." % paypal_response)
> _log_error_with_data(msg, post)
> return http.HttpResponseForbidden('Invalid confirmation')
>
> This is an unverified request and an MITM can easily spoof the VERIFIED
> response
>
> 2. In /apps/paypal/__init__.py
>
> request = urllib2.Request(url)
> ....
> ....
> opener = urllib2.build_opener()
> try:
> with socket_timeout(10):
> feeddata = opener.open(request, _nvp_dump(paypal_data)).read()
> except AuthError, error:
> paypal_log.error('Authentication error: %s' % error)
> raise
>
> This method also does not do any server validation.
>
> Fix:
> Use the python ssl module to communicate with IPN and verify the hostname on
> the end entity certificate afterwards.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is known
A high-severity crypto bug in Security. Mozilla made it public on 21 May 2012.
About Crypto
Encryption, signatures, randomness or certificate checks that do not protect what they claim to.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is Crypto?
Encryption, signatures, randomness or certificate checks that do not protect what they claim to.