Skip to content

fix: improve path traversal check#370

Merged
ikatson merged 1 commit intoikatson:mainfrom
illfygli:fix-path-traversal
May 8, 2025
Merged

fix: improve path traversal check#370
ikatson merged 1 commit intoikatson:mainfrom
illfygli:fix-path-traversal

Conversation

@illfygli
Copy link
Copy Markdown
Contributor

@illfygli illfygli commented May 8, 2025

The previous implementation would falsely detect a path traversal in a filename such as "foo... bar".
This patch changes the check function so that it inspects PathBuf components instead of substrings.

I don't know much Rust so I hope this makes sense. I have test-driven it myself and verified that I can now add a torrent with a filename containing ... which previously did not work.

The previous implementation would falsely detect a path traversal in a
filename such as "foo... bar".
This patch changes the check function so that it inspects `PathBuf`
components instead of substrings.
@illfygli illfygli force-pushed the fix-path-traversal branch from d2bb000 to f020673 Compare May 8, 2025 22:07
@ikatson ikatson merged commit e83da0b into ikatson:main May 8, 2025
5 checks passed
@illfygli illfygli deleted the fix-path-traversal branch May 9, 2025 07:19
@ikatson
Copy link
Copy Markdown
Owner

ikatson commented May 10, 2025

Thanks for the improvement!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants