The vulnerability lies in the GRPC authorization middleware of OpenCloud Reva, specifically within the scope validation for public links. The analysis of the security patch 9bb19f69efc3c40a8b077af9961a340f14205ef5 reveals several vulnerable functions in the internal/grpc/interceptors/auth/scope.go file.
The root cause is insufficient validation when checking if a requested resource is within the scope of a public share. The primary vulnerable function was checkRelativeReference, which was completely removed by the patch. The commit message explicitly states this function contained a bug allowing access to resources outside the share's scope.
Another key vulnerable function was checkIfNestedResource. Its original implementation relied solely on path prefix matching to determine if a resource was a child of another. This is a classic path traversal flaw. The patch corrected this by first verifying that both the requested resource and the shared resource belong to the same storage space before checking the path hierarchy.
The function resolvePublicShare is the orchestrator in the vulnerable call chain, as it was responsible for calling the flawed checkRelativeReference function.
Finally, the getRefKey function, which was also removed, played a role in the caching mechanism. Its flawed logic for generating cache keys could have been exploited to bypass security checks.
An attacker could exploit this by crafting a request to the "archiver" service, using a public link token. The flawed validation would allow the archiver to access and package files that the creator of the public link has access to, but which are outside the intended scope of the public link itself. The identified functions would be present in the runtime profile during such an exploitation attempt.