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

Cross Site Scripting Vulnerability in HTMLy v-2.7.4 #382

Closed
riteshgupta1993 opened this issue Aug 11, 2018 · 12 comments
Closed

Cross Site Scripting Vulnerability in HTMLy v-2.7.4 #382

riteshgupta1993 opened this issue Aug 11, 2018 · 12 comments

Comments

@riteshgupta1993
Copy link

Vulnerability name-Cross SIte Scripting.
Severity: High
Submitted By: Ritesh Kumar
Email: riteshreapers@gmail.com
Vendor of Product: HTMLy
Version: 2.7.4
Attack type: remote

Hello,

I would like to report a vulnerability that I discovered in HTMLy-v2.7.4, which can be exploited to perform Cross-Site Scripting (XSS) attacks. The vulnerability exists due to insufficient sanitization in the "Content Field" parameter. The exploitation example below uses the "alert()" JavaScript function to display "1" as alert text.

Cross-Site Scripting (XSS) attacks are a type of injection, in which malicious scripts are injected into otherwise benign and trusted web sites. XSS attacks occur when an attacker uses a web application to send malicious code, generally in the form of a browser side script, to a different end user. Flaws that allow these attacks to succeed are quite widespread and occur anywhere a web application uses input from a user within the output it generates without validating or encoding it.

An attacker can use XSS to send a malicious script to an unsuspecting user. The end user's browser has no way to know that the script should not be trusted, and will execute the script. Because it thinks the script came from a trusted source; the malicious script can access any cookies, session tokens, or other sensitive information retained by the browser and used with that site. These scripts can even rewrite the content of the HTML page.

STEPS TO REPRODUCE:

1.Login to HTMLy.

2.Click on Add Content and URL http://127.0.0.70///admin/content will be opened and click on Regular post, then u will be redirected to http://127.0.0.70///add/content?type=post.

3.enter the text into title(TESTING) and tag(TESTING1) parameter and In the content field enter the malicious java script <script>alert(1)</script> and click on publish.

4.after clicking in publish view that content(TESTING).

5.xss will be get executed and 1 will be reflected on the browser.

PROOF OF CONCEPT:

1: click on Add content and http://127.0.0.70///admin/content page will be opened and on that page click on Regular post button.

html1

2:Fill the text in title and tag parameter and in “Content field” parameter give the malicious java xss payload <script>alert(1)</script> then click on publish button.

newhtme

3: View that content(TESTING).
viewhtml

4: The xss script “1” will be reflected on the browser.
xsshtm

Reference:
https://www.owasp.org/index.php/Crosssite_Scripting_(XSS)

@danpros
Copy link
Owner

danpros commented Aug 11, 2018

Thanks for reporting it but you need to login first before you can access those page. If you are logout you will redirected to login page. The questions is can this can be done if you are logout?

@riteshgupta1993
Copy link
Author

riteshgupta1993 commented Aug 11, 2018

Hello,
When i am logged out it is not possible but when user is logged in say a hacker is logged-in user,he/she can fetch the content of the website using Crafted mailicious xss javascript payload which can be very serious issue for the website because the confidentiality of website content can be breached by the logged-in user(A HACKER) and it can be serious security flaw.

@riteshgupta1993
Copy link
Author

REFER THIS: GetSimpleCMS/GetSimpleCMS#1284

@riteshgupta1993
Copy link
Author

REFER THIS: GetSimpleCMS/GetSimpleCMS#1293

@danpros
Copy link
Owner

danpros commented Aug 11, 2018

I'm not worried about this because the attacker needs to log in first. It is natural if the attacker can entering the admin area, it will be a big problem even on WordPress. So make sure to use a strong password and use reCaptcha for additional security.

@danpros
Copy link
Owner

danpros commented Aug 12, 2018

Well this is not a bug but a feature https://github.com/showdownjs/showdown/wiki/Markdown%27s-XSS-Vulnerability-(and-how-to-mitigate-it). The blog owner have total freedom with what markup or content they are created.

The CMS mentioned above allowing comment, or collecting data etc. from anonymous user (entrusted users) and htmly is different because there is no such feature on htmly, all users need to login before can creating a post and there is not built-in comment. So at the moment I will leave it as is.

@riteshgupta1993
Copy link
Author

K thanks.

@riteshgupta1993
Copy link
Author

Hello team
hope you are doing well
there are lots of cms which are using the editors which do not execute the javascript they have the functionality to parse the HTML tags and display the raw content.
You can use "CKEditor", that filters the XSS payloads.
so, i am recommending you to use those kind of editors in ur product.
REFER: https://www.drupal.org/project/drupal/issues/2099741
https://docs.telerik.com/kendo-ui/controls/editors/editor/preventing-xss

@trendschau
Copy link

Just as a side note: I think you don't have to switch the frontend-editor neccessarily, because you can also switch the mardkown-parser. Parsedown for example has a safe-mode that prevents from most xss-attacks. BUT you won't be able to use any other syntax than markdown then (no HTML or JavaScript at all, which is a bit against the original markdown specification, that allows HTML) ...

On the other side, if a hacker gets your password, he will probably find other ways to inject malicious code (e.g. links to malicious websites or malicious image- and file- uploads?), so if someone gets your password, it is always hard or impossible to keep your website save, isn't it? I think that even big enterprise systems are not safe, if you get access to the admin area. But I am a bloody amateur in this field, so just a side note ...

@riteshgupta1993
Copy link
Author

riteshgupta1993 commented Aug 15, 2018 via email

@danpros
Copy link
Owner

danpros commented Aug 16, 2018

Hello,

I will close this one and mark it as won't fix because HTMLy will retain current text editor (PHP Markdown Extra).

BTW thanks everyone,

@danpros
Copy link
Owner

danpros commented May 6, 2020

This has been fixed: ec1cf1d

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

No branches or pull requests

3 participants