Peng.ly Security

Cross-site scripting high 8.8

Stored XSS on imported notes

An imported or Git-synced note can run its own JavaScript as you the next time Poznote opens, without a click, and if you're an admin that means the whole instance.

Poznote
Affected <= 6.80.0 Patched 6.81.2

Published · 1 min read

Summary

Poznote doesn't clean JavaScript out of imported note HTML. This affects individual and ZIP imports, Git pulls and full backup restores. When you're logged in, the app displays that HTML directly. Its default screen opens the most recently updated note, so an imported payload can run on the next app load. You don't need to click the note.

An attacker needs you to import their file or pull it from a shared Git repository. They don't need a Poznote account. Automatic Git pulls still need your normal per-session sync approval.


PoC

1. Save some bad HTML:

<html>
  <body>
    <img src="x" onerror="alert('Stored XSS')">
  </body>
</html>

2. Import

Go to Settings --> Import --> import individual notes and upload it.

3. Reload Poznote

If the imported note is the newest, it opens and runs the alert.


Impact

If you're an admin, one imported or synced note can compromise the whole instance on your next visit, without a click. The payload can read, change or delete every user's notes and attachments, create another admin, reset passwords and change instance settings. There's no separate password check. That access can survive removal of the note. Git sync or webhooks can keep sending data to the attacker.

The script uses your logged-in session. An HttpOnly cookie doesn't stop it - the browser includes it in API requests automatically. The CSP allows inline handlers and HTTPS image beacons. The payload can also create public share links and leak their short tokens, letting the attacker download full notes and attachments outside the CSP, without a beacon's size limit.

It can run again whenever the note auto-opens and copy itself into other notes, so deleting one note may not stop it. If you aren't an admin, the damage is limited to everything your account can access, including your notes, attachments and shares, plus account takeover.