diff options
| author | JP Dillingham <jp@dillingham.me> | 2026-05-17 15:30:56 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2026-05-17 15:30:56 -0500 |
| commit | 4d37deb2cd7f46f1e3a0a683bf9f8507ef39ef54 (patch) | |
| tree | c3e76eaf43a3c361710b3e821b251d0f1ca5f7b7 | |
| parent | e3b6bd9954ea330402f1c44719a82fd56f173196 (diff) | |
| download | slskd-4d37deb2cd7f46f1e3a0a683bf9f8507ef39ef54.tar.gz | |
remove path traversal test from absolute/relative path validation
| -rw-r--r-- | src/slskd/Common/Validation/AbsolutePathAttribute.cs | 6 | ||||
| -rw-r--r-- | src/slskd/Common/Validation/RelativePathAttribute.cs | 6 |
2 files changed, 0 insertions, 12 deletions
diff --git a/src/slskd/Common/Validation/AbsolutePathAttribute.cs b/src/slskd/Common/Validation/AbsolutePathAttribute.cs index 4c9f5e53..1999220f 100644 --- a/src/slskd/Common/Validation/AbsolutePathAttribute.cs +++ b/src/slskd/Common/Validation/AbsolutePathAttribute.cs @@ -49,12 +49,6 @@ namespace slskd.Validation { return new ValidationResult($"The {validationContext.DisplayName} field must be an absolute file path."); } - - // unrelated to absolute/relative check; we disallow traversal segments across the board so check while we're here - if (FileSafety.ContainsTraversalSegments(path)) - { - return new ValidationResult($"The {validationContext.DisplayName} field contains one or more unsafe path traversal segments ('.' or '..')"); - } } return ValidationResult.Success; diff --git a/src/slskd/Common/Validation/RelativePathAttribute.cs b/src/slskd/Common/Validation/RelativePathAttribute.cs index edaef1be..edbb3483 100644 --- a/src/slskd/Common/Validation/RelativePathAttribute.cs +++ b/src/slskd/Common/Validation/RelativePathAttribute.cs @@ -49,12 +49,6 @@ namespace slskd.Validation { return new ValidationResult($"The {validationContext.DisplayName} field must be a relative path."); } - - // unrelated to absolute/relative check; we disallow traversal segments across the board so check while we're here - if (FileSafety.ContainsTraversalSegments(path)) - { - return new ValidationResult($"The {validationContext.DisplayName} field contains one or more unsafe path traversal segments ('.' or '..')"); - } } return ValidationResult.Success; |
