Payum / PayumServer

Payment processing microservice. Written in Symfony4
https://payum.forma-pro.com/
MIT License
114 stars 34 forks source link

XSS in PayumServer #43

Closed itmox closed 7 years ago

itmox commented 8 years ago

A reflected xss vulnerability in PayumServer can be performed.

PoC: by inserting

as gateway name the server returns the message: "Parameter "name" for route "gateway_get" must match "[^/]++" ("" given) to generate a corresponding URL." but also delivers the injected script which is performed in the browser.

The issue can be soled by not returning the input after checking it or by sanitizing and escaping the returned String before delivering it to the client.

Unfortunately we were unable to install PayumServer and fix the bug.

payumserver

makasim commented 8 years ago

Not sure what to do. The UI is not meant to be used by untrusted people. It is backend stuff and only an admin or a manager have access to it. They want do xss injections, I hope.

The api must not be publicly accessible too. Though the security topic is not solved yet in Payum. It is PoC and everything is public for now.

makasim commented 8 years ago

Thank for raising starting discussion on this topic.

makasim commented 8 years ago

What problems did you face trying to install payumserver?

nilportugues commented 8 years ago

Strict data validation input should clear this up.

makasim commented 8 years ago

What do you mean by Strict data validation?

nilportugues commented 8 years ago

Giving some ideas to harden security.

It will make the code slower, but more secure.. and that's what we want for Payum.

makasim commented 8 years ago

Why should we bother about it. The functionality is accessible by limited set of users. They work on your company.

We can do changes audit. What was changed and by what user.

nilportugues commented 8 years ago

Yeah just as idea. I agree with you it's overkill @makasim.

itmox commented 8 years ago

Hey, i already fixed this issue in my pull-request. Just an example: Jack (a client) wants Barbara (a secretary) to add a gateway. I a mail he sends her the name (a xss) and the xss sends information (user token etc.) to Jack.

I understood that the Gatway is only accessible by a limited set of users but the security awareness of these users is important. I always ask myselfe "what if my mum would be the secretary?"

makasim commented 8 years ago

I gave it one more thought and now I tend to think we have to sanitize it. Maybe a regexp validation rule for some fields would be the way to go.