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

Conversation

@Geovane2dd
Copy link
Owner

Potential fix for https://github.com/Geovane2Dev/B3API/security/code-scanning/16

To fix the SSRF vulnerability, we need to validate the ticket parameter against a predefined whitelist of allowed values. This ensures that only known and safe ticket values can be used in the outgoing requests. The whitelist can be derived from the stockList fetched on line 13, which already contains valid ticker values. By checking if the ticket exists in the stockList before making the outgoing requests, we can prevent malicious input from being used.

The changes involve:

  1. Validating the ticket parameter against the stockList before constructing the URLs for the outgoing requests.
  2. Ensuring that no unvalidated user input is used in the URL.

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

…gery

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@Geovane2dd Geovane2dd marked this pull request as ready for review May 3, 2025 21:33
@Geovane2dd Geovane2dd merged commit 5f31e6f into main May 3, 2025
6 checks passed
@Geovane2dd Geovane2dd deleted the alert-autofix-16 branch May 3, 2025 21:34
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.

2 participants