Skip to content
XSS Disclosed report Beginner

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.

vu1n Follow

Originally disclosed on HackerOne

  • 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

  1. Prerequisites are

  2. Start the hexo server from website directory (command: hexo server -d)

  3. Access hexo admin panel at localhost:4000/admin

  4. Click on the posts section

  5. Create the new post and give it a title (Test XSS here)

  6. In the post content you can put the below payloads

    1. "><img src=x onerror=alert("XSS")>
    2. "><img src=x onerror=alert(document.domain)>
  7. You'll get the XSS pop-up in the post editor

  8. Save the post and rebuilt the pages with for changes

  9. To generate again, apply below commands

    1. hexo clean
    2. hexo generate
    3. hexo server -d
  10. Go to your post "Test XSS"

  11. 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

_PLUGIN__Hexo-admin-XSS-PoC.webm From the original on HackerOne

The original report as published on HackerOne, by vu1n. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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

  1. Start the hexo server from the website directory.
  2. Open the admin panel and go to the posts section.
  3. Create a new post with a title and put script-bearing HTML in the content.
  4. Observe the script executing in the post editor.
  5. Save the post, rebuild the site, and open the post page.
  6. 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.

More from Node.js third-party modules

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.