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: Server-side request forgery #2

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

Conversation

KintaMiao
Copy link
Owner

Fixes https://github.com/KintaMiao/simplelmt/security/code-scanning/1

To fix the problem, we need to ensure that the customAPI.endpoint is validated against a list of allowed endpoints or domains. This can be achieved by maintaining an allow-list of valid endpoints and checking the user-provided endpoint against this list before making the request. This approach ensures that only pre-approved endpoints can be used, mitigating the risk of SSRF attacks.

  1. Create an allow-list of valid endpoints.
  2. Validate the customAPI.endpoint against this allow-list before making the request.
  3. If the endpoint is not in the allow-list, throw an error.

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>
Copy link

vercel bot commented Dec 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
simplelmt ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 23, 2024 6:07am

Copy link

netlify bot commented Dec 23, 2024

Deploy Preview for simplelmt ready!

Name Link
🔨 Latest commit 06a3670
🔍 Latest deploy log https://app.netlify.com/sites/simplelmt/deploys/6768fe08ad51c10008d7e39e
😎 Deploy Preview https://deploy-preview-2--simplelmt.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

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.

1 participant