Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Conversation

@qnixsynapse
Copy link
Contributor

@qnixsynapse qnixsynapse commented Feb 18, 2025

Describe Your Changes

This PR introduces a sanitizer function that ensures user-provided filenames do not lead to path traversal vulnerabilities by ensuring the path is within our base directory.

cc: @supriza

Self Checklist

  • Added relevant comments, esp in complex areas
  • Updated docs (for bug fixes / features)
  • Created issues for follow-up changes or refactoring needed

@qnixsynapse
Copy link
Contributor Author

Looks like Windows treats paths differently.

@qnixsynapse qnixsynapse marked this pull request as draft February 18, 2025 14:30
@qnixsynapse qnixsynapse self-assigned this Feb 18, 2025
@vansangpfiev
Copy link
Contributor

vansangpfiev commented Feb 19, 2025

Looks like Windows treats paths differently.

I think std::filesystem is cross-platform

@qnixsynapse
Copy link
Contributor Author

Looks like Windows treats paths differently.

I think std::filesystem is cross-platform

Yes, I changed it from std::string which was causing problems because of wchar issues.

@qnixsynapse qnixsynapse marked this pull request as ready for review February 19, 2025 02:48
@qnixsynapse qnixsynapse merged commit 4a4fff4 into dev Feb 19, 2025
16 checks passed
@qnixsynapse qnixsynapse deleted the sanitize_path branch February 19, 2025 12:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants