Skip to content

Conversation

@arjunsuresh
Copy link
Contributor

Potential fix for https://github.com/mlcommons/mlcflow/security/code-scanning/11

To safely determine if the incoming i_repo_path points to GitHub, we should use URL parsing rather than substring matching. We should use Python's standard library urllib.parse.urlparse to parse the URL and then check if the hostname is exactly 'github.com' (or optionally any subdomain of GitHub, if desired). This fix is to replace the unsafe substring check with a parsed-host equivalence check. The code change is in the conditional at line 88, within the RepoAction.add method, and may require importing urlparse from urllib.parse at the top of the file.


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

…g sanitization

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@github-actions
Copy link

github-actions bot commented Sep 4, 2025

MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅

@arjunsuresh arjunsuresh marked this pull request as ready for review September 4, 2025 15:47
@arjunsuresh arjunsuresh requested a review from a team as a code owner September 4, 2025 15:47
@anandhu-eng anandhu-eng merged commit 48dd398 into main Sep 4, 2025
38 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Sep 4, 2025
@anandhu-eng anandhu-eng deleted the alert-autofix-11 branch September 9, 2025 13:15
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.

3 participants