Skip to content

Stored XSS in the note link href attribute

Moderate
enchant97 published GHSA-rm48-9mqf-8jc3 Jul 28, 2024

Package

/frontend/src/core/renderer.ts

Affected versions

<= 0.13.0

Patched versions

0.13.1

Description

Summary

A stored cross-site scripting (XSS) vulnerability in Note Mark version v0.13.0 allows attackers to execute arbitrary web scripts via a crafted payload injected into the URL value of a link in the markdown content.

Details

Any link created in the note content can contain any protocol inside, which allows potential attackers to specify payloads using "javascript:" instead of the expected https protocol for the created link.

PoC

A registered user can create a new note (or edit any of their existing notes) and edit it.
After that, a stored XSS payload can be injected inside the notes by clicking on the "Insert Link" functionality and adding a malicious payload inside the URL's value.

1-xss-creation
2-xss-created
3-xss-triggered

An example payload is the following: javascript:alert(1)
After adding the link, any user who clicks on the link inside the note's rendered version will trigger the injected script.

Impact

Any user who accesses the note (which can be public) might click on the malicious link, which will cause them to execute any script injected by leveraging this vulnerability. This can cause users to perform unwanted actions on their behalf inside the Note Mark web application, if the user is logged in it can also access the stored access token for api access.

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
Required
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:N

CVE ID

CVE-2024-41819

Weaknesses

Credits