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

Stored Cross-site Scripting in /blog/add/ #467

Closed
lsg2409 opened this issue Jun 7, 2017 · 10 comments
Closed

Stored Cross-site Scripting in /blog/add/ #467

lsg2409 opened this issue Jun 7, 2017 · 10 comments
Labels
Milestone

Comments

@lsg2409
Copy link

lsg2409 commented Jun 7, 2017

Hi, I found a stored cross-site scripting vulnerability in /blog/add/ . And i also tested it on new develop version , it is vulnerable too. The POC is show below.

Version : develop version 'commit bc6ed86 ')

http://localhost:8081/subrion_cms_4.1.4/blog/add/

image

When the other user access the blog ,the script code will be excuted

image

E-Mail: liangshaogang@huawei.com
Discovered by: Huawei Weiran Labs

@glebovsky
Copy link
Contributor

Hello @lsg2409 !

It seems like DEBUG MODE is turned on on your website, and that is why alert shows.
If you check the code here: https://github.com/intelliants/subrion/blob/develop/templates/kickstart/layout.tpl#L221
you can clearly see, that we are escaping html code.

@lsg2409
Copy link
Author

lsg2409 commented Jun 7, 2017

@glebovsky
Sorry, when I turn off the DEBUG MODE, The code injected into the title is not executing.
However, the code injected into the blog body can still be executed .

the code need modify by burpsuite or other tools.

image
image

When the other user access the blog ,the script code will be excuted

get_cookie

@lsg2409
Copy link
Author

lsg2409 commented Jun 11, 2017

Has the problem been confirmed and repaired?

@ghost
Copy link

ghost commented Jun 12, 2017

Hello @lsg2409,

The issue could not be confirmed as the only way to edit the blog post is to edit it in Admin Panel. There is no way to inject JS code when posting/editing a blog entry because of "safe HTML" sanitizing. In other words, it's impossible to write JS in blog post's body. You may check it by yourself.

At the same time, applying an XSS via forged POST request requires privileged user permissions. It makes no big sense to hack the script preparing forged requests if you already obtained Administrator or Moderator permissions. You could just directly operate with DB in this case.

@lsg2409 lsg2409 closed this as completed Jun 12, 2017
@lsg2409 lsg2409 reopened this Jun 14, 2017
@lsg2409
Copy link
Author

lsg2409 commented Jun 14, 2017

Hello @Batry ,
The CMS system allows ordinary users to have permission to add and edit blog . So Admin Panel is not the only way to edit blog.
Following picture:
image

In this case, an attacker can register with a regular user , and can use tools (such as: burpsuite, this will bypass the "safe HTML" ) to inject JS code in POST body, as follows:

image
image
image

The code function: when other users view the blog, it will send user's cookie to the specified server . When I try this, I get the data like following picture:

image

If the administrator looks at the blog, the attacker can get the administrator cookie and login with the cookie. Example: Modify the administrator cookie when send a http request, the attacker can login in as the adimistrator. Then then he can access the admin panel and operate the database.

image
image

Please confirm, thank you.

@lsg2409
Copy link
Author

lsg2409 commented Jun 20, 2017

Will this problem be fixed?

@ghost
Copy link

ghost commented Jun 30, 2017

Hi @lsg2409, you are absolutely right, it's possible to post blog entries from the frontend as well. We will now check the case you mentioned.

@ghost
Copy link

ghost commented Jul 11, 2017

The issue has been fixed and the appropriate patch was released within the automatic upgrade patch.

Thanks for this report and your efforts, @lsg2409!

@ghost ghost closed this as completed Jul 11, 2017
@vbezruchkin vbezruchkin added this to the 4.1.6 milestone Jul 13, 2017
@fgeek
Copy link

fgeek commented Aug 9, 2017

Please use CVE-2017-10795 for this issue.

@vbezruchkin
Copy link
Member

Thanks. We've contacted mitre team to update the CVE with the vendor information.

This issue has been fixed.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants