The vulnerability, as described, allows an unauthenticated user to access the revision history of deleted content. My analysis of the commits between the vulnerable version (1.7.1) and the patched version (2.0.0) revealed a key commit (9ea13af8606976a447e6f3b416c325627ee4fa79) that directly addresses this issue.
The patch does two main things:
- It moves the
/revisions API endpoint from an unauthenticated router group (RegisterUnAuthAnswerAPIRouter) to an authenticated one (RegisterAnswerAPIRouter). This change makes the RevisionController.GetRevisionList function, which handles this endpoint, require authentication.
- It adds a crucial security check within the
RevisionService.GetRevisionList function. This new logic fetches the object's metadata, checks if it's deleted, and if the user is not an administrator or the original author, it returns a 'Not Found' error. This prevents the disclosure of revision history for deleted content to unauthorized users.
Therefore, the vulnerable functions are RevisionController.GetRevisionList, which was the insecure entry point, and RevisionService.GetRevisionList, which contained the flawed logic that failed to perform necessary authorization checks before exposing potentially sensitive data.