Skip to content

Conversation

@KrzysztofPajak
Copy link
Member

Fixes https://github.com/grandnode/grandnode2/security/code-scanning/311

To fix the problem, we need to ensure that the directoryParam does not contain any path traversal characters or sequences. We can achieve this by validating the directoryParam to ensure it does not contain any ".." sequences or path separators. Additionally, we should ensure that the safeDirectoryName is a valid directory name.

  1. Validate the directoryParam to ensure it does not contain ".." or any path separators.
  2. Ensure that the safeDirectoryName is a valid directory name.
  3. Update the GetSafeFilePath method to include these validations.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@KrzysztofPajak KrzysztofPajak marked this pull request as ready for review December 9, 2024 20:10
@KrzysztofPajak KrzysztofPajak merged commit a45a54b into main Dec 10, 2024
5 checks passed
@KrzysztofPajak KrzysztofPajak deleted the Autofix-311 branch December 10, 2024 17:42
szjanikowski pushed a commit to NoesisVision/grandnode2 that referenced this pull request May 8, 2025
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
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