The root cause of the vulnerability is a path traversal weakness in how Kedro handles version strings for datasets. The core of the issue lies in the AbstractVersionedDataSet._get_versioned_path function, which constructs a file path by directly concatenating a user-supplied version string. This allows an attacker to provide a malicious string containing path traversal characters (e.g., ../) to access arbitrary files on the filesystem.
The vulnerability can be triggered through multiple entry points. The patch explicitly addresses two:
- The
_get_versioned_path function in kedro/io/core.py is the sink where the path is constructed. The fix introduces a call to a new _is_unsafe_version utility function to validate the version string before use.
- The
_split_load_versions function in kedro/framework/cli/utils.py, which parses the --load-versions CLI argument, is a direct source for user-controlled input. This function was also patched to validate the version string upon parsing.
By exploiting this, an attacker could achieve unauthorized file reads, potentially leading to information disclosure, data poisoning, or other impacts depending on the accessible files and application context.