The analysis is based on the provided security advisory and the associated patch commit cbc106275357302a834280f133265dc39f1384ce. The vulnerability exists in the local block adapter of lakeFS and is a path traversal issue with two distinct vectors.
The commit modifies two functions in pkg/block/local/adapter.go, which are the sources of the vulnerabilities:
-
local.Adapter.verifyRelPath: The patch changes strings.HasPrefix(filepath.Clean(p), l.path) to strings.HasPrefix(filepath.Clean(p), l.path+string(filepath.Separator)). This directly addresses the "Prefix Bypass Vulnerability" described in the advisory, where sibling directories could be accessed because the check didn't enforce a directory boundary. The original function is therefore considered vulnerable as it performs an insufficient validation.
-
local.Adapter.extractParamsFromObj: This function is responsible for converting an object pointer into a physical path. The patch fundamentally changes the logic for path construction and validation. The original implementation joined the base path, namespace, and a user-controlled identifier, and then called the weak verifyRelPath. This allowed an attacker to use ../ in the identifier to traverse out of the intended namespace, as described in the "Namespace Escape via Identifier" section of the advisory. The new implementation first validates the namespace path itself and then ensures the final resolved path is strictly confined within that namespace's path. This function is the core of the second vulnerability, as it improperly handled user-controlled input (ptr.Identifier) leading to path traversal.
During exploitation, an operation like Get or Put on the local block adapter would be called. These operations would then call extractParamsFromObj to resolve the path, which in turn (in the vulnerable version) called verifyRelPath. Therefore, both extractParamsFromObj and verifyRelPath would appear in a runtime profile when the vulnerability is triggered.