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](https://private-user-images.githubusercontent.com/65404202/352762055-3c5b9271-96a5-41a9-9d3f-01066b80ae31.PNG?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk4NTQ3MDMsIm5iZiI6MTczOTg1NDQwMywicGF0aCI6Ii82NTQwNDIwMi8zNTI3NjIwNTUtM2M1YjkyNzEtOTZhNS00MWE5LTlkM2YtMDEwNjZiODBhZTMxLlBORz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE4VDA0NTMyM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNhMGFlYzA4NTJkZmU3YmFhNjAyNGQzZDk4ZTExMjY5YTJmYzhkNWNiNDU0OWMxZWRmYjFjOWM3YmNhMTExYTYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.goXyQxIY98PRRKDpQtpOdPJ3J3yU328lJDiYt0hJJDU)
![2-xss-created](https://private-user-images.githubusercontent.com/65404202/352762056-33098eda-36cd-4011-a76f-d74babe2264f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk4NTQ3MDMsIm5iZiI6MTczOTg1NDQwMywicGF0aCI6Ii82NTQwNDIwMi8zNTI3NjIwNTYtMzMwOThlZGEtMzZjZC00MDExLWE3NmYtZDc0YmFiZTIyNjRmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE4VDA0NTMyM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWIxMmRmYjIzNWU2NjNkMDdlZjgyY2I3MDgyYTM1NzRjNWMyZDM2NmQ0Y2EzOTcxNDNhNjI0MTNmOGM3YzdhZTMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.H9m_j9QlSZ4d-t2P3Pse0nnDSYbsAqgNCuoGhCa5lQA)
![3-xss-triggered](https://private-user-images.githubusercontent.com/65404202/352762057-c721eab3-5d1d-4d17-9ae4-22044d79e11b.PNG?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk4NTQ3MDMsIm5iZiI6MTczOTg1NDQwMywicGF0aCI6Ii82NTQwNDIwMi8zNTI3NjIwNTctYzcyMWVhYjMtNWQxZC00ZDE3LTlhZTQtMjIwNDRkNzllMTFiLlBORz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE4VDA0NTMyM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTYxZGM5NGQ5MDczNzFkNjhiNGY2NTBmOWRkODU3NDgxN2JiMTE1ZjI1Yjc5ZTRhMWM2MTIxNThhY2E5YjVjZDcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.XzbXw3MELS-TK9Qk6hcBsFJ3nNqIZ_jLJIV8kYHMCUw)
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.
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.
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.