Repository navigation
fix(security): add path traversal protections to telemetry CSV validation - #5663
Merged
priti-parate merged 3 commits intoNov 2, 2026
Merged
Conversation
…tion The validate_csv_structure() function accepted attacker-controlled file paths without proper validation, allowing local file disclosure via symlinks or absolute/relative path traversal (CWE-22, CWE-59). Add the following security controls, mirroring the hardened pattern already applied in the repo_manager validate_input module: - Resolve symlinks via os.path.realpath() before file operations - Reject symbolic links explicitly with os.path.islink() - Enforce path containment with a new _is_path_within() helper - Open the resolved real path instead of the raw user-supplied input - Pass allowed_dir=input_dir_path at the call site to constrain CSV files to the project input directory Signed-off-by: sayuri <sayuri.kamble@dell.com>
SAYUK09
requested review from
RvishankarOMnia,
VenkateswaraVatam,
abhishek-sa1,
priti-parate and
snarthan
as code owners
October 30, 2026 11:30
abhishek-sa1
approved these changes
Oct 30, 2026
priti-parate
approved these changes
Nov 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the Solution
The
validate_csv_structure()function in the telemetryvalidate_inputmodule accepted attacker-controlled file paths without proper validation, allowing local file disclosure via symlinks or absolute/relative path traversal (CWE-22, CWE-59). An attacker with network access to the telemetry service could supply craftedcsv_file_pathvalues pointing to arbitrary files (e.g./etc/passwd), whose contents would be echoed into logs. This addresses finding from the penetration test report for the telemetry CSV validation path.Related Issue
Changes
telemetry validate_input (
src/telemetry/plugins/modules/validate_input.py)_is_path_within()helper for strict path containment checksos.path.realpath()before any file operationsos.path.islink()_is_path_within()whenallowed_diris providedallowed_dir=input_dir_pathat the call site to constrain CSV files to the project input directoryFiles Changed
src/telemetry/plugins/modules/validate_input.pyvalidate_csv_structure()Backward Compatibility
No breaking changes.