Stored XSS (Hexo-admin plugin)
The post editor in the hexo-admin plugin 3.9.0 stores user-supplied post content without sanitisation, so a script embedded in a post runs whenever that post is viewed. An attacker could execute arbitrary JavaScript in the browser of anyone who opens the affected post.
- Triaged in 20 days
- Fixed in 3 months
- Disclosed after 3 months
Summary by the researcher
An admin UI for the Hexo blog engine. Based off of the Ghost interface, with inspiration from svbtle and prose.io. URL: https://hexo.io
The Post editor functionality in the hexo-admin plugin 3.9.0 for Node.js is vulnerable to stored XSS via the content of a post.
NPMjs package: https://www.npmjs.com/package/hexo-admin NPMjs advisory: https://www.npmjs.com/advisories/1211 GItHub repository: https://github.com/jaredly/hexo-admin CVE: https://nvd.nist.gov/vuln/detail/CVE-2019-17606
The report
I would like to report Stored XSS in Hexo-admin It allows The Post editor functionality in the hexo-admin plugin 3.9.0 for Node.js is vulnerable to stored XSS via the content of a post.
Module
module name: Hexo-admin version: 3.9.0 npm page: `https://www.npmjs.com/package/hexo-admin
Module Description
An admin UI for the Hexo blog engine. Based off of the Ghost interface, with inspiration from svbtle and prose.io.
Module Stats
Replace stats below with numbers from npm’s module page:
[1] 216
Stored XSS
Stored XSS occurs when a malicious script is injected directly into a vulnerable web application.
Description about how the vulnerability was found and how it can be exploited, how it harms package users (data modification/lost, system access, other.
Steps To Reproduce:
Steps of reproduction
-
Prerequisites are
- hexojs (Static blog generator)
- hexo-admin plugin (https://github.com/jaredly/hexo-admin)
-
Start the hexo server from website directory (command: hexo server -d)
-
Access hexo admin panel at localhost:4000/admin
-
Click on the posts section
-
Create the new post and give it a title (Test XSS here)
-
In the post content you can put the below payloads
- "><img src=x onerror=alert("XSS")>
- "><img src=x onerror=alert(document.domain)>
-
You'll get the XSS pop-up in the post editor
-
Save the post and rebuilt the pages with for changes
-
To generate again, apply below commands
- hexo clean
- hexo generate
- hexo server -d
-
Go to your post "Test XSS"
-
You'll get the XSS pop-up there every time you open that page because it is stored.
Patch
NA
Supporting Material/References:
- Ubuntu
- 12.11.1
- 6.11.3
- Mozilla
Wrap up
Select Y or N for the following statements:
- I contacted the maintainer to let them know: Y
- I opened an issue in the related repository: Y
Notes: Hey I've already reported the vulnerability to npm security team directly just wanted to report on hackerone. you can cross verify it with my email. I hope you make it a triaged. sorry for the delay. this is a github issue (https://github.com/jaredly/hexo-admin/issues/185)
Impact
Stored XSS allows an attacker to embed a malicious script into a vulnerable page, which is then executed when a victim views the page.
Attachments
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the post content is rendered into the editor and generated pages without sanitising or escaping HTML, allowing injected markup and event handlers to execute.
Impact
Stored XSS allows an attacker to run script in the browser of anyone who views the affected post, which could lead to data modification or loss and system access.
What the attacker needed
Hexo-admin plugin installed; ability to create or edit a post; victim views the post
How it was found
- Start the hexo server from the website directory.
- Open the admin panel and go to the posts section.
- Create a new post with a title and put script-bearing HTML in the content.
- Observe the script executing in the post editor.
- Save the post, rebuild the site, and open the post page.
- Observe the script executing again each time the post is viewed.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Stored cross-site scripting (XSS) means a website saves harmful code that a user typed in, and later shows it to other visitors without cleaning it first. Here, whatever you write in a blog post is saved and then displayed as-is, so a script hidden in the post runs in the browser of anyone who reads it.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.