Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix code scanning alert no. 1: Uncontrolled data used in path expression #43

Merged
merged 1 commit into from
Dec 29, 2024

Conversation

aegan123
Copy link
Member

Fixes https://github.com/asteriskiry/eventsignup_backend/security/code-scanning/1

To fix the problem, we need to validate the fileName parameter to ensure it does not contain any path traversal sequences or invalid characters. This can be done by checking for the presence of "..", "/", or "\" in the fileName and rejecting the input if any are found. Additionally, we should ensure that the resolved path is within the intended directory.

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>
@aegan123 aegan123 marked this pull request as ready for review December 29, 2024 16:19
@aegan123 aegan123 linked an issue Dec 29, 2024 that may be closed by this pull request
1 task
@aegan123 aegan123 merged commit 582dc02 into develop Dec 29, 2024
4 checks passed
@aegan123 aegan123 deleted the alert-autofix-1 branch December 29, 2024 16:23
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.

Fix code scanning alert - Uncontrolled data used in path expression
1 participant