Summary
Kedro's version handling logic constructs filesystem paths directly from user-supplied version strings without sanitization, allowing directory traversal sequences like ../ to be preserved.
In deployments where an attacker can influence the version parameter, this can cause Kedro to read or load data from files outside the intended versioned dataset directory, risking unauthorized file access, data poisoning, or cross-tenant data leakage.
Affected context
This issue affects Kedro-based pipelines and applications that:
- Use versioned datasets and rely on Kedro's
DataCatalogor CLI to manage versions - Accept version identifiers from external or semi-trusted sources (e.g., API parameters, user input, orchestration metadata)
- Run with filesystem access to sensitive directories adjacent to or above the dataset storage root
The vulnerability is triggered when Kedro constructs versioned paths via _get_versioned_path() in kedro/io/core.py, which interpolates the version string directly into the path without normalizing or rejecting traversal components.
Exploit preconditions
- Attack surface:
- Programmatic API calls such as:
catalog.load(dataset_name, version=...)DataCatalog.from_config(..., load_versions=...)- CLI usage such as:
kedro run --load-versions=dataset:../../../secrets- Required access: Ability to influence or supply the version string (directly or indirectly) to the Kedro process; typically via configuration, job parameters, environment variables, HTTP endpoints, or orchestration tools that plug into Kedro.
- Trigger point: Any dataset load operation that results in
_get_versioned_path()being invoked with a crafted version string containing path traversal sequences. - Why exploitation is possible: The version value is treated as a raw path component without validation or normalization, so sequences like
../are honored by the filesystem, allowing access to files outside the intended versioned dataset directory.
Why this happens
The root cause is unchecked interpolation of untrusted input into filesystem paths, corresponding to CWE-22: Path Traversal.
Instead of treating the version string as a logical identifier that must be canonicalized and constrained to a specific directory, _get_versioned_path() directly appends the version value to the dataset path. This allows directory traversal tokens (such as ../) or absolute/relative path tricks to modify the effective target location.
The underlying insecure pattern is:
- Using user-controllable data as part of a filesystem path
- Failing to normalize paths and verify they remain within an allowed base directory
- Not enforcing a strict format for version identifiers (e.g., timestamps, UUIDs, or whitelisted patterns)
Potential impact
- Unauthorized reading of files from directories outside the intended versioned dataset location
- Data poisoning by loading attacker-controlled files as if they were trusted dataset versions
- Cross-tenant data access in shared environments where multiple users or projects share the same Kedro infrastructure
- Exposure of configuration files, credentials, or secrets accidentally accessible via filesystem reads
- Undermining of data lineage and reproducibility guarantees by silently loading the wrong sources
General mitigation guidance
Effective mitigation focuses on constraining how version identifiers are mapped to filesystem paths and reducing trust in externally supplied values:
- Treat version strings as logical identifiers, not raw path fragments; enforce strict formats (e.g., regex-validated timestamps, hashes, or UUIDs).
- Normalize and canonicalize constructed paths, then verify they remain within the expected base directory before reading or writing.
- Reject version values that contain path separators, traversal sequences, or other unsafe characters.
- Encapsulate all path construction behind a single, well-reviewed API that applies these checks consistently across catalog, configuration, and CLI entry points.
- Run Kedro processes with least-privilege filesystem permissions so they cannot read or write beyond the directories required for datasets.
- Avoid passing raw user input directly into
load_versionsorversionparameters; instead map external inputs to known-safe internal identifiers.
How teams detect issues like this
Detection involves both code-level inspection and runtime monitoring:
- Static analysis and review:
- Search for functions that construct paths using user-controlled values, especially version parameters or
load_versionsmappings. - Flag any use of string concatenation or interpolation to build paths from unvalidated parameters in
kedro/io/core.pyand related catalog code. - Define secure coding guidelines and linters that prohibit direct inclusion of untrusted values in filesystem paths without validation and base-directory checks.
- Configuration and pipeline review:
- Review pipeline configurations, orchestration scripts, and CLI wrappers that accept version or
load_versionsparameters from external sources. - Look for patterns where arbitrary user input is mapped directly to Kedro version strings.
- Runtime monitoring:
- Log the resolved dataset paths being accessed, and alert when paths escape expected base directories or contain traversal sequences.
- Use host-based monitoring to flag unusual reads of sensitive directories by Kedro processes.
- Automated tools (SAST/secret scanners/CI checks) can be configured with custom rules to detect path traversal patterns and unsafe path construction before deployment.

