The vulnerability is a broken access control issue in the note-mark backend, allowing unauthenticated users to download private note assets given the correct UUIDs for the note and the asset. The root cause was the lack of authentication and authorization on the asset download endpoint.
The analysis of the fixing commit 6593898855add151eb9965d96998b05e14c62026 identified two key functions involved in the vulnerability:
-
AssetsHandler.GetNoteAssetContentByID in backend/handlers/assets.go: This function serves as the entry point for the vulnerable API endpoint. The patch introduced authentication by retrieving user details from the request context. Its previous implementation lacked any form of authentication, making it the initial point of failure.
-
AssetsService.GetNoteAssetContentByID in backend/services/assets.go: This function contains the core logic for fetching the asset. The patch added a critical authorization step, checking if the note is public or if the user is the owner. The original code was vulnerable because it retrieved assets based solely on their identifiers without verifying ownership or access rights.
An exploit would trigger a call to AssetsHandler.GetNoteAssetContentByID, which then calls AssetsService.GetNoteAssetContentByID. Both functions would therefore be present in a runtime profile during the exploitation of this vulnerability.