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

I have find a Reflected XSS vulnerability in this sdk #19

Closed
jgj212 opened this Issue Feb 21, 2017 · 2 comments

Comments

Projects
None yet
3 participants
@jgj212
Copy link

jgj212 commented Feb 21, 2017

Hello:
I have find a Reflected XSS vulnerability in this sdk.

The vulnerability exists due to insufficient filtration of user-supplied data in “verification_code” HTTP REQUEST parameter that will be passed to “permissions-sdk-php-master\samples\GetAccessToken.php”. The infected source code is line 24, there is no protection on$_REQUEST['verification_code']; if $_REQUEST['verification_code'] contains evil js code, line 24 will trigger untrusted code to be excuted on the browser side.
image

So if a attacker construct a special url as follow and send it to a victim, when the victim click the url, the code which is contained in the url will be executed on the victim's browser side to do some evil.
http://your-web-root/permissions-sdk-php-master/samples/GetAccessToken.php?verification_code="><script>alert(1);</script><"

The follow scrrenshot is the result to click the upper url ( win7 sp1 x64 + firefox 51.0.1 32bit ):
image

Discoverer: ADLab of Venustech

@randstraw

This comment has been minimized.

Copy link
Member

randstraw commented Feb 22, 2017

Adding internal tracking: BTDXCLTS-283

@jaypatel512

This comment has been minimized.

Copy link
Contributor

jaypatel512 commented Mar 29, 2017

Hey @jgj212 !

As discussed in your PR, the samples are for training purposes only, and out intention is to keep it simple to understand the API process. It is expected from developers to use their due diligance on implementing these samples in real life.

However, we were able to add a layer of protection by discarding samples and other directories that are not useful from the archive, which is what composer uses to provide these packages. We really appreciate your concern. Feel free to create more PRs with other issues if you find any.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.