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. 12: Full server-side request forgery #143

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AJaySi
Copy link
Owner

@AJaySi AJaySi commented Jan 5, 2025

Fixes https://github.com/AJaySi/AI-Writer/security/code-scanning/12

To fix the problem, we need to validate the user-provided URL to ensure it only allows requests to authorized domains. One way to achieve this is by maintaining a list of allowed domains and checking if the user-provided URL belongs to one of these domains before making the request.

  • Add a list of authorized domains.
  • Parse the user-provided URL and check if its domain is in the list of authorized domains.
  • If the domain is not authorized, display an error message and stop the execution.

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>
@AJaySi AJaySi marked this pull request as ready for review January 5, 2025 10:28
@AJaySi
Copy link
Owner Author

AJaySi commented Jan 5, 2025

@DikshaDisciplines

Please approve.

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